Results 1 to 3 of 3

Thread: httpinvoker ClassNotFound on DTO. only during client -> server

  1. #1
    Join Date
    Dec 2005
    Posts
    9

    Default httpinvoker ClassNotFound on DTO. only during client -> server

    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
    Code:
       [java] java.lang.ClassNotFoundException: server.model.User
       [java]     at com.evermind.naming.ContextClassLoader.findClass(ContextClassLoader.java:329)
       [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       [java]     at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:154)
       [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       [java]     at java.lang.ClassLoader.loadClassInternal(ClassLoader.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(ObjectInputStream.java:574)
       [java]     at org.springframework.remoting.rmi.CodebaseAwareObjectInputStream.resolveClass(CodebaseAwareObjectInputStream.java:77)
       [java]     at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
       [java]     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
       [java]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
       [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       [java]     at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1628)
       [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1293)
       [java]     at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
       [java]     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
       [java]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       [java]     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       [java]     at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.doReadRemoteInvocation(HttpInvokerServiceExporter.java:172)
       [java]     at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.readRemoteInvocation(HttpInvokerServiceExporter.java:123)
       [java]     at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.readRemoteInvocation(HttpInvokerServiceExporter.java:100)
       [java]     at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:79)
       [java]     at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.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.serviceWrapper(FrameworkServlet.java:386)
       [java]     at org.springframework.web.servlet.FrameworkServlet.doPost(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.processRequest(HttpRequestHandler.java:790)
       [java]     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
       [java]     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
       [java]     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
       [java]     at java.lang.Thread.run(Thread.java:595)

  2. #2
    Join Date
    Apr 2006
    Posts
    1

    Default

    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?

  3. #3
    Join Date
    May 2006
    Posts
    18

    Default ...

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •