Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RMI + Eclipse + Mac OS X Snow Leopard

814824Nov 16 2010 — edited Nov 21 2010
Hello,

Well the problem is this:

I'm developing an RMI app (IRC) using Eclipse under Mac OS X Snow Leopard, but I get ConnectException. I'm doing this locally and I'm sure the firewall is not rejecting the connection. Here's mi main method:




public static void main(String[] args)
{
System.setSecurityManager(new SecurityManager()
{
public void checkConnect(String host, int port) {}
public void checkConnect(String host, int port, Object context) {}
});

if (System.getSecurityManager() == null)
{
System.setSecurityManager(new SecurityManager());
}
try
{
IRCServer server = new Server();
IRCServer stub = (IRCServer) UnicastRemoteObject.exportObject(server, 0);
Registry registry = LocateRegistry.getRegistry();
registry.rebind(RMIRegistryName, stub); ///////EXCEPTION HERE
System.out.println("ComputeEngine bound");
}
catch (Exception error)
{
System.err.println("IRCServer exception:");
error.printStackTrace();
}
}

If I try to pass the argument -Djava.security.policy to the JVM from Eclipse it throws the ClassNotFoundException. I don't know what I'm missing :S

I read there's no need to create the stubs since java 1.5 and also a friend told me (I think he is on Linux) that Eclipse run his app (the same project) without problems :S.
Is there something I'm not doing to make this works from Eclipse? If not I think I'll have to do it without Eclipse :S

Edited by: 811821 on Nov 16, 2010 12:13 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 19 2010
Added on Nov 16 2010
3 comments
570 views