RMi run configuration [message #244620] |
Thu, 03 January 2008 20:09 |
Eclipse User |
|
|
|
Originally posted by: mvanwezel.few.eur.nl
Hi all,
I'm trying to get sun's RMI hello world
( http://java.sun.com/javase/6/docs/technotes/guides/rmi/hello /hello-world.html)
to work under eclipse.
This works without problems, but only if i start the rmiregistry from the
root of the class tree. (I use a command shell (linux) to start
rmiregistry outside of eclipse.) In this case, i don't need to specify a
value for the codebase property when starting the server. I don't like
this solution because of its ad-hoc-ness, and i would rather set the
codebase property instead and start the rmiregistry from anywhere.
In my run configuration i use the VM argument
-Djava.rmi.server.codebase=file:${workspace_loc:/HelloRMISer ver/}
but that doesn't work, i get an exception when starting the server:
Server exception: java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception is:
java.lang.ClassNotFoundException: example.hello.Hello
(etcetera...)
What am i doing wrong? What is the correct run-configuration to run an RMI
server in eclipse?
Thanks in advance. Michiel.
|
|
|
Re: RMi run configuration [message #244623 is a reply to message #244620] |
Thu, 03 January 2008 20:39 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Michiel,
Are your .class files in the bin folder of the project? Should it maybe
be like this instead:
-Djava.rmi.server.codebase=file:${workspace_loc}/HelloRMISer ver/ Should
it maybe be file:./? Are you sure it's supposed to be a URI?
Michiel wrote:
> Hi all,
>
> I'm trying to get sun's RMI hello world
> ( http://java.sun.com/javase/6/docs/technotes/guides/rmi/hello /hello-world.html)
> to work under eclipse.
>
> This works without problems, but only if i start the rmiregistry from
> the root of the class tree. (I use a command shell (linux) to start
> rmiregistry outside of eclipse.) In this case, i don't need to specify
> a value for the codebase property when starting the server. I don't
> like this solution because of its ad-hoc-ness, and i would rather set
> the codebase property instead and start the rmiregistry from anywhere.
>
> In my run configuration i use the VM argument
>
> -Djava.rmi.server.codebase=file:${workspace_loc:/HelloRMISer ver/}
>
> but that doesn't work, i get an exception when starting the server:
>
> Server exception: java.rmi.ServerException: RemoteException occurred
> in server thread; nested exception is:
> java.rmi.UnmarshalException: error unmarshalling arguments; nested
> exception is: java.lang.ClassNotFoundException: example.hello.Hello
> (etcetera...)
>
>
> What am i doing wrong? What is the correct run-configuration to run an
> RMI server in eclipse?
>
> Thanks in advance. Michiel.
>
a
|
|
|
Re: RMi run configuration [message #244630 is a reply to message #244623] |
Thu, 03 January 2008 20:57 |
Eclipse User |
|
|
|
Originally posted by: mvanwezel.few.eur.nl
Hi Ed,
Thanks for your input.
> Are your .class files in the bin folder of the project? Should it maybe
the class files are alongside the source files in the same directories
(standard eclipse behavior)
> be like this instead:
> -Djava.rmi.server.codebase=file:${workspace_loc}/HelloRMISer ver/ Should
i tried that, it didn't work
> it maybe be file:./? Are you sure it's supposed to be a URI?
that would be illogical: ${workspace_loc} returns the absolute file system
path of the workspace root. Nevertheless i tried that but it didn't work.
regards, Michiel
|
|
|
Re: RMi run configuration [message #244635 is a reply to message #244630] |
Thu, 03 January 2008 21:09 |
Eclipse User |
|
|
|
Originally posted by: mvanwezel.few.eur.nl
Problem solved: setting the VM args to
-Djava.rmi.server.codebase=file:${workspace_loc}/HelloRMISer ver/
(as you suggested, ed) was the solution...
Thanks for your input!
|
|
|
Powered by
FUDForum. Page generated in 0.09188 seconds