10 Replies Latest reply on Jan 12, 2007 2:27 PM by tom.elrod

    JBoss & Java 1.6 class loading issue?

    mousersvk

      Hello, I am using JBoss AS 4.0.4 / JBoss AS 4.0.5 and this problem occures on both while using JRE/JDK 1.6 on the client side.

      I've got simple EJB3 and invoking its method like this:

      // get the initial context
       Context ctx = new InitialContext();
       // find context of our interface
       Locator test = (Locator) ctx.lookup("LocatorBean/remote");
      
       // perform 'invoke()' method on bean itself
       GetCitiesRequest req = new GetCitiesRequest("Slovakia", "Bratislava");
       System.out.println(test.invoke(req));


      Object that has 'String' class inside is returned. Logic of bean is performed successfully, but while the result is being returned back to client, following exception is thrown (there is only cause, real:

      java.lang.reflect.UndeclaredThrowableException
       at $Proxy0.invoke(Unknown Source)
       ..
      Caused by: java.lang.ClassNotFoundException: [Ljava.lang.String;
       at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
       at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
       at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
       at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
       at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
       at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:107)
       at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
       at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
       at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
       at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
       at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
       at org.jboss.remoting.Client.invoke(Client.java:525)
       at org.jboss.remoting.Client.invoke(Client.java:488)
       at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
       ... 2 more
      


      Everything is fine when using Java 1.5 on client side. I've tried running the server both on Java 1.5 and 1.6. Results were the same.
      Maybe there is problem in loading of class because of Java 1.6 runtime regression, as it is described here ?:

      http://forums.java.net/jive/thread.jspa?threadID=15823
      https://glassfish.dev.java.net/issues/show_bug.cgi?id=714

      Similar problem is described here (I think it is the same one):
      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988513[/url]

      Anyone else experiencing this? Or can someone tell if this is bug in JBoss?

      Thanks,
      Mouser.