Results 1 to 8 of 8
Thread: What is wrong with my classpath?
- 07-05-2011, 10:55 AM #1
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
What is wrong with my classpath?
I have an rmi server(HelloWorldServer) and client(HelloWorldClient). The rmi server implements a remote interface(HelloWorldInterface). These 3 classes are part of the same java package(helloworldrmi) and I have created a jar file containing the 3 classes, helloworldrmi.jar
My classpath is -cp path/to/helloworldrmi.jar
When I try to run it using
java -cp path/to/helloworldrmi.jar helloworldrmi.HelloWorldServer
It throws a ClassNotFoundException exception saying helloworldrmi.HelloWorldInterface is not found
What's wrong?
I'm trying this on a windows machine, on a linux machine, it works just fine
- 07-05-2011, 01:33 PM #2
Please post the full text of the error message.
Where is the class: helloworldrmi.HelloWorldInterface
Is there a copy laying around on the linux machine that is not there on Windows?
- 07-05-2011, 04:35 PM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Also show us the contents of the jar file.
Did you jar the folder, or just the 3 classes?
- 07-06-2011, 04:22 AM #4
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 07-06-2011, 04:26 AM #5
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
helloworldrmi.HelloWorldInterface is in the jar file
error message:
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: helloworldrmi.HelloWorldInterface
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: helloworldrmi.HelloWorldInterface
at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:396
)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:250)
at sun.rmi.transport.Transport$1.run(Transport.java:1 59)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport. java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:5
35)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run0(TCPTranspor
t.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport
.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unk nown 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 helloworldrmi.HelloWorldServer.main(HelloWorldServ er.java:59)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
java.lang.ClassNotFoundException: helloworldrmi.HelloWorldInterface
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknow n Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:386
)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:250)
at sun.rmi.transport.Transport$1.run(Transport.java:1 59)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport. java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:5
35)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run0(TCPTranspor
t.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport
.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: helloworldrmi.HelloWorldInterface
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(L oaderHandler.java:7
11)
at sun.rmi.server.LoaderHandler.loadProxyClass(Loader Handler.java:655)
at sun.rmi.server.LoaderHandler.loadProxyClass(Loader Handler.java:592)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RM IClassLoader.java:6
28)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIC lassLoader.java:294
)
at sun.rmi.server.MarshalInputStream.resolveProxyClas s(MarshalInputStrea
m.java:238)
at java.io.ObjectInputStream.readProxyDesc(ObjectInpu tStream.java:1530)
at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1492)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1
731)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:350)
... 12 more
- 07-06-2011, 04:27 AM #6
Looks like everything is there???
Whoops. Got it.
- 07-06-2011, 04:51 AM #7
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 07-06-2011, 09:20 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
what is runtime classpath and what is designtime classpath?
By LongTTH in forum New To JavaReplies: 1Last Post: 05-03-2011, 02:28 AM -
Classpath
By jojo in forum New To JavaReplies: 5Last Post: 02-04-2010, 10:04 PM -
Wrong output (well.. the one who's wrong is probably me ;) )
By shacht1 in forum New To JavaReplies: 2Last Post: 11-22-2009, 03:48 PM -
Classpath on mac osx
By jacobb in forum JDBCReplies: 0Last Post: 06-12-2008, 09:41 PM -
Set classPath?
By rgbosque in forum New To JavaReplies: 3Last Post: 02-07-2008, 02:14 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks