PDA

View Full Version : httpinvoker ClassNotFound on DTO. only during client -> server



hozo
Dec 20th, 2005, 06:01 PM
I'm using oc4j 10.1.2 standalone and receive a classNotFound exception when I send a DTO from the client to the server as a method parameter. Both sides have the class (server deployed as ear). The client can receive fine, but the server errors out when it tries to receive the DTO.

I'm using the term DTO loosely here, it's just some class I want to transfer over.

It works if I place the DTOs in the app server's startup lib dir, but that seems like pretty bad for re/deployment.

Any ideas?

Thanks


[java] java.lang.ClassNotFoundException: server.model.User
[java] at com.evermind.naming.ContextClassLoader.findClass(C ontextClassLoader.java:329)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
[java] at com.evermind.naming.ContextClassLoader.loadClass(C ontextClassLoader.java:154)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:242)
[java] at java.io.ObjectInputStream.resolveClass(ObjectInput Stream.java:574)
[java] at org.springframework.remoting.rmi.CodebaseAwareObje ctInputStream.resolveClass(CodebaseAwareObjectInpu tStream.java:77)
[java] at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1538)
[java] at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1460)
[java] at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1693)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1299)
[java] at java.io.ObjectInputStream.readArray(ObjectInputStr eam.java:1628)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1293)
[java] at java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1912)
[java] at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1836)
[java] at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1713)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1299)
[java] at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:339)
[java] at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.doReadRemoteInvocation(HttpInvok erServiceExporter.java:172)
[java] at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.readRemoteInvocation(HttpInvoker ServiceExporter.java:123)
[java] at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.readRemoteInvocation(HttpInvoker ServiceExporter.java:100)
[java] at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.handleRequest(HttpInvokerService Exporter.java:79)
[java] at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
[java] at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:684)
[java] at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:625)
[java] at org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:386)
[java] at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:355)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
[java] at com.evermind.server.http.ServletRequestDispatcher. invoke(ServletRequestDispatcher.java:810)
[java] at com.evermind.server.http.ServletRequestDispatcher. forwardInternal(ServletRequestDispatcher.java:322)
[java] at com.evermind.server.http.HttpRequestHandler.proces sRequest(HttpRequestHandler.java:790)
[java] at com.evermind.server.http.HttpRequestHandler.run(Ht tpRequestHandler.java:270)
[java] at com.evermind.server.http.HttpRequestHandler.run(Ht tpRequestHandler.java:112)
[java] at com.evermind.util.ReleasableResourcePooledExecutor $MyWorker.run(ReleasableResourcePooledExecutor.jav a:192)
[java] at java.lang.Thread.run(Thread.java:595)

hicmndr
Apr 28th, 2006, 03:25 PM
I'm having the same problem with httpinvoker on tomcat. When my web server attempts to pass the DTO object via httpinvoker I get a ClassNotFoundException on the DTO object. I've deployed the DTO class file on both the web server and the app server.

Tomcat 5.5.9
Spring 1.2.7

Anyone else run into this?

rmch
May 1st, 2006, 07:52 PM
Hozo,

FYI, I just added a method (to do what you're describing) to a HttpInvoker sample I'm working on.

I deployed the web-app to a standalone OC4J 10.1.3 instance (<--NOTE: not 10.1.2) and ran the client code from the IDE. It worked fine.

I've run into classloader issues before with OC4J 10.1.2. I would recommend stopping and restarting your standalone OC4J instance after every deployment of your web-app. See if that helps.

I'd be interested to see if you have any other problems with 10.1.2 (and if you resolve them) as we're largely using 10.1.2 for our production environment.

Thanks.