Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI and Eclispe Editor

 
jesal dosa
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 -Djava.security.policy=G:\newpolicy.policy

someone please help
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Alecsandru Cocarla
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
jesal dosa
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys,

-Djava.rmi.server.codebase="file:/C:/Documents%20and%20Settings/duke/workspace/Sun%20Certification/bin/"


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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, just for reference, if you dont want to use the -Djava.rmi.server.codebase and -Djava.security.policy 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic