ClassNotFoundException using HTTP invoker on bean returning
frechdachs Feb 10, 2003 7:26 AMHi everybody!
I have a stateless session bean that returns a java.util.Map (actually a HashMap)
containing an array of custom objects. When calling this bean using the JRMI invoker
everything is working fine. When calling it using the HTTP invoker servlet,
I get a ClassNotFoundException on the client.
As far as I could see, the class loader seems to think that it has to load the array
class for my custom class from the file system. But why I do not have a clue.
For me it looks like a bug in the serialization done in the HTTP invoker layer.
Attached is the src jar and the ejb jar to deploy. The client is aklein.test.client.MapTestClient
requiring the JNDI name of the bean to invoke: aklein/test/MapTest (for JRMI),
aklein/test/MapTestHTTP ( for HTTP ).
And here is the client side out put/stack trace when using HTTP:
creating bean from: aklein/test/MapTestHTTP
log4j:WARN No appenders could be found for logger (org.jboss.naming.HttpNamingContextFactory).
log4j:WARN Please initialize the log4j system properly.
calling getMap:
java.lang.reflect.UndeclaredThrowableException
at $Proxy2.getMap(Unknown Source)
at aklein.test.client.MapTestClient.main(MapTestClient.java:41)
Caused by: java.lang.ClassNotFoundException: [Laklein.test.maptest.Content;
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at org.jboss.invocation.MarshalledValueInputStream.resolveClass(MarshalledValueInputStream.java:37)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1503)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1550)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1261)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at java.util.HashMap.readObject(HashMap.java:986)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:809)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1733)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:78)
at org.jboss.invocation.http.interfaces.HttpInvokerProxy.invoke(HttpInvokerProxy.java:106)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
... 2 more
calling getList:
got list: [[Laklein.test.maptest.Content;@1a9334]
Thanks for any help.
Cheers, Andrea