This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes PLEASE HELP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "PLEASE HELP" Watch "PLEASE HELP" New topic
Author

PLEASE HELP

Tina Ljuslin
Greenhorn

Joined: Jun 08, 2001
Posts: 25
Hi,
I'm just getting ready to upload my assignment and everything works fine on my computer, BUT when i try it on another computer i get exceptions.
I first set the classpath to nothing, start the rmiregistry and then run the command:
java -jar -Djava.rmi.server.codebase=file:/c:\scjd\classes/ -Djava.security.policy=java.policy server.jar c:\scjd\db.db localhost 1099
(have tried both localhost and dns name)
As i said, it works fine on my own computer but on another computer i get the exception:
FBNServer exception: Server RemoteException; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: suncertify.server.FBNServer_Stub
java.rmi.ServerException: Server RemoteException; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: suncertify.server.FBNServer_Stub
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: suncertify.server.FBNServer_Stub
java.lang.ClassNotFoundException: suncertify.server.FBNServer_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at suncertify.server.FBNServer.main(FBNServer.java:46)
All files are where they should be (server.jar, db.db ...), and the _stub files are in the jar file.
Has anyone got any ideas why it's not working?
PLEASE HELP ME!
Tina
Ramesh kumaar
Ranch Hand

Joined: Mar 19, 2002
Posts: 146
Hi,
Please check wheather u did any hardcoding of IPaddress in the serverside and also clientside.
-rameshkumar
Tina Ljuslin
Greenhorn

Joined: Jun 08, 2001
Posts: 25
Hi,
double checked everything and nothing is hardcoded.
Any other ideas?
// tina
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I see couple of problems:
1) You don't want to hard code the drive letter in your configuration parameter. Remember, you are supposed to develop this assignment which can work across any OS and hardware.
2) You need to bundle the _Stub instances in a jar and it should be available in the RMI Registry CLASSPATH. If you don't want to do this, you need to read the system properties like user.dir and file.seperator and dynamically set the codebase from your code.
In my submission, I didn't use codebase, policy or RMI Security Manager.
It is clearly due to the fact that RMI Registry is not able to load your _Stub instances.
[ May 15, 2002: Message edited by: Sai Prasad ]
Tina Ljuslin
Greenhorn

Joined: Jun 08, 2001
Posts: 25
Hi
i'm not hardcoding anything, the drive letters in the command depends on where the user installs the program (all in the readme so that should be ok).
My _Stub's are in a jar file and i don't think i have to set a classpath to the jar file, that should be automatic.
I have tried to set the classpath on the other computer but it still doesn't work. On my computer, where it works, I set the classpath to nothing and it still works.
Any more ideas?
// tina
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Again, you need to do this:
set CLASSPATH=xxxxxx.jar before you start the RMI Registry.
Tina Ljuslin
Greenhorn

Joined: Jun 08, 2001
Posts: 25
Hi,
have tried that, doesn't work.
Anyone else?
// tina
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Tina,
Can you try with out setting the codebase, java policy file and RMISecurityManager on the server side?
I will explain to you in detail. When you set the codebase property during RMI server startup, the RMI server annotates the _Stub instances during marshaling with the specified codebase property so that the RMI Registry can locate the _Stub instance. Your problem is due to RMI Registry not able to locate the _Stub. I faced the same issue during my submission.
Also I ask you go through the links below:
Dynamic code downloading in RMI
RMI FAQ
You may argue that it is working in the machine you developed and not in the other machine. Check the drive letter, directory names in the new machine. If you run the RMI Registry, RMI Server from the same exact location in two machines it will work.
Also check out the threads below:
Topic: building jar files, server.jar, client.jar and fbn.jar
Codebase
[ May 15, 2002: Message edited by: Sai Prasad ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

PLEASE HELP

What is ther a fire? where? quick I got some water.
OK that is a smart a%^ remark, but it could have been true. I couldn't tell that this thread was about an UnmarshalException error.

Ok just don't have RMISecurityManager in the Server. You can have it in the client though if you have to have it.
But like Sai said you don't need it.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Tina Ljuslin
Greenhorn

Joined: Jun 08, 2001
Posts: 25
Hi everyone and thanks for all your suggestions. I have now found out why it wasn't working.
On my computer i have jdk1.4.0 and on the other computer the registry was running on jre1.1.7, when we changed that to jre1.4.0 it works fine.
I am now really happy and uploading on monday, taking the test on tuesday.
Wish me luck!
// tina
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
ha..ha..Good luck and make sure you have the JSDK version number in the README.TXT.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PLEASE HELP
 
Similar Threads
RMI start error
RMI exception
RMI error issue
RMI "hello world" attempt
problem executing executable jar file