2 Replies Latest reply on Jun 30, 2010 6:02 PM by asookazian

    Deproxy a Seam component that is being passed as a remote EJB parameter?

    cwash

      A coworker of mine recently brought up a scenario that was a bit surprising to me, it involves 2 components and a remote EJB



      • He has a reference to Component B that is injected into Component A.

      • Component B's class lives in a client jar that is visible to both the Seam project, and the remote EJBs, and is defined in components.xml within his Seam project.

      • Within one of Component A's methods he is trying to pass Component B into the remote EJB as a parameter.

      • The proxy class (javassist) is serialized across the wire and shows up as the parameter to the remote EJB call, causing it to bomb out.




      My question is similar to:
      http://seamframework.org/Documentation/CanIHoldAReferenceToASeamComponentSuchAsInAList




      Is there a way to 'decomponentize' Component B? In other words, if you have a Seam component as a remote EJB parameter, is there a way to prevent the proxy class from being passed as the parameter to the remote call?



      Notes:


      At one point my coworker added the Seam JAR to the remote EJB project and annotated Component B's class with @Named, which caused an exception (I believe on deserialization or first access of the class) that would throw an exception... SeamNotInitialized.  Obviously this wasn't going to work.  I had him remove the @Named annotation in favor of not having that annotation live in the client JAR, and just configuring it in components.xml on the Seam side of the equation.  This removes all Seam dependencies for the Remote EJB application, except, I suppose, for all of the Component-proxy stuff.