Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Problem running server from jar file

Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having strange problem and spent a lot of time to figure it out with no success. I have created a jar file and trying to test that from diferent drive on my machine, say c:\test folder. For testing I am using folling to command:
c:\test\start rmiregistry
c:\test\java -jar server.jar -d db.db
When the server try to bind to registry it gives error saying:
Error: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: suncertify.server.DatabaseImplServer_Stub
It look like it is trying to find the stub file of the server implementation and did not get it, it is there though.
I gave the jar file to one on my friend to run this two command on his machine and it worked. Also on my machine, if I run the first command to start the rmiregistry from the application folder, where I created the application, and then run the second command from any place to run the jar file then works!!!
Any idea or suggestion will be greatly appreciated.
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the problem is that when you start the rmiregistry command it can't have access in the classpath to the stub class. That is why if you launch the rmiregistry in a different folder than the stub it works. To solve the problem you have to either start the rmiregistry in a different directory OR set the classpath to nothing or a directory that doesn't contain the stub. On windows you can use the following set of commands:
C:\start rmiregistry
C:\java ... (Application Executable)
The section called Start the Server on the RMI Tutorial provides more information on this issue.
Hope this helps.
Dhiman Biswas
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link helped.
Thanks a lot.
Good heavens! What have you done! Here, try to fix it with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic