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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

class not fouond exception when using rmi

Status
Not open for further replies.

blues77

Programmer
Jun 11, 2002
230
CA
Hello,

I'm getting a class not found exception when trying to invoke a server that I wrote. Here is the output from the exception

Code:
Remote Exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
        java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
        java.lang.ClassNotFoundException: server.S_Student_Stub

Now the class S_Student_Stub is under a direcotry called server in the directory where I am running the batch file from. Here is how the directory stucture looks.

Code:
F:\mike\[URL unfurl="true"]www\classes>dir[/URL]
 Volume in drive F is Partition2
 Volume Serial Number is BC78-D778

 Directory of F:\mike\[URL unfurl="true"]www\classes[/URL]

11/07/2004  04:37 PM    <DIR>          .
11/07/2004  04:37 PM    <DIR>          ..
11/07/2004  04:17 PM    <DIR>          common
11/07/2004  04:12 PM               188 policy.txt
11/07/2004  04:34 PM                66 run.bat
11/07/2004  04:30 PM               166 runServer.bat
11/07/2004  04:12 PM    <DIR>          server
11/07/2004  04:12 PM             2,461 S_Student_Skel.class
11/07/2004  04:12 PM             4,744 S_Student_Stub.class
               5 File(s)          7,625 bytes
               4 Dir(s)   1,050,386,432 bytes free

This is the contents of the run.bat file which I am using.

Code:
java -Djava.security.policy=policy.txt server.Server 192.168.1.104

If anyone knows why this error is occuring I would greatly appreciate your help.

Thanks
 
You need to run rmic server.Server from the F:\mike\then cpoy the Stub class into your clients directory or deploy the server on a web server e.g PWS or Apache
let's say on Apache you copy the server directory to htdocs/MyProject/server; put the startServer.bat in My Project directory

Your batch file should read:
java -Djava.security.policy=policy.txt -Djava.rmi.server.codebase= Project/classes/server/" server.Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top