File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trouble/w server - stub not found on solaris

 
RJ Cox
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
xiaoma wang
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 560
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u!
I was having the same problem and u solved it for! I love this site! Tkx!!!
Rommel Carvalho
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic