File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes Remote Exception Error. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Remote Exception Error." Watch "Remote Exception Error." New topic
Author

Remote Exception Error.

Bally Banwait
Greenhorn

Joined: Feb 09, 2005
Posts: 9
Hi I am new to the whole RMI thing and I am desperate for some help.

Each time i run the file NodeImpl which activates a Node daemon i get the following errror

D:\virtual_router\classes>java -Djava.security.policy=client.policy -Djava.rmi.s
erver.codebase=file:// router.NodeImpl
Node Daemon error: RemoteException occurred in server thread; nested exception i
s:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: router.NodeImpl_Stub
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: router.NodeImpl_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:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:534)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.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:160)
at router.NodeImpl.main(NodeImpl.java:105)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
java.lang.ClassNotFoundException: router.NodeImpl_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:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassNotFoundException: router.NodeImpl_Stub
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:430)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.jav
a:200)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:151

The NodeImpl.class and the NodeImpl_Stub.class and the NodeImpl.Skel.class are located on D:\virtual_router\classes\router.
NodeImpl is packaged into router.

The codebase in the policy file is file:/D:/virtual_router/classes/
and the client.policy file is stored in
D:\virtual_router\classes\CLIENT.POLICY

however i am having extreme problems when i run the file i am in the directory D:\virtual_router\classes in the command prompt and use
java -Djava.security.policy=client.policy Djava.rmi.server.codebase=file:// router.NodeImpl

is this correct. because it doesnt seem to locate the stubs ore skeletons.
Any help is appreciated
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Nope, the codebase should be the absolute path to the classes directory -


Or did some of your command prompt get chopped off when you posted it?


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Bally Banwait
Greenhorn

Joined: Feb 09, 2005
Posts: 9
thanks for that,

it worked i think but i;m going to cry because i have got another error its just one thing after another. This is what it is

D:\virtual_router\classes>java -Djava.security.policy=client.policy -Djava.rmi.server.codebase=file///D:/virtual_router/classes/ router.NodeImpl
Node Daemon error: Error unmarshaling return; nested exception is: java.net.MalformedURLException: no protocol: file///D:/virtual_router/cl
asses/
java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.net.MalformedURLException: no protocol: file///D:/virtual_router/cl
asses/
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
217)
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:160)
at router.NodeImpl.main(NodeImpl.java:105)
Caused by: java.net.MalformedURLException: no protocol: file///D:/virtual_router
/classes/
at java.net.URL.<init>(URL.java:537)
at java.net.URL.<init>(URL.java:434)
at java.net.URL.<init>(URL.java:383)
at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
at sun.rmi.server.LoaderHandler.getDefaultCodebaseURLs(LoaderHandler.jav
a:120)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:149)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.jav
a:200)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:151
3)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
215)
... 4 more
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

It looks like you're missing a colon (':') between 'file' and the first slash.
Bally Banwait
Greenhorn

Joined: Feb 09, 2005
Posts: 9
thank you so much. It works.
Thanks
Bally Banwait
Greenhorn

Joined: Feb 09, 2005
Posts: 9
HI thanks for that, i had a few more problems but that was with the policy, but i'm having one more which is

D:\virtual_router\classes>java -Djava.security.policy=client.policy -Djava.rmi.s
erver.codebase=file:///D:/virtual_router/classes/ topo.TopologyServer 3000 topol
ogy.topo2
created router topology for: 192.168.0.2:1000
added neighbour: (192.168.0.2:2000) to (192.168.0.2:1000)
Begin Daemon Chat
created router topology for: 192.168.0.2:2000
added neighbour: (192.168.0.2:1000) to (192.168.0.2:2000)
Begin Daemon Chat
Error starting up topology server: null
java.util.NoSuchElementException
at java.util.StringTokenizer.nextToken(StringTokenizer.java:259)
at router.RouterAssociation.fromString(RouterAssociation.java:31)
at router.RouterAssociation.<init>(RouterAssociation.java:20)
at topo.TopologyServer.readTopology(TopologyServer.java:106)
at topo.TopologyServer.<init>(TopologyServer.java:39)
at topo.TopologyServer.main(TopologyServer.java:57)

The ip addresses get read in froma file, but i'm not sure what this problem is. Any ideas
Bally Banwait
Greenhorn

Joined: Feb 09, 2005
Posts: 9
its ok i sorted it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remote Exception Error.