File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI and Eclispe Editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI and Eclispe Editor" Watch "RMI and Eclispe Editor" New topic

RMI and Eclispe Editor

jesal dosa
Ranch Hand

Joined: Jun 25, 2007
Posts: 46

Sorry guys i have tried to search for a solution for the past 3 hours without no luck I know its not a specific Developer Certification question but i thought some one may be able to help . I am just doing the RMI section of the project and need to do some tests. If I create a Server and start it from the command line after calling the rmiregistry its seem to load up fine but if I try and run the same class from with in eclipse i get the following error

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: test.database.SampleServer

for some random reason it cant seem to find the file/ i was getting a policy error which i was able to fix by creating my own and adding it to the run configuration under VM arguments\newpolicy.policy

someone please help
Roberto Perillo

Joined: Dec 28, 2007
Posts: 2271

Partner, for this certification, you don't need to worry about policy files. I'd suggest you to follow this tutorial to create your server.

Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Alecsandru Cocarla
Ranch Hand

Joined: Feb 29, 2008
Posts: 158
It seems that the SampleServer class is missing from the classpath of the thing you're trying to run. I don't know what you're trying to run, and how. Is it a Java application run configuration? Is it a JUnit test?

Post some more details.

SCJP 1.4 100%
SCJD 99.5%
jesal dosa
Ranch Hand

Joined: Jun 25, 2007
Posts: 46
Thanks Guys,


I required the following additional property to get this working correctly. I did not realise this property needed to be included.

If I use this property from my limited understanding means the class that are required are being dynamically be downloaded. in the certification it specifies

1. You must not require the use of an HTTP server.
2. You must not require the installation of a security manager.
3. You must provide all classes pre-installed so that no dynamic class downloading occurs.
4. You must use RMI over JRMP (do not use IIOP)

Just to clarify am I breaking the rules 2 and 3 by adding policy file and the -Djava.rmi.server.codebase, which is used to dynamically load classes

once again, thanks for all your help guys
jesal dosa
Ranch Hand

Joined: Jun 25, 2007
Posts: 46
Hi guys, just for reference, if you dont want to use the -Djava.rmi.server.codebase and options you can use the following piece of code to do it programmatically

If i had know this before i would not have installed the RMi plug in for eclipse and played with all the setting, pretty good learning experience though, thanks for the link Roberto
I agree. Here's the link:
subject: RMI and Eclispe Editor
It's not a secret anymore!