12 Replies Latest reply on Nov 9, 2012 10:29 AM by miragpl Branched from an earlier discussion.

    Lookup AS6 EJB from AS7

    Anton Ivakhnenko Newbie

      I'm try to lookup ejb which deployed on Jboss AS6 from myClientApp.war which deployed on Jboss AS 7.1.0Beta1b. During deploying myClientApp.war i got an exception:

       

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.ejb3.dd-based-ejb-client-context."myClientApp.war": org.jboss.msc.service.StartException in service jboss.ejb3.dd-based-ejb-client-context."myClientApp.war": Failed to start service

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar:]

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]

      at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

      Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused

      at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:91)

      at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.createRemotingConnections(DescriptorBasedEJBClientContextService.java:104)

      at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.start(DescriptorBasedEJBClientContextService.java:68)

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:]

      ... 3 more

      Caused by: java.net.ConnectException: Connection refused

      at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) [:1.6.0_26]

      at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567) [:1.6.0_26]

      at org.xnio.nio.NioXnioWorker$1.handleEvent(NioXnioWorker.java:322)

      at org.xnio.nio.NioXnioWorker$1.handleEvent(NioXnioWorker.java:318)

      at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

      at org.xnio.nio.NioHandle.run(NioHandle.java:90)

      at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)

      at ...asynchronous invocation...(Unknown Source)

      at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:263)

      at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:246)

      at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:353)

      at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:337)

      at org.jboss.as.remoting.RemoteOutboundConnectionService.connect(RemoteOutboundConnectionService.java:92)

      at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.createRemotingConnections(DescriptorBasedEJBClientContextService.java:102)

      ... 6 more

       

      What may be wrong?

        • 1. Re: Lookup AS6 EJB from AS7
          jaikiran pai Master

          Anton, I branched your post to a new thread since this is a different usecase (AS7-> AS6 communication) than what was  being discussed in the other thread (AS7 -> AS7 communication).

          • 2. Re: Lookup AS6 EJB from AS7
            Juan Jordaan Newbie

            java.net.ConnectException: Connection refused

             

             

             

             

             

             

             

            See if you can do a telnet to the ejb host on port 4447 from the host where your webapp is located eg. "telnet 192.168.99.140 4447". This could be any number of network related reasons.

            • 3. Re: Lookup AS6 EJB from AS7
              jaikiran pai Master

              Note that the article that you are referring to is for AS7 to AS7 communication. We don't support AS7 to AS6 EJB invocation. You might have to set it up all by yourself something along these lines https://community.jboss.org/message/647589#647589.

              • 4. Re: Lookup AS6 EJB from AS7
                pushpak1981 Novice

                Are they planning to support this functionality in future ?  Because we are also facing the same issue while doing a lookup for JBoss 5.1 EJB's from JBoss7

                • 5. Re: Lookup AS6 EJB from AS7
                  Anton Ivakhnenko Newbie

                  Anton Ivakhnenko wrote:

                   

                  I'm try to lookup ejb which deployed on Jboss AS6 from myClientApp.war which deployed on Jboss AS 7.1.0Beta1b. During deploying myClientApp.war i got an exception:

                   

                  ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.ejb3.dd-based-ejb-client-context."myClientApp.war": org.jboss.msc.service.StartException in service jboss.ejb3.dd-based-ejb-client-context."myClientApp.war": Failed to start service

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar:]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]

                  at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

                  Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused

                  at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:91)

                  at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.createRemotingConnections(DescriptorBasedEJBClientContextService.java:104)

                  at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.start(DescriptorBasedEJBClientContextService.java:68)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:]

                  ... 3 more

                  Caused by: java.net.ConnectException: Connection refused

                  at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) [:1.6.0_26]

                  at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567) [:1.6.0_26]

                  at org.xnio.nio.NioXnioWorker$1.handleEvent(NioXnioWorker.java:322)

                  at org.xnio.nio.NioXnioWorker$1.handleEvent(NioXnioWorker.java:318)

                  at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

                  at org.xnio.nio.NioHandle.run(NioHandle.java:90)

                  at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)

                  at ...asynchronous invocation...(Unknown Source)

                  at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:263)

                  at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:246)

                  at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:353)

                  at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:337)

                  at org.jboss.as.remoting.RemoteOutboundConnectionService.connect(RemoteOutboundConnectionService.java:92)

                  at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.createRemotingConnections(DescriptorBasedEJBClientContextService.java:102)

                  ... 6 more

                   

                  What may be wrong?

                   

                  i found that jboss 6 not listen port 4447 and i'm tried port 3873 (org.jboss.ejb3.RemotingConnectors service) for outbound-socket-binding but now i got an another exception:

                   

                   

                  10:17:44,195 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.ejb3.dd-based-ejb-client-context."myClientApp.war": org.jboss.msc.service.StartException in service jboss.ejb3.dd-based-ejb-client-context."myClientApp.war": Failed to start service

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar:]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]

                  at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

                  Caused by: java.lang.RuntimeException: java.io.IOException: Received an invalid message length of -1393754107

                  at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:91)

                  at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.createRemotingConnections(DescriptorBasedEJBClientContextService.java:104)

                  at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.start(DescriptorBasedEJBClientContextService.java:68)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:]

                  ... 3 more

                  Caused by: java.io.IOException: Received an invalid message length of -1393754107

                  at org.xnio.channels.FramedMessageChannel.receive(FramedMessageChannel.java:125)

                  at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:129)

                  at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:121)

                  at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

                  at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:179)

                  at org.xnio.channels.TranslatingSuspendableChannel$2.handleEvent(TranslatingSuspendableChannel.java:100)

                  at org.xnio.channels.TranslatingSuspendableChannel$2.handleEvent(TranslatingSuspendableChannel.java:98)

                  at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

                  at org.xnio.nio.NioHandle.run(NioHandle.java:90)

                  at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)

                  at ...asynchronous invocation...(Unknown Source)

                  at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:263)

                  at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:246)

                  at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:353)

                  at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:337)

                  at org.jboss.as.remoting.RemoteOutboundConnectionService.connect(RemoteOutboundConnectionService.java:92)

                  at org.jboss.as.ejb3.remote.DescriptorBasedEJBClientContextService.createRemotingConnections(DescriptorBasedEJBClientContextService.java:102)

                  ... 6 more

                  • 6. Re: Lookup AS6 EJB from AS7
                    pushpak1981 Novice

                    Hi  Anton,

                     

                    Were you able to do a sucessful lookup for Jboss6 EJB's on Jboss7.1 ?

                     

                     

                     

                    • 7. Re: Lookup AS6 EJB from AS7
                      Anton Ivakhnenko Newbie

                      pushpak1981 wrote:

                       

                      Hi  Anton,

                       

                      Were you able to do a sucessful lookup for Jboss6 EJB's on Jboss7.1 ?

                       

                       

                       

                      No. And how are your  progress with jboss5?

                      • 8. Re: Lookup AS6 EJB from AS7
                        pushpak1981 Novice

                        still we are facing the typecast exception.

                        • 9. Re: Lookup AS6 EJB from AS7
                          Anton Ivakhnenko Newbie

                          pushpak1981 wrote:

                           

                          still we are facing the typecast exception.

                           

                          i'm avoid this exception by pack classes of remote Ejbs in my .war, but i'm not sure that it's a good way

                          • 10. Re: Lookup AS6 EJB from AS7
                            Carlo de Wolf Master

                            Yes, that is the way.

                             

                            You need to make sure the Remote view class is loaded from the current deployment class loader.

                            • 11. Re: Lookup AS6 EJB from AS7
                              Vatsan Madabushi Novice

                              I'm trying to do something similar. I am tryign to connect from JB 7.1.1 with an EJB client to a JB 4.2.2 server. I get the error.  Does it work fro anyone?

                               

                              15:27:54,009 ERROR [org.jboss.remoting.remote.connection] (Remoting "etmregular1" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of -1393754107

                               

                              15:28:10,354 INFO  [stdout] (MSC service thread 1-1) EJBClient|lookup|INFO|15|DEFAULT|Mon Apr 30 15:28:10 EDT 2012|MSC service thread 1-1|JNDI2 created:::> ejb:wfm/wfm//ETMImp
                              l!com.vzw.wfm.server.etm.ETMInterface|
                              15:28:10,356 INFO  [stdout] (MSC service thread 1-1) EJBClient|lookup|INFO|15|DEFAULT|Mon Apr 30 15:28:10 EDT 2012|MSC service thread 1-1|EJBClient Using JB4|
                              15:28:10,403 WARN  [org.jnp.interfaces.NamingContext] (MSC service thread 1-1) Failed to connect to wfmuat.odc.vzwcorp.com:42010: javax.naming.CommunicationException: Failed t
                              o retrieve stub from server wfmuat.odc.vzwcorp.com:42010 [Root exception is java.io.StreamCorruptedException: unexpected block data]
                                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:209) [g1client.jar:]
                                      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1181) [g1client.jar:]
                                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514) [g1client.jar:]
                                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507) [g1client.jar:]
                                      at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0.13]
                                      at client.EJBClient.lookup(Unknown Source) [classes:]
                                      at client.EJBClient.init(Unknown Source) [classes:]
                                      at client.EJBClient.<clinit>(Unknown Source) [classes:]
                                      at coei.webstore.PendingLinesServlet.<init>(PendingLinesServlet.java:59) [classes:]
                                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0.13]
                                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [rt.jar:1.6.0.13]
                                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [rt.jar:1.6.0.13]
                                      at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [rt.jar:1.6.0.13]
                                      at org.jboss.msc.value.ConstructedValue.getValue(ConstructedValue.java:61)
                                      at org.jboss.as.naming.ValueManagedReferenceFactory.getReference(ValueManagedReferenceFactory.java:49)
                                      at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:90) [jboss-as-ee-
                              7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                                      at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                                      at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                                      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                                      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.as.web.deployment.component.WebComponentInstantiator$1.<init>(WebComponentInstantiator.java:57) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.as.web.deployment.component.WebComponentInstantiator.getReference(WebComponentInstantiator.java:55) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.as.web.deployment.WebInjectionContainer.instantiate(WebInjectionContainer.java:99) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:78) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
                                      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.13.Final.jar:]
                                      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
                                      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
                                      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
                                      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
                                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
                                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
                                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0.13]
                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0.13]
                                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0.13]
                              Caused by: java.io.StreamCorruptedException: unexpected block data
                                      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342) [rt.jar:1.6.0.13]
                                      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) [rt.jar:1.6.0.13]
                                      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) [rt.jar:1.6.0.13]
                                      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) [rt.jar:1.6.0.13]
                                      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) [rt.jar:1.6.0.13]
                                      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) [rt.jar:1.6.0.13]
                                      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) [rt.jar:1.6.0.13]
                                      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) [rt.jar:1.6.0.13]

                               

                              • 12. Re: Lookup AS6 EJB from AS7
                                miragpl Newbie

                                Hi,

                                 

                                I'm trying to invoke EJB deployed on jb6 from jb7. Using yours AluniteClassLoader I managed to get the Context object. But whenever I try to lookup any object from it I get an NULL result. When I check the contents of the context object using the : list method I got my bean:

                                     my-server/Bean!remote : $Proxy145

                                but when I tried to do lookup with

                                context.lookup(my-server/Bean!remote) I got a NULL result.

                                 

                                Any idea what is wrong?

                                 

                                I would appreciate any hint.