• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI registry not working if I invoke it from command line

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
when I invoke rmiregistry from command line
(Win'NT) i am getting following exception.
Apparently Naming.rebind is failing.
(All programs including rmid, rmiregistry, RMI activation
setup program are running on local host).
Strangely, If I create rmiregistry programatically, then it
is working. After going through the API documentation, I notice
that LocateRegistry.createRegistry() creates as well as EXPORTS
Registry.
What is meant by exporting RMI registry. If we invoke RMI registry, are not we exporting it?
I tried for 2 days with all permutations and finally
posting this. If some one knew this problem please
help me.
Thanks for reading.
Krishna
Exception trace:
--------------------------------------------------
java.lang.ClassNotFoundException: com.zen.policy.DistPDP.DistPDPImpl_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at com.zen.policy.DistPDP.DistPDPSetup.<init>(DistPDP/DistPDPSetup.java:411)
at com.zen.policy.PSDistPDP.<init>(PSDistPDP.java:51)
at com.zen.policy.PSDistPDP.main(PSDistPDP.java:30)
--------------
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Include the Folder Path for your package in the "CLASSPATH" Env Variable of NT.
 
Krishna Akkineni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Armita. Your pin-pointed reply shot the problem.
It is working if I follows your sugestion.
But I have a contradicting understanding now.
SUN's documentation says following:
--------------
Note: Before you start the rmiregistry, you must make sure that the shell or window in which you will run the registry either
has no CLASSPATH set or has a CLASSPATH that does not include the path to any classes that you want downloaded to your
client, including the stubs for your remote object implementation classes.
If you start the rmiregistry, and it can find your stub classes in its CLASSPATH, it will ignore the server's
java.rmi.server.codebase property, and as a result, your client(s) will not be able to download the stub code for your
remote object
---------
So, If I follow above mentioned text then I am facing the same old problem. If I don't follow (i.e., If I keep classpath
to my classes), then will there be any problems that were
mentioned in the above text.
Thanks Once again.
Krishna

Originally posted by Armita Bansal:
Include the Folder Path for your package in the "CLASSPATH" Env Variable of NT.


 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After successfully started registry when i am going to run my server class file It is giving me this error:
anyone can help me in this.

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.lnt.User
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at com.lnt.User_Server.main(User_Server.java:14)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.lnt.User
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: com.lnt.User
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:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:707)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1499)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1462)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1698)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
... 9 more
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic