File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes trouble/w server - stub not found on solaris Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "trouble/w server - stub not found on solaris" Watch "trouble/w server - stub not found on solaris" New topic
Author

trouble/w server - stub not found on solaris

RJ Cox
Greenhorn

Joined: Feb 01, 2002
Posts: 12
Hi folks,
Just a quick question. I've been through most of the boards and didn't quite see the same problem I'm having and thought it must be something easy but subtle.
I've developed the client and server using Windows XP and have gotten them to work on XP, 98, and 2000. However, when I try to run the set on a Solaris (or Linux) I get the Unmarshaled Exception, nested exception ClassNotFound on my server stub class.
I am specifying the server's jar file as the codebase when starting up the registry and server, but the server on solaris always throws the above exception. I even unjarred my server jar file to ensure that the stub class was indeed there and indeed it was. In fact, if I pointed the codebase to the extracted jar file, then it seemed to find it ok. But it seems to have problems finding the stub class when packed into the server jar file.
Anyone experience this; i.e. works fine on Windows, can't find the stub on Unix.
Thanks
RJ
PS: command line
rmiregistry -J-Djava.rmi.server.codebase=myServersJarFile.jar
java -classpath myServerJarFile.jar -Djava.rmi.server.codebase=myServerJarFile.jar suncertify.server.Main
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Unmarshaled Exception

There's your key. This is about security above all. If you have a Security Manager in your code, then you need to include a policy file. the other thing that could be an issue, is going from Windows to Unix, hence the old forward or back slash issue. Check your code for back slashes as they have no meaning in UNIX.
Hope that points you in a good direction.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
xiaoma wang
Ranch Hand

Joined: Mar 04, 2002
Posts: 74
hi Mark:
I can not test my assignment on Unix and according to your post, what i need to pay attention is that the forward and back slash in unix ans windows, is that right?
Xiaoma Wang
xiaoma wang
Ranch Hand

Joined: Mar 04, 2002
Posts: 74
hi, Mark:
In the code to register remote server to rmiregistry, i used the following sentence:
String name = "rmi://127.0.0.1:" + port + "/DataServer"; to rebind the name and the server. the forward slash "/" and "//" in the above expression are not changed in the unix ans windows? Hope get your reply!
Xiaoma Wang
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Originally posted by RJ Cox:

I get the Unmarshaled Exception, nested exception ClassNotFound on my server stub class.

I suggest not to set the codebase property at all on the server side and bundle the _Stub.class files with the client jar.
[ April 23, 2002: Message edited by: Sai Prasad ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

String name = "rmi://127.0.0.1:" + port + "/DataServer"; to rebind the name and the server. the forward slash "/" and "//" in the above expression are not changed in the unix ans windows? Hope get your reply!

Yep, looks close to mine.
Mark
RJ Cox
Greenhorn

Joined: Feb 01, 2002
Posts: 12
SOLVED.
When starting up the rmi registry I had inadvertantly fired it up within a command line that had happened to have a CLASSPATH already set.
Just needed to zap the class path first, then start up the registry.
Thanks all
Rommel Carvalho
Greenhorn

Joined: Mar 27, 2002
Posts: 9
Thank u!
I was having the same problem and u solved it for! I love this site! Tkx!!!
Rommel Carvalho
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: trouble/w server - stub not found on solaris
 
Similar Threads
ClassNotFoundException/AccessControlException
RMI start error
Unmarshal Exception - Class not found
Codebase Problem
codebase and classpath