1 Reply Latest reply on Nov 1, 2007 4:55 AM by zagarol

    Calling a local 2.x stateless session bean from a remote ejb

    zagarol

      Hi,
      I am currently tinkering with upgrading an existing system to use EJB3 so we can take advantage of the new interceptors in EJB 3.

      The code which currently exists uses a remote session facade which then delegates off to local session(s) for doing the work. Our first task is to replace the remote facades with EJB 3 versions and then slowly replace the local sessions on a per item basis. This means we can leverage the interceptors to bring in the extra functionality required without the big bang of migrating all the session beans.

      However, we have successfully packaged up the facades as EJB 3 and split these into their own jar still with in the same EAR. But when we try to perform the lookup to get the local session bean as outlined on http://blogs.sun.com/enterprisetechtips/entry/ejb_3_0_compatibility_and. This fails but if we try to connect to them remotely instead of locally then this works.

      Is it not possible to use the local 2.X beans with a EJB 3 bean?

      Many thanks,
      Shane Preater
      www.onevisionsupport.com

        • 1. Re: Calling a local 2.x stateless session bean from a remote
          zagarol

          Quick update for anyone who is trying to do the same as me.

          I have now got this working the process I used is:
          1) Keep all your beans packaged as before.
          2) Update the ejb-jar.xml to use the latest schema.
          3) Update jboss.xml to use the latest schema.
          4) update the ejb-jar to have a remote reference (This is to get around the JBoss bug EJBTHREE-933 which throws a NullPointerException if no remote interfaces are provided. Once the bug is fixed this can probably be removed).

          And voila it all works like a charm. We can now intercept our facade beans and all is good :)

          Shane Preater
          www.onevisionsupport.com