Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RMI newbie - trying to run server gets exception noclassfound

Status
Not open for further replies.

mcowen

Programmer
Oct 21, 2001
134
GB
Hi,

I am trying to run a RMI server app called ComObject. When I do however I get this...

An Exception occured while creating server
Exception: Server RemoteException; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: ComObject_Stub


All the files are in the same directory. I am trying to run this with....

java -Djava.rmi.server.codebase=file://c:\public_html\myclasses\RMI_Example/ -Djava.security.policy=java.policy ComObject


Nothing I seem to do makes any difference. Have I got the paths correct? Help is greatly appreciated.

Regards
Matt
 
Hi Matt,
Check if you have added this path to the classpath of your system. If not do so and your program would work fine.

Regards,
Rajarajan
 
Ok,

I wrote the following...

set CLASSPATH=c:\public_html\myclasses\RMI_example

Then the java command above. This still gave me the error. I dont have a policy file and I am not sure how to write one. Could this be the problem? (I am not convinced as other example RMI programs with a policy file included dont work either and give the same error). Has anyone got an RMI example they know works on jdk1.4, can provide the directory structure to use and the steps to follow?

rgds
Matt
 
Hi Matt,
Add the following lines to a new file and name it as myPolicy.file

grant {
permission java.security.AllPermission;
};

Then in the command line, while executing the app add
-Djava.security.policy=myPolicy.file.

Hope you'll succeed.

Regards,
Rajarajan
 
Thanks rajarajan for your continued help on this.

Unfortunately myPolicy.file has not made any difference. I put it in the same directory as the example.

Please can someone provide an RMI example, the directory structure and steps to follow?

rgds
Matt
 
Thanks.

I have tried both of these examples! I must be doing something fundamentally wrong. I have started to go through them again now so we will see....

Thanks for the assistance.
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top