RMI, eclipse, rmiregistry and codebase

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 and start the rmiregistry from anywhere.
In my run configuration i use the VM argument
-Djava.rmi.server.codebase=file:${workspace_loc:/HelloRMIServer/}but that doesn't work, i get an exception:
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 in eclipse?
Thanks in advance. Michiel.

Actually I am having a similar problem and it is really strange.
I set the VM Arguments to: -Djava.rmi.server.codebase=file:${workspace_loc}/RMI/ example.hello.Serverand I get: Coult not find the main class. Programm will exit.
Whatever I change in the VM Arguments, the error is the same! I know that this is a question related to Eclipse mainly, but I will appreciate any help!

Similar Messages

  • HOWTO: RMI without rmiregistry

    I'm putting this here for future common reference.
    Usually you go start rmiregistry in the background, get your app to register with the registry and everything is fine. Internally RMI keeps an index of the objects being exported. It associates the index with a name inside an RMI registry. Without the registry you can export an object but noone knows what the index is so you're screwed.
    This means that you've got to deploy rmiregistry and your application. What you want to do for smallish/simple applications is install both rmiregistry and your remote objects on the same port internal to your app.
    Lets say we want our application on port 2004.
    Registry localreg = LocateRegistry.createRegistry(2004);
    MyService svc = new MyService(2004);
    localreg.bind("FlikFlak",svc);
    public class MyService extends UnicastRemoteObject
    public MyService(int port)
    super(port);
    And thats it. One port with an internally bound rmiregistry. Other applications would continue as normal using that port for both your application and that object.
    eg:
    MyService svc = (MyService)Naming.lookup("//machine:2004/FlikFlak");

    Hi!
    I have tried the following example:
    Interface:
    =======
    public interface RmiService extends Remote
        public void print(String txt) throws RemoteException;
    }Rmi server:
    =========
    public class RmiServer extends UnicastRemoteObject implements RmiService
        public RmiServer(int port) throws RemoteException
            super(port);
        public void print(String txt) throws RemoteException
            System.out.println(txt);
        public static void main(String[] args)
            if (System.getSecurityManager() == null)
                System.setSecurityManager(new RMISecurityManager());
            try
                Registry rmiRegistry =  LocateRegistry.createRegistry(9999);
                RmiService rmiService = new RmiServer(9999);
                rmiRegistry.bind("RmiService", rmiService);
            } catch (Exception ex)
                ex.printStackTrace();
    }Client:
    =====
    public class RmiClient
        public static void main(String[] args)
            if (System.getSecurityManager() == null)
                System.setSecurityManager(new RMISecurityManager());
            try
                RmiService remoteService = (RmiService) Naming.lookup("//192.1.50.109:9999/RmiService");
                remoteService.print("Hello World!!!");
            }  catch (Exception ex)
                ex.printStackTrace();
    }Security policy file (security.txt):
    ==============
    grant
        Permission java.security.AllPermission;
    };I startet the server: java -Djava.security.policy=security.txt RmiServer, which seems to work, but when I start the client: java RmiClient, I get the following exception:
    java.security.AccessControlException: access denied (java.net.SocketPermission 192.1.50.109:9999 connect,resolve)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
         at java.lang.SecurityManager.checkConnect(SecurityManager.java:1026)
         at java.net.Socket.connect(Socket.java:446)
         at java.net.Socket.connect(Socket.java:402)
         at java.net.Socket.<init>(Socket.java:309)
         at java.net.Socket.<init>(Socket.java:124)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Naming.java:84)
         at RmiClient.main(RmiClient.java:21)
    java
    How can I make this example work?
    Regards,
    --Alex

  • RMIRegistry and rmiserver running  on different machines

    hi,
    Is it possible that RMIRegistry and rmiserver run on different machines?

    Its possible, but you cannot bind objects into the registry from a remote machine, due to security restrictions in force in Sun's RMI implementation.

  • RMIRegistry and OutOfMemoryError

    I am running a server process that registers 5 RMI Objects with the RMIRegistry that is running as a separate process on default port 1099. Initially, the client process is able to lookup (using Registry.lookup()) these RMI Objects from RMIRegistry and everything works fine, but after a period of 3 days of continuous run, the client process gets an exception java.rmi.NoSuchObjectException when it looks up for these RMI Objects. If I use the Registry.list() API, I can see the name of those 5 RMI Objects listed.
    In these 3 days, the Server goes thru a lot of stress and I suspect that it may be leaking memory. I cannot see it since the process is running in background and I do not handle this exception. There is no core dump and the server process is still running.
    My question is that what if the behaviour of rmiregistry process when the server process leaks memory and starts throwing OutOfMemoryError.
    I am using JDK1.4.0 on HP-UX 11i.
    Any help would be appreciated.

    sonal-s,
    It's not clear to me -- from your post -- whether you are getting a "NoSuchObjectException" or an "OutOfMemory" error (or both).
    Regarding the "NoSuchObjectException", this is just a guess, but there is a special, distributed garbage collector associated with RMI objects. Could it be that one of your registered objects is not referenced for a long time and is therefore garbage collected?
    Regarding "OutOfMemoryError", there are many profiling tools available that will help you locate memory leaks (if they exist). The JavaPerformanceTuning Web site has all the details.
    In either case, the "rmiregistry" merely maintains the lookup information -- what lookup name is associated with what registered object. The RMI server JVM is where the actual objects live. If you haven't already looked at it, I suggest the RMI Guide. Also the book java.rmi: The Remote Method Invocation Guide by Esmond Pitt and Kathleen McNiff explains the distributed garbage collector well (in my opinion, of-course).
    [By the way, the "Safari" online library gives you a free two-week trial subscription.]
    Perhaps if you posted some more details, I may be able to help you further, such as:
    1. Entire error message and stack trace you are getting
    2. The part of your code that you think is causing the error
    3. Java version you are using
    4. Platform you are using
    Good Luck,
    Avi.

  • Virgo Tools for Eclipse Luna and Mars

    Hi all,
    I tried to install the Virgo Tools both in Eclipse Luna and in Mars (JEE packages), from this update site:
    "Virgo IDE Releases" - http://download.eclipse.org/virgo/release/tooling
    - Eclipse Virgo Tools 1.0.1.201302270038-RELEASE
    but I got errors (see below).
    Instead all il working well with Kepler.
    Some suggestions?
    Thank you very much.
    Vincenzo
    ================================================
    Cannot complete the install because of a conflicting dependency.
    Software being installed: Eclipse Virgo Tools 1.0.1.201302270038-RELEASE (org.eclipse.virgo.ide.feature.feature.group 1.0.1.201302270038-RELEASE)
    Software currently installed: Eclipse IDE for Java EE Developers 4.5.0.20150621-1200 (epp.package.jee 4.5.0.20150621-1200)
    Only one of the following can be installed at once:
    OSGi System Bundle 3.8.1.v20120830-144521 (org.eclipse.osgi 3.8.1.v20120830-144521)
    OSGi System Bundle 3.10.100.v20150529-1857 (org.eclipse.osgi 3.10.100.v20150529-1857)
    Cannot satisfy dependency:
    From: Eclipse IDE for Java EE Developers 4.5.0.20150621-1200 (epp.package.jee 4.5.0.20150621-1200)
    To: org.eclipse.epp.package.jee.feature.feature.group
    Cannot satisfy dependency:
    From: EPP Java EE IDE Feature 4.5.0.20150621-1200 (org.eclipse.epp.package.jee.feature.feature.group 4.5.0.20150621-1200)
    To: org.eclipse.m2e.feature.feature.group 0.0.0
    Cannot satisfy dependency:
    From: Maven Integration for Eclipse 1.6.0.20150526-2032 (org.eclipse.m2e.core 1.6.0.20150526-2032)
    To: bundle org.eclipse.osgi 3.10.0
    Cannot satisfy dependency:
    From: m2e - Maven Integration for Eclipse (includes Incubating components) 1.6.0.20150526-2032 (org.eclipse.m2e.feature.feature.group 1.6.0.20150526-2032)
    To: org.eclipse.m2e.core
    Cannot satisfy dependency:
    From: Eclipse Virgo Tools 1.0.1.201302270038-RELEASE (org.eclipse.virgo.ide.feature.feature.group 1.0.1.201302270038-RELEASE)
    To: org.eclipse.virgo.ide.manifest.core [1.0.1.201302270038-RELEASE]
    Cannot satisfy dependency:
    From: Eclipse Virgo IDE (Manifest Core) 1.0.1.201302270038-RELEASE (org.eclipse.virgo.ide.manifest.core 1.0.1.201302270038-RELEASE)
    To: bundle org.eclipse.virgo.kernel.artifact 0.0.0
    Cannot satisfy dependency:
    From: Virgo Kernel Artifact Integration 3.6.0.RELEASE (org.eclipse.virgo.kernel.artifact 3.6.0.RELEASE)
    To: package org.eclipse.virgo.nano.serviceability [3.6.0,3.7.0)
    Cannot satisfy dependency:
    From: Virgo Nano Core 3.6.0.RELEASE (org.eclipse.virgo.nano.core 3.6.0.RELEASE)
    To: package org.eclipse.osgi.internal.baseadaptor 0.0.0

    Sorry, I have to correct myself: today I retried with a brand new Mars/JEE+Java8 and a brand new workspace:
    the error is related to missing org.json bundle.
    Cannot complete the install because one or more required items could not be found.
    Software being installed: Eclipse Virgo Tools 1.0.1.201506260038-SNAPSHOT (org.eclipse.virgo.ide.feature.feature.group 1.0.1.201506260038-SNAPSHOT)
    Missing requirement: Eclipse Virgo IDE (Server Core) 1.0.1.201506260038-SNAPSHOT (org.eclipse.virgo.ide.runtime.core 1.0.1.201506260038-SNAPSHOT) requires 'bundle org.json 0.0.0' but it could not be found
    Cannot satisfy dependency:
    From: Eclipse Virgo Tools 1.0.1.201506260038-SNAPSHOT (org.eclipse.virgo.ide.feature.feature.group 1.0.1.201506260038-SNAPSHOT)
    To: org.eclipse.virgo.ide.runtime.core [1.0.1.201506260038-SNAPSHOT]
    seems like Mars/JEE doesn't contain org.json ... which is quite strange ...
    With Mars/JEE+Java7 instead the detailed error is:
    Cannot complete the install because one or more required items could not be found.
    Software being installed: Eclipse Virgo Tools 1.0.1.201506260038-SNAPSHOT (org.eclipse.virgo.ide.feature.feature.group 1.0.1.201506260038-SNAPSHOT)
    Missing requirement: OSGi Framework Editor UI (Incubation) 0.2.0.201206060754 (org.eclipse.libra.framework.editor.ui 0.2.0.201206060754) requires 'bundle org.eclipse.zest.core [1.0.0,2.0.0)' but it could not be found
    Missing requirement: OSGi Framework Editor UI (Incubation) 0.3.0.201212132137 (org.eclipse.libra.framework.editor.ui 0.3.0.201212132137) requires 'bundle org.eclipse.zest.core [1.0.0,2.0.0)' but it could not be found
    Missing requirement: OSGi Framework Editor UI (Incubation) 0.3.0.201305070844 (org.eclipse.libra.framework.editor.ui 0.3.0.201305070844) requires 'bundle org.eclipse.zest.core [1.0.0,2.0.0)' but it could not be found
    Missing requirement: OSGi Framework Editor UI (Incubation) 0.3.0.201305151323 (org.eclipse.libra.framework.editor.ui 0.3.0.201305151323) requires 'bundle org.eclipse.zest.core [1.0.0,2.0.0)' but it could not be found
    Missing requirement: OSGi Framework Editor UI (Incubation) 0.3.0.201305311343 (org.eclipse.libra.framework.editor.ui 0.3.0.201305311343) requires 'bundle org.eclipse.zest.core [1.0.0,2.0.0)' but it could not be found
    Missing requirement: OSGi Framework Editor UI (Incubation) 0.3.1.201405141436 (org.eclipse.libra.framework.editor.ui 0.3.1.201405141436) requires 'bundle org.eclipse.zest.core [1.0.0,2.0.0)' but it could not be found
    Cannot satisfy dependency:
    From: Eclipse Virgo Tools 1.0.1.201506260038-SNAPSHOT (org.eclipse.virgo.ide.feature.feature.group 1.0.1.201506260038-SNAPSHOT)
    To: org.eclipse.virgo.ide.runtime.ui [1.0.1.201506260038-SNAPSHOT]
    Cannot satisfy dependency:
    From: Eclipse Virgo IDE (Server UI) 1.0.1.201506260038-SNAPSHOT (org.eclipse.virgo.ide.runtime.ui 1.0.1.201506260038-SNAPSHOT)
    To: bundle org.eclipse.libra.framework.editor.ui 0.0.0
    With Luna/JEE SR2 instead all is working well, both with Java7 and Java8
    Vincenzo

  • Crystal Reports for Eclipse plugin and CR XI server

    I have a software requirement in which I need to support both internal (CR Eclipse plugin using the report viewer, not sure what the real name of this is) along with external (CR XI server) reporting.  In other words, I should be able to display a report (.rpt) that exists on my local app server along with one that exists on the CR XI server.  My question is this:
    So I have both sets of jar libraries (eclipse plugin and XI server) and I see that some of the them are overlapping (some of the jars have the same name).  For the ones that overlap, should I choose the ecilipse plugin or XI server ones...?
    One example I found is that the eclipse plugin rasapp.jar contains the POJOResultSetHelper class whereas the rasapp.jar from the XI server does not.  In this case, I presume I should use the eclipse version, right?
    Thanks for your help!
    Louis

    Hello Louis,
    -If you are using latest version of CR Eclipse plugin using the report viewer,then I would recommend going for JAR files of this eclipse plugin than that of CR XI Server.
    -The only reason being Eclipse plugin will give you most updated JAR files.
    -Before using JAR files from Eclipse plugin, I would suggest you to update your present JAR files to latest available JAR files.
    This can be done through Eclipse using update option.
    And once you update them, you can use those JARs.
    Thanks,
    Chinmay

  • Eclipse hangs and the JVM terminates in a Swing app incorporating JavaFX

    Hi everyone,
    I have a situation that is driving me nuts. I am developing a Swing based application which is incorporating some JavaFX components,mainly the TableView and a few layouts. I have wrapped all the javafx components into a common control for use application wide. I am also using an Eclipse plugin (Window Builder Pro) to layout the swing stuff.
    Now, my issue is, when I preview the JFrames and other components making use of the said simple custom control referred above, it only allows me to preview the JFrame once, there after Eclipse hangs and the JVM terminates.
    After some research, the most likely cause of this is that the reference to jfxrt.jar i have referenced in the project is loading some native dlls which can/should only be loaded once in the lifetime of a JVM. It looks like for some reason, my app is trying to load the native libs after it has already loaded them initially.
    The Application needs to be developed in Eclipse so netbeans is not an option.
    Am just getting started with maven, i don't have the know to build a project of this complexity with maven.
    Has any one encountered this issue and how did they walk around it?
    Any assistance would be greatly appreciated.

    After further digging around, the actual exception that causes the jvm to terminate is java.lang.UnsatisfiedLinkError due to an attempt to reload \JavaFX_2.0_SDK\rt\bin\mat.dll, anyone knows how to overcome this ?

  • Eclipse RCP and swing key accelerator

    Hi,
    I have a JTree inside a view and a popup message when you right click
    on the tree.
    I added a key accelerator to the menu and I see the shortcut on the menu but when I use the shortcut, nothing happens.
    I believe the problem is SWT -> SWING issue but I don't have any idea
    how to solve it.
    Thanks in advance
    Dekel

    Java 'WebStart is (in principle) a fine distribution/deployment/update technology.
    It covers smart versioning of jars/jvms.
    Native user experience and Swing poses no problem.
    I prefer Swing as one can construe one own controls in detail.
    Both Eclipse RCP and Netbeans Platform have a very specific starting point.
    Both come with a considerable amount of code.
    In fact have a feasability study in the form of writing hello-worlds in both.
    The unmentioned alternative, starting from scratch with Swing,
    may have some benefits.

  • JavaFX and Netbeans set homepage href and codebase attribute

    Hi everyone.
    Is there a option in netbeans to set the _browser.jnlp attribute "homepage href" and "codebase". so that when I start the Build Project everytime is set right. and i dont have to change it manually ?
    regards

    Hi. thanks for your advise with the javafxpackager help, I found the option -appCodebase.
    with this option everything work fine. (codebase and hompage href url is set)
    I have now this option in the netbeans project property as additional fx packager option.
    Thank you!
    p.s. with the private.property i haven't any success
    Greez drab17

  • RMI, event handling, and Winow.dispose()

    Hi all,
    If you combine RMI with an event handler and java.awt.Window.dispose(), the JVM hangs. The only way to solve this problem is by disposing of the frame from within SwingUtilities.invokeLater.
    Please check the following code:
    ServerInterface.java:_
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface ServerInterface extends Remote {
        void Send(ClientInterface CI) throws RemoteException;
    ClientInterface.java:_
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface ClientInterface extends Remote {
        void Send() throws RemoteException;
    Server.java:_
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.Naming;
    public class Server extends UnicastRemoteObject implements ServerInterface {
    public Server() throws RemoteException {}
    public void Send (ClientInterface CI)
    try { CI.Send(); } catch (Throwable t){System.out.println(t);}
    public static void main(String args[])
    try {
          Naming.rebind      ( "rmi://localhost:1099/Testing",new Server() );
          System.err.println ("Server ready");
    catch ( Throwable t )
            System.out.println ( t );
    Client.java:_
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.Naming;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.SwingUtilities;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    public class Client extends UnicastRemoteObject implements ClientInterface,ActionListener {
    static JFrame A=null;
    static ServerInterface ServerSide;
    private Client()  throws RemoteException {}
    public void Send()
    if ( A == null )
         A = Display("Remove");                   // display frame
    else                                // remove frame
         SwingUtilities.invokeLater ( new Runnable(){public void run(){A.dispose();A=null;}} );
    public static void main(String[] args)
    try {
          ServerSide = (ServerInterface) Naming.lookup ( "rmi://localhost:1099/Testing" );
          ServerSide.Send(new Client());
    catch ( Throwable t )
            System.out.println ( t );
    public void actionPerformed(ActionEvent e)
    try { ServerSide.Send(new Client()); } catch (Throwable t){System.out.println(t);}
    private JFrame Display (String label)
    JButton b = new JButton (label);
    b.addActionListener(this);
    JPanel p = new JPanel ();
    p.add (b);
    JFrame frame = new JFrame ();
    frame.getContentPane().add(p);
    frame.pack();
    frame.setVisible(true);
    return frame;
    }You can do any GUI work from within an event handler, only when you try to dispose of a frame, the system hangs !!!

    Thank you for responding to my problem.
    unless their documentation says otherwise (eg: repaint). I checked the API for "repaint()", but it didn't mention anything about the EDT. What documentation you are referring to ?
    What I don't understand is that why "dispose()" works well on non-RMI systems and hangs the machine on RMI systems ? It even works fine on RMI system providing that you are not disposing of the frame from within an event handler. So the problem occurs only if you are combining the three elements: RMI, event handler, and dispose().
    Conversely, you should avoid doing anything that may take a long time on the EDT. Perhaps remote methods fall into that category.It is true that we should avoid doing anything that may take a long time on the EDT; however, in this particular example, dispose() is not done through a remote call, it is done on the client where the frame should be removed.
    I also tried disposing of the frame from within a normal Thread (instead of the EDT), and it worked just fine.

  • Eclipse tptp and weblogic jmx

    Hi all,
    I am new to eclipse tptp and would want to integrate it into a J2EE application running on Weblogic.
    So how is tptp different from weblogic JMX feature? In other words, if using all features of tptp, is there still a need to use weblogic's JMX feature?
    Any input is highly appreciated.
    Thanks in advance.

    The just-released version 11.1.1.7.2 supports WebLogic 9.x (note that best support is for 9.2 as opposed to the lesser-used 9.0 and 9.1 releases). Note that OEPE itself requires Java 6 to run the tooling, but you can build against Java 5 VM and deploy to server running on Java 5 VM.
    - Konstantin

  • Is there any Eclipse Pulsar and JCDE Plugin for Java Card 2.2.1?

    Hi Friends..
    I want to know is there any Eclipse Pulsar and JCDE Plugin that still supports for Java Card 2.2.1?
    Actually, currently i use Eclipse Pulsar and JCDE Plugin but it support only for Java Card 2.2.2..
    I tried to set the Java Card Preference into JCDK 2.2.1, but it couldn't be set because converter.jar isn't compatible..
    Please help me regarding this..
    Thanks in advance..

    There is, but it's very limited.
    1. Put the Library on a disk formatted Mac OS Extended (Journaled)
    2. Point both machines at it.
    3. That's it.
    But remember:
    A strong warning: If you're trying to edit the Library (that is, make albums, move photos around, keyword, make books or slideshows etc.) or edit individual photos in it via Wireless be very careful. Dropouts are a common fact of wireless networking, and should one occur while the app is writing to the database then your Library will be damaged. Simply, I would not do this with my Libraries. 
    Also
    Only one user can open a library at a time.
    Regards
    TD

  • Problems using RMI between linux and windows.

    I have problems using RMI between linux and windows.
    This is my scenario:
    - Server running on linux pc
    - Clients running on linux and windows PCs
    When a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark the client as disconnected and won't communicate with it anymore.
    When a windows client (tested on XP and Vista) disconnect, no exceptions are generated (I tryed to catch all the rmi exception), so server cannot know that client is disconnected and hangs trying to communicate with the windows client.
    Any ideas?
    Thanks in advance.
    cambieri

    Thanks for your reply.
    Yes, we are implementing a sort of callback using Publisher (remote Observable) and Subscribers (remote Observer). The pattern and relative code is very well described at this link: http://www2.sys-con.com/ITSG/virtualcd/java/archives/0210/schwell/index.html (look at the notifySubscribers(Object pub, Object code) function).
    Everything works great, the only problem is this: when a Publisher that reside on a Linux server try to notify something to a "dead" Subscriber that reside on a Windows PC it does't receive the usual ConnectException and so tends to hang.
    As a workaround we have solved now starting a new Thread for each update (notification), so only that Thread is blocked (until the timeout i guess) and not the entire "notifySubscribers" function (that contact all the Subscribers).
    Beside this, using the Thread seem to give us better performance.
    Is that missed ConnectException a bug? Or we are just making some mistake?
    We are using java 6 and when both client and server are Linux or Windows the ConnectException always happen and we don't have any problem.
    I hope that now this information are enough.
    Thanks again and greetings.
    O.C.

  • RMI + Eclipse + Mac OS X Snow Leopard

    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

    The simple answer is to start the Registry inside your server JVM, with LocateRegistry.createRegistry(). Otherwise you have to supply a classpath argument to rmiregistry.exe with -J-Dclasspath=

  • RMIRegistry and Server on different Machines

    Is it possible to run rmiregistry on one machine and then bind an object from a different machine to this registry. I can't find any documentation to say that you can't.
    If i try to, i get a hostname is a non-local host Exception.

    What im actually doing is this :
    I have a client program that wishes to transport some C code to a server for execution on that server. This would be simple enough but the client should not be concerned with where the server is, but only needs to know a name server that holds all object and server names so as they can then query this one registry for a server name and then connect to this server.
    I was hoping that you could run rmiregistry on one machine, a server on another, bind that server object to the registry and then connect to the server from the client via the registry.
    I have written my own registry object that implements this fine but i wanted to know whether this was a long winded way. Surely RMI is a java developers alternative to CORBA (according to sun web site !), in which this would be possible with the ORB running on a remote machine to client and server?

Maybe you are looking for

  • How to retain zoom position of an image using Adobe Flash Builder?

    Hi,   I have created an Adobe Flash Builder Mobile App. I placed an image in the Homeview. I allow the user to zoom out or zoom in the image using GestureZoom. The problem is each time the user zooms, it does not retain the previous position. For ex.

  • Hello, my 2012 MacBook pro makes a clicking noise

    Hello, my 2012 MacBook pro makes a clicking noise in the bottom right of my computer. The empty space below the keyboard where you are supposed to rest your hands. I press it and it sounds like something is snapping almost.

  • Developing Iphone App using Flash Builder and Flex Air Mobile

    I started developing an Iphone app using the trial version of Flash Builder and was pretty impressed with how easy it was, then i hit problems: Trying to submit my app, I was getting invalid binary, using google i tracked this down to a change in the

  • ITunes Sorting Issue - By numbers? (not "track numbers")

    How can I get iTunes to sort using the defaulted numbers in List View. The header cannot be clicked in List View, but can in Grid View. Is there any way it can be clicked or tricked into sorting using them? It's very handy. Thanks.

  • FI Scripts

    Hi all, Did any one work ever with transaction F110 ? Now I have a small task on this to print the payment advice slip. In the payment /output medium in F110 we specify the program rffoit_b. In the variant of this program we specify a form name. I am