10 Replies Latest reply on Jul 10, 2013 11:39 AM by batonikus

    Remote EJB call from 7.1 to 4.2.3

    apodgorsek

      As we are in the middle of a AS 7.1 based project, we got new specs that there are some remote EJB's that we need deployed on an old 4.2.3. instance. Can you someone provide an example and explain how could this be done?

        • 1. Re: Remote EJB call from 7.1 to 4.2.3
          apodgorsek

          Please anyone?

          • 2. Re: Remote EJB call from 7.1 to 4.2.3
            jaikiran

            I don't think anyone has tried that. For one, JBoss AS 4.2.x was not fully EJB spec compliant https://community.jboss.org/thread/109316. Furthermore AS7 is vastly different from previous versions of JBoss AS and trying to make them work together, IMO isn't really worth the efforts. There are a few users who have tried doing something similar against AS5 here https://community.jboss.org/message/648150#648150.

             

            You might have to rethink the usecase of deploying on AS 4.2.x when AS 7.1.0.Final is already available and is Java EE 6 full profile certified and even boots faster than 4.2.x.

            • 3. Re: Remote EJB call from 7.1 to 4.2.3
              apodgorsek

              Maybe I didn't express myself correctly. I have a JBoss AS 7.1 application already developed, but I need to access Remote EJBs deployed on a JBoss 4.2.3 from my JBoss AS 7 application.

               

              So basically:

               

              JBoss AS 7.1. -> remote EJB call -> JBoss 4.2.3

              • 4. Re: Remote EJB call from 7.1 to 4.2.3
                ctomc

                Hi,

                 

                given the fact that AS7 has modular isolated classloader, what you can try is create a new module and call it for example "org.jboss.client.legacy" (or something that gives you some meaning)

                put in there all the jars that you would need when connecting to 4.2.3 as from standalone client(usually jbossall-client.jar) define dependencies and put dependancy to it in your deployment (jboss-deployment-structure.xml)

                and try to call the methods... if that does not work, try to put code that does the calling in same module where client libs are, and that call that code from you application.

                The last scenario would be two modules on with client libs and another with calling code. the difference here would be that your application would not have dependancies to client classes but just to your calling the remote code classes.

                 

                But as Jaikiran pointed out chanses are that it won't work at all.

                 

                If you give it a try let us know how it goes.

                 

                --

                tomaz

                • 5. Re: Remote EJB call from 7.1 to 4.2.3
                  apodgorsek

                  Maybe I am wrong but isn't remote EJB in context of exposing remote and reusing in other containers the essence of this spec? I've sucessfully called for example remote EJB's from Websphere 6 to 7 and vice versa. And it worked even though they have different versions of java runtime and implementation of java ee spec. I think maybe to call a remote ejb from jboss 4 to 7 could be difficult cause of forward compatibility, but from jboss 7 to 4 it should be a breeze, cause u probably have to guarantee some kind of backward compatibility.

                  • 6. Re: Remote EJB call from 7.1 to 4.2.3
                    ctomc

                    Hi,

                     

                    jboss 4.2.3 was a "in-between" version of application server that was essentially EE 1.4 based but added support for EE5 but not completely. so it was never certified version of application server as it does not comply to many standards that it should.

                    4.2.x was done mainly because of version 5 was far away and users wanted to use ee5(ejb3 for most) features

                     

                    that is the problem why compatibility won't work out of the box...

                     

                    --

                    tomaz

                    • 7. Re: Remote EJB call from 7.1 to 4.2.3
                      apodgorsek

                      Can you please elaborate on how to do "

                      what you can try is create a new module and call it for example "org.jboss.client.legacy" (or something that gives you some meaning)

                      put in there all the jars that you would need when connecting to 4.2.3 as from standalone client(usually jbossall-client.jar) define dependencies and put dependancy to it in your deployment (jboss-deployment-structure.xml)

                      and try to call the methods... if that does not work, try to put code that does the calling in same module where client libs are, and that call that code from you application.

                      The last scenario would be two modules on with client libs and another with calling code. the difference here would be that your application would not have dependancies to client classes but just to your calling the remote code classes."

                       

                       

                      Any code/app samples are much appriciated!

                      • 8. Re: Remote EJB call from 7.1 to 4.2.3
                        ctomc

                        Hi,

                         

                        first take a look at this: https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7

                        it will explain you how classloading works in general and what modules are and how can they be defined  https://docs.jboss.org/author/display/MODULES/Home

                         

                        this will get you the basic picture what i was talking about

                         

                        Othervise i recomend you to come to irc channel #jboss-as7 so we can talk in real time...

                         

                        --

                        tomaz

                        • 9. Re: Remote EJB call from 7.1 to 4.2.3
                          pugals

                          Does not work.

                           

                          Created a Module that contains the jar file that calls the remote EJB in AS 6. The dependent AS 6 client jars are copied in the lib folder in the same module.

                           

                          Get the following exception on invocation:

                          javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jnp.interfaces.NamingContextFactory from classloader ModuleClassLoader for Module

                           

                          I think the 7.1 is not backward compatible with any previous version and no one in the JBOSS team have any plans to fix it.

                          • 10. Re: Remote EJB call from 7.1 to 4.2.3
                            batonikus

                            I nailed down the JBoss 7.2. remote calls on JBoss4.2.3 - and described it under https://community.jboss.org/wiki/CallingRemoteInterfaceDeployedInJBoss423FromJBoss72