Run rmi registry in executable

Hi all,
I've created a jar executable for an application I wrote. I have two questions if anyone can help me out with either.
1. Is there anyway to have it run my rmi registry along with the jar executable so I don't have to run it seperate?
2. Is there anyway that I can make a .exe executable for a user that doesn't have jre for free? I've found some programs that will do it for me, but I have to purchase them. I'd also like to avoid converting all my code into another language first.
Any help would be appreciated. Thanks
Leon

1. java.rmi.registry.LocateRegistry.createRegistry().
2. There is GCJ, but I don't recommend it.

Similar Messages

  • Query Regarding RMI Registry

    If the RMI Client Got the reference for the server object from RMI Registry and executed a method. After making the next call to the server consider that RMI Registry crashes. My question is that whether the application continues or terminates.
    Anybody explain this one in details.

    The registry is a repository for references to remote objects.
    When you get a copy of a reference you may use it forever. The existence of the registry thereafter is irrelevant.

  • RMI Registry leaves thread running

    I've searched the postings about this topic and none of them have been helpful. I create an RMI registry at port 1099 in my app, use it, and then try to shut it down, but it leaves a thread running.
    The following sample code shows what my code does (in a condensed form):
    Registry registry = LocateRegistry.createRegistry(1099);
    Communicator c = new CommunicatorImpl();
    registry.rebind("//localhost/remoteserver", c );
    Naming.rebind("rmi://localhost:1099/TriggerService", c);
    registry.unbind("//localhost/remoteserver");
    Naming.unbind("rmi://localhost:1099/TriggerService");
    boolean b = UnicastRemoteObject.unexportObject(registry, true);
    System.err.println( "unexported: "+b );When I run this code in Eclipse and the code exits, I still have a process running that was spawned by "LocateRegistry.createRegistry(1099)", but I can't figure out how to get a handle for it within my program, so that I can kill it. I've read that it will end when the JVM ends, but the RMI portion of my app is only a small part and I need the rest of it to keep running. Is there a way to stop this thread?
    Thanks,
    Tony

    Well I only see 'createRegistry' and 'getRegistry' I don't see any 'destroyRegistry' methods. So I don't know.
    What I used to do back in the day was to use Runtime to start an external process for processes that I needed to kill later on. So perhaps you can use the runtime to start the registry from the command line so to speak. Then hold a reference to the returned process. Then you can kill that process when you want the registry to die. In this case you will for sure be creating a new 'jvm' for the registry to run within. (if the registry is a java program)
    Otherwise I have no idea why you would be seeing an extra java process. If you run the eclipse debugger, the debugger should not exit until the whole process is done. Even when the program is done, the debugger will still be 'live' and you can push the stop button to stop the whole launched process.

  • RMI :- how to know that rmi registry is running or not using java code

    hi
    I want to know that how to check wather rmi registry is running or not by program in java
    plz any one reply

    Simple method - try to connect to it and see if you get an exception.
    Since the registry can be running on a remote machine, the only simple way
    is to try connecting.
    If the registry is running on a local machine you can also use OS tools (like "ps" on unix) to check whether the process is running, or network tools (e.g. netstat) to check whether it's listening on its TCP/IP port.
    Genady

  • RMI registry reset

    Hi there,
    I'm writing a RMI application where I need to clean up the RMI registry as soon as the ip address of the server machine changes.
    Let's say that I want to make an object (class Obj) accessible from a RMI client through the following code:
    Obj obj = new Obj();
    UnicastRemoteObject.exportObject(obj,RMIPort); //export the new object
    registry = LocateRegistry.createRegistry(RMIPort); //Create a new registry
    registry.rebind("myObject", obj); //Bind the object to the registryOnce I detect an ip change I need to clean up the register and I need to publish a new Obj object on it. The new object has to accessible from a RMI client instead of the previous. I tried something like:
    UnicastRemoteObject.unexportObject(obj,RMIPort); //unexport the old object
    Obj obj2 = new Obj(); //Create a new object
    UnicastRemoteObject.exportObject(obj2,RMIPort); //export the new object
    registry = LocateRegistry.getRegistry(RMI_PORT);
    registry.rebind("myObject", obj2); //Bind the new object to the registry with the same name "myObject"But when the last line of code is executed, an exception "java.rmi.UnmarshalException: Error Unmarshaling return header" is thrown.
    Do you guys have any suggestions?

    This is the complete stack trace:
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
         java.net.SocketException: Connection reset
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
         at pack.net.stud.Stud.reset(Stud.java:184)
         at pack.net.connectors.IPChangeDetector.run(IPChangeDetector.java:74)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Connection reset
         at java.net.SocketInputStream.read(Unknown Source)
         at java.io.BufferedInputStream.fill(Unknown Source)
         at java.io.BufferedInputStream.read(Unknown Source)
         at java.io.DataInputStream.readByte(Unknown Source)
         ... 6 moreThanks
    Francesco

  • RMI registry weirdness, API versioning, and more

    Hi folks,
         I have some RMI questions. I'd like to start by giving background on the software and our intentions with RMI.
         Our software is a molecular biology analysis and simulation tool. Since the technology is very proprietary, we've used RMI to split the Java software into a front-end GUI client that that's distributed to users and a back-end server that makes use of our in-house C++ tools.
         At the moment our user base is small, mostly a handful of academic researchers, but even with these few releases are getting difficult to manage. The problem, of course, is that when the server back-end is upgraded, if any serializable or remotable APIs are changed, the user must also upgrade their client. Our users have made it clear that this is an unacceptable inconvenience, and since we frequently push new feature-filled releases, its difficult to keep the APIs stable. Additionally, 40% of the original code base is absolute tripe, the inflexible, ill-thought, and monolithic work of a contractor who was at at deadline and had to 'just get the job done'. With only two developers (one of them part-time), we are forced to rewrite portions of this old code in small spurts as most of our time is taken up either adding features or working on the C++ tools. In short, there's simply no way we can stabilize our APIs at this time.
         My first (perhaps naive) solution was simple: the client/server pair are built with a common API version number that is incremented each time the API of a serializable or remotable API must be changed for a new release. This version number is appended to the RMI URI for the server. For example, when using API version 13, if the back-end service is told to listen on the following URI:
         //remote.mycompany.com/myobject
    ...the back-end would implicitly bind to...
         //remote.mycompany.com/myobject-13
         Since the client and server are built with the same API version, the client knows to append -13 to whatever URI the user specifies to connect to a back-end with a compatible API. This lets the user think they're connecting to the 'usual' URI, but allows us to run servers with varying APIs concurrently on the same physical machine, thus our users can upgrade at their leisure and we can push new releases whenever we please.
         I prefer this solution because its very non-intrusive code-wise and allows us developers complete freedom, but it seems prone to subtle problems. We have three releases (hence three servers) and clients are able to function initially, but eventually they start reporting not-bound and class UID/checksum errors - exactly what this system is supposed to prevent. The three services appear to work when started initially but fail sporadically after some period of time. It seems to me that the RMI registry is getting confused when deciding which classes from which service should be sent to which client.
         I should note that rmiregistry requires us to pass in the path to our classes to its JVM (with -J) or it throws NoClassDefFoundError errors when a client connects to the back-end service (if memory serves, our logger is the offending class, so perhaps the registry is executing a static initializer that prints log messages or something). We only pass in the path to one set of classes right now (the oldest of our API revisions). I'm not sure if passing all three would help, but I don't see how it would, and I really don't have the time to experiment. Interestingly, this class path requirement only started happening a few weeks ago - previously rmiregistry didn't seem to care where our logging classes were. I'm not sure if this is contributing to the concurrency problem stated above, but if there's reasonable suspicion I'm more than happy to figure out why this is happening. Also, I remember reading on some web site that setting the rmiregistry class path with -J could cause other strange problems relating to RMI stubs, so could this be a likely suspect? I wish I was more familiar with the guts of RMI as to know what's going on in the registry. Should I be seeing such problems when binding multiple versions of the same class instance?
         I suppose I'd really like, aside from the informed opinions and suggestions of experienced Java programmers, is an architectural overview of the RMI implementation so I can answer these questions myself, but I haven't found anything in that vein. Ideally I'd like to look at the code for the RMI implementation. Is this possible? I'm not 'hip' to Sun's code sharing policies, what portions of their code base they open up if any. Can anyone offer any hints?
         We did come up with some other possible solutions for the API versioning problem. Dynamic class loading via HTTP in particular is my next best hope. Tentatively speaking, it seems that this would help minimize API breakage so long as modifications are limited to adding elements to the API and not removing them. It seems to me that allowing users to download classes at runtime would allow us developers more flexibility, even though users would be forced to upgrade every once in a while, albeit less frequently than they otherwise would.
         Also considered was a separate tool for automated management of the client software, i.e., an auto-update utility. I'd rather not go down this path; I think it would annoy our users, and our two-man development team is busy enough without worrying about more cruft.
         Any additional suggestions are welcome, as is any insight into the Sun's RMI implementation. Advice, links to documentation, "hey stupid, google for <somthing obvious>" would be appreciated.
    Cheers :-)
    -Nick

    or you could buy mine (http://www.rmiproxy.com/javarmi), but I'll give you three tips:
    (1) If possible don't change existing interfaces, just extend them, i.e. version them by extending them:
    public interface MyRemoteVersion1 extends Remote {}
    public inteface MyRemoteVersion2 extends MyRemoteVersion1 {}This way old clients can still use the old services even if they receive a newer stub.
    (2) Do the same with the implementations, and load & register both, with different names as ou are doing. Don't use the same class name for a new version otherwise you will confuse the class loader. Altneratively you could use different class loaders for teh different versions to keep them separate, but that's a large can of worms.
    (3) Ignore your feelings about the code base. It's installed out there and it's a product now, you just have to live with it unless you can instaneously upgrade all your clients, which you can't. You will probably always have a client running the original version for reasons entirely beyond your control.
    (4) Do use the codebase feature if you possibly can. Don't install anything at a client that it could get via a codebase, e.g. stubs. The only thing that clients should need is the remote interfaces and the the true client code.
    (5) Make sure every version of every marshalled class has the same setversionuid and make sure that this is there from the beginning. Make sure you only evolve these classes in ways which will be compatible under serialization - see the spec.
    Good luck
    EJP

  • Can anybody help me to understand this RMI registry service code?

    RMI is so difficult to me. please let me know following code what it means.
    If this class is instantiated with 50000 port number,
    Does RMI Registry Service get started with 50000 port number in place of rmiregistry commands?
    And I don't have to execute rmiregistry command?
    thanks in advance.
    import java.rmi.AccessException;
    import java.rmi.AlreadyBoundException;
    import java.rmi.NotBoundException;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import java.rmi.registry.Registry;
    import java.rmi.server.ObjID;
    import java.rmi.server.RemoteServer;
    import java.util.Enumeration;
    import java.util.Hashtable;
    import sun.rmi.server.UnicastServerRef;
    import sun.rmi.transport.LiveRef;
    * Registry implementation.
    * @version 1.0
    public class RegistryImpl extends RemoteServer implements Registry {
         private static final long serialVersionUID = -7162736590129110751;
         private Hashtable bindings;
        private static ObjID id = new ObjID(0);
         * @param i port number
         * @throws RemoteException
        public RegistryImpl(int i) throws RemoteException {
            bindings = new Hashtable(101);
            LiveRef liveref = new LiveRef(id, i);
            setup(new UnicastServerRef(liveref));
        private void setup(UnicastServerRef unicastserverref) throws RemoteException {
            super.ref = unicastserverref;
            unicastserverref.exportObject(this, null, true);
         * Lookup a remote object.
         * @param name Name of the remote object.
         * @return Remote object of the specified name.
        public Remote lookup(String name) throws RemoteException, NotBoundException {
    //        Logger.debug("NamingService", "lookup: " + name);
            Remote obj;
            synchronized(bindings) {
                obj = (Remote)bindings.get(name);
                if(obj == null)
                    throw new NotBoundException(name);
            return obj;
         * Binds the specified name to a remote object.
         * @param name A URL-formatted name for the remote object.
         * @param obj A reference for the remote object (usually a stub).
        public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException {
    //        Logger.debug("NamingService", "bind: " + name);
            checkAccess("Registry.bind");
            synchronized(bindings) {
                if(bindings.containsKey(name))
                    throw new AlreadyBoundException(name);
                bindings.put(name, obj);
         * Destroys the binding for the specified name that is associated with a remote object.
         * @param name A URL-formatted name for the remote object.
        public void unbind(String name) throws RemoteException, NotBoundException, AccessException {
    //        Logger.debug("NamingService", "unbind: " + name);
            checkAccess("Registry.unbind");
            synchronized(bindings) {
                if(!bindings.containsKey(name))
                    throw new NotBoundException(name);
                bindings.remove(name);
         * Rebinds the specified name to a new remote object. Any existing binding
         * for the name is replaced.
         * @param name A URL-formatted name for the remote object.
         * @param obj A reference for the remote object (usually a stub).
        public void rebind(String name, Remote obj) throws RemoteException, AccessException {
    //        Logger.debug("NamingService", "rebind: " + name);
            checkAccess("Registry.rebind");
            bindings.put(name, obj);
         * Returns an array of the names bound in the registry.
         * @return An array of the names bound in the registry.
        public String[] list() throws RemoteException {
            String[] names;
            synchronized(bindings) {
                int i = bindings.size();
                names = new String;
    Enumeration e = bindings.keys();
    while(--i >= 0)
    names[i] = (String)e.nextElement();
    return names;
    * TO-DO
    public static void checkAccess(String s) throws AccessException {
    // check if s is in the list of agents.
    if(true)
    else
    throw new AccessException("");
    public static ObjID getID() {
    return id;

    You don't have any need to understand this code. The complication is due to the registry needing a fixed objectID.
    You just need to know the methods of java.rmi.registry.LocateRegistry class. This allows you to start an RMI Registry inside your JVM and give it any TCP port number you like.

  • Beginner running RMI example problem

    I am trying to test this RMI code from Thinking in java and it is giving this error
    Exception in thread "main" java.lang.NoClassDefFoundError: DispatchPerfectTime (
    wrong name: project3/rmi/DispatchPerfectTime)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    6)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
    I compiled the 3 files below and also called rmic and created a stub and skeleton..... Only it doesnt run..
    Any ideas why ?
    INTERFACE
    package project3.rmi;
    import java.rmi.*;
    interface PerfectTimeI extends Remote
         long getPerfectTime() throws RemoteException;
    }Implementation of Remote interface
    package project3.rmi;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.net.*;
    public class PerfectTime extends UnicastRemoteObject implements PerfectTimeI
         public long getPerfectTime() throws RemoteException
              return System.currentTimeMillis();
         //constructor to throw remote exceptions
         public PerfectTime() throws RemoteException
              //super(); called automatically
         //register for rmi server
         public static void main(String args[]) throws Exception
              LocateRegistry.createRegistry(2005);
              System.setSecurityManager(new RMISecurityManager());
              PerfectTime pt = new PerfectTime();
         Naming.rebind("//200.23.23.2:2005/PerfectTime",pt); //I put dummy IP instead of my real IP
              System.out.println("Ready to do time");
    }USING REMOTE OBJECT
    /**Using the remote object**/
    package project3.rmi;
    import java.rmi.*;
    public class DispatchPerfectTime
         public static void main(String args[]) throws Exception
              System.setSecurityManager(new RMISecurityManager());
              PerfectTimeI t = (PerfectTime)Naming.lookup("//200.23.23.2:2005/PerfectTime");
              for(int i =0;i<10;i++)
              System.out.println("Perfect Time is "+t.getPerfectTime());
    }

    I am just using another RMI example from class now...
    All files are compiling but this is error.....
    C:\>java -classpath c:\ RMIServer
    Starting Server
    Started Server...
    Binding to RMI Registry
    Error RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: RMIServer_Stub
    I doono if my host is correct...... I donno what to write in place of test... its some service??
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    public class RMIServer extends UnicastRemoteObject implements RMIInterface
      static String host = "rmi://IPAddress/test";
      static String data[] = {"c","c++","java"};
      public RMIServer() throws RemoteException
                super();
      //implement methods
      public int getNumData() throws RemoteException
                return data.length;
      public String getData(int index) throws RemoteException
              if(index>=0 && index<data.length)
                   return data[index];
              else
                   return "N/A";
      public static void main(String args[])
           RMIServer server;
           try{
                System.out.println("Starting Server");
                server = new RMIServer();
                System.out.println("Started Server...");
                  System.out.println("Binding to RMI Registry");
                Naming.rebind(host,server);
                System.out.println("Remote methods registered successfully");
           catch(Exception e){
                System.out.println("Error "+e.getMessage());
      }//main
    } //class

  • Bind to RMI registry on remote host

    Is it possible to bing to a RMI registry on remote host. I get a Access exception when I try it. Is there is any work around for this?
    Any help will be greatly appreciated.
    Thanks
    R

    :Like I say, JINI uses a different model to RMI, and you can probably have a look at the forum for that here.
    but a way around it is to create a server which listens for requests, accepts a remote object and a remote object name, and binds those into the registry on which its running - remember that the restriction only applies to registering objects, not to looking them up, so, once the object is registered on the remote host, it can be retrieved quite easily.
    This of course leaves the problem of exception ahandling aside, but I trust the problems there are obvious

  • Memory leak in RMI registry ? (JRE 1.3.1_11)

    Hello. I have a CLI that creates a server which calls some JNI to get
    objects for a flat file database and return them. Each time I run the CLI I create a new server and bind it the RMI registry. I created a script that excecutes
    the CLI in a forever loop. While this is running I notice the RMI registry program
    slowly grows over time until it uses all of the system resources. I keep track of the
    servers I create in a Vector and remove them once they are complete. I don't
    explicitly remove them from the RMI registry because I assume they would get
    garbage collected once all references to them where gone. Has anyone seen
    this behavior ? Any ideas what could be happening ? Thanks.
    BTW - I am running on Solaris.

    The only way out of the RMI Registry is the unbind() method.
    If you never unbind anything from the RMI REgistry and keep adding bindings it will grow forever.
    You've got your implementation back to front. If you unbind from the Registry then allow DGC to take its course your server will eventually get an Unreferenced callback, which is the signal to remove it from local storage. Alternatively you could just unbind() and remove from local storage immediately. To be frank I am amazed that you didn't try this before posting here.

  • RMI Registry as a service.

    I have found evidence that supports the possibility of rmiregistry.exe running as a service on windows, but I have not found any "How-To" for it. I wrote a batch file to run the command:
    sc create "RMI Registry" binpath= "c:\Program Files\Java\jdk1.6.0_03\jre\bin\rmiregistry.exe" displayname= "RMI Registry" start= "auto"
    However, when I attempt to start the service, I get the message:
    ERROR 1053: The service did not respond to the start or control request in a timely fashion.
    Where did I go wrong or is it just not possible?

    Do some searching in this forum and you may find some more leads. Also: try hard to google for it.
    The registry exe simply does not have the interfacing required to act as a service.
    So what most people do is try to write or obtain a service wrapper that can talk to/be controlled by the service manager, and which can also run the registry exe as another process.

  • How to run RMI in Internet

    Hi ,
    iam running RMI server in vsnl public ipaddress like :121.*.*.*;
    when i run the client in vsnl network it is working fine.iam trying to run this in another network like airtel network it is not connecting.
    is there any solution?
    bez i need to run my application anywhere from the world in any network.

    Basically you need to download the RMI plugin from:
    http://www.genady.net/rmi/v16/main.html
    You can either get a license from them, or it only works for 14 days from the date you download the software (so if you changed your computer date....)
    You download the zip file, and put it in your eclipse directory (just follow the steps). It generates all the rmi classes for you automatically.
    I don't think it's required for working with RMI--you could probably get rmic and generate the class files yourself, the plugin just makes the process simpler, and I believe you can also monitor the registry, which is a nice feature.

  • RMI registry inside tomcat

    Hello,
    I'm wondering if any of you have previous experiences in the following situation.
    I have a linux server with tomcat 5.0.28 that is supposed to act as an RMI end point for clients connecting with the aforementioned RMI to do some persisting stuff. Now I figured that the easiest way is to create a servlet that creates the RMI registry and binds my server objects (so that's in the servlet's init(), with 1 load-on-startup, the servlet doesn't do anything else, at least yet).
    Now problems arise: my linux server is logging "context is read-only" when trying to bind the objects to RMI. Testing on my windows laptop doesn't show the same error for some reason (although it doesn't work properly either). This is apparently normal, as the contexts are supposed to be read-only.
    Thing is, I wouldn't want to run a separate rmiregistry on the server, if possible to do it with a simple servlet. But is this the easiest way?
    Thank you in advance,
    yours truly, in sickness and in health,
    Jussi

    'Context is read-only' is not a Registry error
    message. You are trying to bind to something else.
    Show us some code.Well, I'm not doing a lot of binding, so I'm assuming it's this part:
                   DDBServer stub = (DDBServer)UnicastRemoteObject.exportObject(this, 0);
                   Registry registry = LocateRegistry.getRegistry();
                   registry.rebind("DDBServer", stub);The error message is:
    2007-04-18 14:06:40 NamingContextListener[Catalina/localhost/DDBServer]: Creation of the naming context failed: javax.naming.NamingException: Context is read only

  • RMI Registry fail to initiate

    Hi Guruz,
    Let me describe the problem..
    I have 2 apps running on tomcat server. Both the apps initiates RMI server and then regiter the object on RMI registry. If I deploy both the app on a single web server ( Tomcat ) and start the server, it successfully create and register the rmi object but the subsequent app when attempts to register their object, it crashes.
    I am pasting the snippet of code that initiate rmi regitry.I am using the same code to initiate rmi registry with the same port.
    try{
    //Start the RMI registry
    registry = LocateRegistry.createRegistry(ServiceProperties.rmiServerBindPort);
    catch(RemoteException re){
    try {
    registry = LocateRegistry.getRegistry(ServiceProperties.rmiAppHost, ServiceProperties.rmiServerBindPort);
    } catch (RemoteException remE) {
    log.error("could not initialize RMI registry", remE);
    throw remE;
    Here's the error that is being thrown if subscequent app try to initiate rmi registry. Both the apps have same security policy present. Please give you input why this is happening.
    ERROR : remote exception.....Failed to bind to RMI registry : RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: com.abc.efg.hij.RMIListenerImpl_Stub (no security manager: RMI class loader disabled)
    Regards,
    Kashif

    You can only run one rmi on a single port. You are going to have to use different machines or different ports. How would java be able to distinguish which registry to use if this were possible?

  • RMI registry on multiple net interfaces

    I'm interested in creating several RMI registry servers, each one listening in one different net interface of the same machine (two ethernet cards). Is there any way to do this without using custom RMI socket factories? From the documentation I have read, it looks like there's no possibility to choose a specific network interface. Instead, RMI registry chooses the one associated to localhost.
    Thanks in advance.
    Zealon

    You could use
    LocaeRegistry.createRegistry(port,csf,ssf) with an
    RMIServerSocketFactory that binds the ServerSocket to
    the appropriate network address, but you will then
    discover that you can only have one Registry per JVM
    because it has a fixed objectID, so don't bother.
    But actually, why do you want to do this? Your stated
    reason is not correct. By default any ServerSocket,
    including those created by the Registry and RMI, is
    bound to 'any', which means it should accept from all
    network interfaces. Perhaps you have the classic
    'hosts' hosts/DNS setup problem where your servers
    embed 127.0.0.1 in the stub? Use
    -Djava.rmi.server.hostname at the server JVM, or
    better still fix your 'hosts' file or DNS setup.
    EJPThanks for your reply. Maybe I didn't explain myself enough.
    I'm working in medical electrocardiography, and have a PC with two net interfaces. The first one is bound to a LAN IP address that belongs to a medical network. Each one of the hosts in this medical network is an electrocardiography monitor, attached to a patient..
    The second net interface is an external IP address (not LAN address).
    I created a remote class called MonitorFactory, that should provide information about the electrocardiography monitors existing into the medical network. It works OK, and I cand bind MonitorFactory objects to a RMI registry with no problem at all.
    There are some reasons I would like to use several RMI registries:
    - First one, I need to control access from external network to my medical network. Medical patient data must be handled very carefully. I thought I could do so by enabling/disabling an RMI registry bound to the external IP address. This way, I could enable access to medical data from outside the medical network, by registering my MonitorFactory objects to this external RMI registry, but only when I decide to do that.
    - Second one, I want an RMI registry always running bound to the medical LAN IP address, so I could use the applications that use MonitorFactory like a local application, not only like a remote one.
    This scheme represents the system I have to build:
    PC with two network interfaces
    External PC <----------->|213.xxx.xxx.xxx 192.xxx.xxx.xxx|<----------> Medical network
    MonitorFactory - Listens to medical data into 192.xxx.xxx.xxx network only. Bound to
    external RMI registry when available and always bound to internal RMI registry.
    External RMI registry - bound to 213.xxx.xxx.xxx. Enabled when I decide to do so.
    Internal RMI registry - bound to 192.xxx.xxx.xxx. Always enabled.
    If I create an RMI registry bound to "any" of the interfaces, I always risk my medical data to the Internet, because there is always a port open at 213.xxx.xxx.xxx accepting connections.
    One possible solution could be using SSL sockets for RMI. This way, only allowed clients could connect to RMI registry. But what worries me most is the fact that a port could be open to the Internet - what about attacks to this open port? If those attacks could make RMI registry fall, medical data flow to another information systems could be interrupted, including medical alarms like critical patient status.
    On the other way, I would like to maintain RMI default sockets for compatibility and future releases of my application.
    Any suggestions?
    Thanks in advance.
    Zealon.

Maybe you are looking for

  • Error in EJB running on WebSphere Application Server v6

    Hi, I am getting the following exception when a transaction ends in Stateless Session EJB: [8/4/05 13:04:00:396 CDT] 0000004d LocalTranCoor W   WLTC0033W: Resource imssDS rolled back in cleanup of LocalTransactionContainment. [8/4/05 13:04:00:406 CDT

  • Converting Word Doc to PDF Form

    I am trying to convert a word document into a PDF Form. I have tried running the 'Form Wizard' in Acrobat 9.x Pro. I have the current version, just can't remember the rev. number. Supposidly the Form Wizard will recognize areas of the word doc as fie

  • Adsl daemon not starting

    I have pppoe connection, in the past worked very well, I 've recently replaced an antique motherboard 10 years old with a 775 socket Asrock, chipset G41 that has Realtek 8102E/8103E on-board lan and I have since then always had to manually do sudo /e

  • Multi-byte character

    If DATABASE CHARACTER SET is UTF-8 than Than can i use VARCHAR2 to store multi-byte character or i still have to use nvarchar2 also vachar2(1),nvarchar2(1) can store how much (max) bytes in case of UTF-8 CHARACTER SET

  • Issues with SNP_CHECK_TAB being an invalid object

    During the Control step 'delete previous check sum' I encounter the following error: 208 : S0002 : java.sql.SQLException: [DWSQL]Invalid object name 'companyx_prod_workspace.dbo.SNP_CHECK_TAB'. java.sql.SQLException: [DWSQL]Invalid object name 'compa