Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connectin remote DB exception

 
Lijun An
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi gurus,
While I'm testing my assignment, I got this exception at client when I tried to connect to remote DB.

Connecting remote database exception: error unmarshalling return;
nested exception is:
java.lang.ClassNotFoundException: suncertify.server.ConnectionFactory_Stub
java.rmi.UnmarshalException: error unmarshalling return;
nested exception is:
java.lang.ClassNotFoundException: suncertify.server.ConnectionFactory_Stub

The java.policy grants all permissions. When I start rmiregistry, I made sure that CLASSPATH is empty.Then I start the server in another shell with the following setting and command:
  • G:\server>set CLASSPATH=.;%CLASSPATH%
  • G:\server>java -Djava.rmi.server.codebase=file:/g:\server/ -Djava.rmi.server.hostname=host -Djava.security.policy=java.policy suncertify.server.ConnectionFactory db.db
    All classes are in the proper folders, i.e. ConnectionFactory_stub.class and ConnectionFactory_skel.class in .\suncertify\server.
    I also tried using codebase conventions as http://host/server/, file:///g:\server/, but failed either. For http convention, I mapped the physical folder to that URL (http://host/server/), and the folder is in classpath.
    Please help on it.
    Thanks,

  • Lijun
     
    Reshma Das
    Ranch Hand
    Posts: 125
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You get that exception when the client does not have stub in its classpath. make sure that ur client has server classes in its classpath.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic