How to use RMI with Eclipse [message #157523] |
Thu, 06 May 2004 14:24 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: andras.basler.sap.com
Hi,
I try to use RMI. I allways get a classnotfoundexception bescause eclipse
is not finding the stub-class.
I allready tried to put the stub in the classpath, but it doesnŽt work.
Have anybody an idea?
Thanks
Andreas
|
|
|
|
Re: How to use RMI with Eclipse [message #158685 is a reply to message #157523] |
Thu, 13 May 2004 21:02 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: junk.junk.net
Andreas Basler wrote:
> Hi,
>
> I try to use RMI. I allways get a classnotfoundexception bescause eclipse
> is not finding the stub-class.
>
> I allready tried to put the stub in the classpath, but it doesnŽt work.
>
> Have anybody an idea?
>
> Thanks
> Andreas
>
In order to work with RMI in Eclipse I've done the following things.
1. Created a small ant build.xml file that will rmic the needed files.
An example is below.
2. Added the ant build to the standard build process. From the project
properties window select "Builders". Then select "New..." and then "Ant
Build". Find the build.xml and select the correct rmic target.
Ensure that the ant build comes after the "Java Builder".
Once this is done the rmic compiler will be invoked each time the
project is rebuilt.
3. Modify my local java.policy file. This is located in the users home
directory. Example java.policy file is given below.
4. Once all of the above is setup I run the nameserver from within
Eclipse, then launch the server and the client.
Cheers
Frank Rouse
Ant build.xml file
<?xml version="1.0"?>
<project name="rmi_compile" default="rmic" basedir=".">
<!-- Standard Directory Identifiers-->
<property name="java.dest.dir" value="${basedir}"/>
<!-- RMI Target -->
<target name="rmic" >
<rmic
base="${java.dest.dir}"
classname="engine.ComputeEngine"
/>
</target>
</project>
java.policy file
grant codeBase
"file:///d:/Devel/Eclipse/3.0M6_Sandbox/RMI_example_local/*" {
permission java.net.SocketPermission "47.142.166.14:1024-65535",
"accept, connect, listen, resolve";
permission java.net.SocketPermission "localhost:1014-65535", "accept,
connect, listen, resolve";
};
|
|
|
Powered by
FUDForum. Page generated in 0.02707 seconds