Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[URGENT!] RMI Server Exception: Where is the STUB?

4 views
Skip to first unread message

_Fabio_

unread,
Oct 24, 2002, 4:25:53 PM10/24/02
to
Good evening,
I've a problem with RMI for a project I must finish in few days.
I've created a server that just register a rmote object at rmi registry. I
know that it need the stub file of the remote object.
I've generated this stub file, and this is available in the same class of
the remote object class.

Well, starting the server, it throws this exception:

----------------------------------------------------------------------
java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception is:
java.lang.ClassNotFoundException: mypackage.ProxyImpl_Stub

at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:352)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
at java.lang.Thread.run(Thread.java:536)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:247)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:159)

Caused by: java.rmi.UnmarshalException: error unmarshalling arguments;
nested exception is:
java.lang.ClassNotFoundException: mypackage.ProxyImpl_Stub
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:342)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
at java.lang.Thread.run(Thread.java:536)

Caused by: java.lang.ClassNotFoundException: mypackage.ProxyImpl_Stub
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)

.......................
etc etc
----------------------------------------------------------------------------
----------------------

Where do I get wrong???
I don't know if I've to set a classpath to say the registry where it should
find classes (I'm working with JBuilder).

Does anyone can/want help me to solve this simply problem??

Please!!

Fabio


Wendy S

unread,
Oct 24, 2002, 9:52:43 PM10/24/02
to
_Fabio_ wrote:
> Where do I get wrong???
> I don't know if I've to set a classpath to say the registry where it
> should find classes (I'm working with JBuilder).
> Does anyone can/want help me to solve this simply problem??

Forget all the RMI errors... read the error messages and they look just like
the ones you get when your classpath isn't set right. Have you gotten this
to work from a command line?

I'm not much for pointy-clicky IDE's until you know how to do things
yourself at a prompt.

I'd go through the RMI tutorial at Sun's site and see if you can get a
simple example to work, then see if you can find the differences between
the working example and your own project.

--
Wendy in Chandler, AZ

Sushil Sureka

unread,
Oct 24, 2002, 11:46:52 PM10/24/02
to
You have to put the stub classes in the rmiregistry classpath.
Basically if you are starting the registry from the command line, just
set the classpath in the dos window to point to the proper class files
and then start the rmiregistry
Sushil

"_Fabio_" <nom...@italia.it> wrote in message news:<ap9kua$1jp$1...@lacerta.tiscalinet.it>...

wing

unread,
Oct 25, 2002, 10:35:11 AM10/25/02
to
Check the codebase property carefully, a lib needs the ending /.

For lib
-Djava.rmi.server.codebase=file:///home/auser/alib/

For jar
-Djava.rmi.server.codebase=file:///home/auser/alib/ajar

Wing

_Fabio_

unread,
Oct 25, 2002, 12:34:38 PM10/25/02
to

"wing" <wing...@witty.com> wrote in message
news:873e96d6.02102...@posting.google.com...

Ok. Thanks to all!! I've discovered the problem. I got wrong with
directories and names of packages of class files. Now all runs well!!

Fabio


0 new messages