0 Replies Latest reply on Aug 28, 2007 11:47 PM by Ed Xu

    Why does JBoss4.0.5GA not compatible with JBoss4.2.1GA while

    Ed Xu Newbie

      I have an application EAR package that deployed in a JBoss4.0.5GA server, the EAR have lots of EJB2.1 style beans and a WAR. Now I need to call a remote EJB3 style bean in another JBoss4.2.1GA server. My JNDI configuration is:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=10.100.x.x

      But when it invoke lookup(), cause exceptions:
      javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.remoting.InvokerLocator; local class incompatible: stream classdesc serialVersionUID = -4977622166779282521, local class serialVersionUID = -2909329895029296248]
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at com.xued.ejb3.ejb.SSOBeanClient.main(SSOBeanClient.java:15)
      Caused by: java.io.InvalidClassException: org.jboss.remoting.InvokerLocator; local class incompatible: stream classdesc serialVersionUID = -4977622166779282521, local class serialVersionUID = -2909329895029296248
       at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:546)
       at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
       at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
       at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
       at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
       ... 3 more

      But when I use jbossall-client.jar in JBoss4.2.1GA to run a client program with the same code, it is nomal. I try to copy the jbossall-client.jar from JBoss4.2.1GA in my EAR directory, and make this jar in ejb jar class path, but the default ClassLoader doesn't load this jar. So I modified the jboss-app.xml, use HeirarchicalLoaderRepository3 to load local jar file first, as this:
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-app>
       <loader-repository loaderRepositoryClass='org.jboss.mx.loading.HeirarchicalLoaderRepository3'>
       sso:loader=sso.ear
       <loader-repository-config configParserClass='org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser'>
       java2ParentDelegaton=true
       </loader-repository-config>
       </loader-repository>
      </jboss-app>

      Then the situation even get worse, the EJB2.1 beans deploy failed!
      WARN [ServiceController] Problem creating service jboss.j2ee:jndiN
      ame=ejb/AsyncSender,service=EJB
      java.lang.ClassCastException: $Proxy70
       at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.getEJBLocalHome(Bas
      eLocalProxyFactory.java:243)
       at org.jboss.ejb.Container.createService(Container.java:803)
       at org.jboss.ejb.SessionContainer.createService(SessionContainer.java:16
      0)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBean
      Support.java:260)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
      eanSupport.java:243)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:978)
       at $Proxy0.create(Unknown Source)
       at org.jboss.system.ServiceController.create(ServiceController.java:330)
      ...

      So, is there any way to call Jboss 4.2.1GA EJB3 bean from a JBoss 4.0.5GA EAR application?