The error you are seeing is coming from the server - it is the
server that cannot find the class Foo, not the client. If you deploy EJBs
in separate JARs that have references to each other, you must include the
home and remote interfaces (and primary keys, etc) of the referenced EJB
in the jar of the referencer. Or better yet, package everything in one
JAR.
Aaron
On Tue, 24 Oct 2000, Rhett Guthrie wrote:
> When I do a home.create(), it seems that the proxy marshalling is done
> using the system classloader only, and not using the classloader of the
> object invoking the create. I am getting a ClassNotFoundException on a
> class when I do a create:
>
> System.out.println( Foo.class ); // this works fine
> Foo foo = (Foo) fooHome.create(); // CNFE here!
>
> Seems weird that I can lookup the home (whose interface comes from the
> same Jar as the bean interface) and that I can actually refer to the
> remote interface in my code but that the create method fails because it
> can't find the remote interface.
>
> ANyone have any idea why this is happening?
>
> Here is the stack trace:
>
> java.lang.reflect.UndeclaredThrowableException:
> java.lang.ClassNotFoundException: com.company.Foo
> 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:297)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:195)
> at
> sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.j
> ava:183)
> at
> java.io.ObjectInputStream.inputProxyClassDescriptor(ObjectInputStream.ja
> va:982)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
> at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
> at java.rmi.MarshalledObject.get(MarshalledObject.java:138)
> at
> org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:22
> 1)
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]