• 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

rmi error running server under jre:

 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, everybody, this is a long post, but I need HELP-
Can't seem to run my code under the jre (runs fine under jdk):
What I did:
1. Removed references of JDK in the path statement
2. Set my path to C:\jdk1.3.1\jre\bin;%PATH%;
3. Switch to directory c:\scjd (where the project is loaded)
4. Classpath set to '.'
5. Try to run start the rmi server:
java -Djava.rmi.server.codebase=file:///c:\scjd/suncertify\db/ -Djava.security.policy=policy suncertify.db.RemoteDataServer db.db localhost
where a) db.db is in the default directory (c:\scjd)
b) policy file is also in the default directory
c) policy file is set to: java.security.AllPermission;
Error I get is:
DataServer: starting DataServer using database: db.db, host: localhost
db.db opened.
DataServer: Error! -- RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: suncertify.db.RemoteDataServer_Stub
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: suncertify.db.RemoteDataServer_Stub
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: suncertify.db.RemoteDataServer_Stub
java.lang.ClassNotFoundException: suncertify.db.RemoteDataServer_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:245)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:354)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at suncertify.db.RemoteDataServer.main(RemoteDataServer.java:215)
So the server kicks off, which means classpath should be OK but it can't find the damn stub (which IS in suncertify/db/)
Any ideas? I'm stuck here.
thanks,
Max
BTW, I have an RMI security manager in my dataserver


 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing that your server class is actually located in the package suncertify.db. You might try
java -Djava.rmi.server.codebase=file:///c:/scjd/
instead of
java -Djava.rmi.server.codebase=file:///c:\scjd/suncertify\db/
Basically, I think the codbase you're giving for your rmi server doesn't include the suncertify.db package because the corresponding codebase would have been C:\scjd otherwise.
 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sajid-
Right you are. I don't quite understand why it worked under the JDK.
Max
 
Sajid Raza
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it depends on how you'r starting the rmiregistry. In order to avoid specifying a server codebase I used to start the rmiregistry in the same current directory as the root directory of my classpath.
Were you starting rmiregsitry in c:\scjd ?
 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sajid-
Yes, I was (am). c:\scjd is the root directory of my classpath. Not sure how else to do it.
max
 
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic