Starting RMI registry in LINUX

HI I am new to LINUX and want to use RMI in java.
So anyone suggest me how to start rmiregistry in linux for the server.

hi genedy .
thnx for ur reply.
I already have jdk 2 beta 1.6 rpm.
I have downloded fisrmi.linux ,fisrmistart and i am able to start rmiregistry but it doesn't stops i have to kill the process.
I am also starting by using the rmiregistry command.
when I start my server application the it gives error of "connection refused,unmarshall exception etc" and doesn't works.
so suggest me how should I run my server and client.

Similar Messages

  • Auto start RMI registry

    Hi All
    I have a very big problem and i am not sure how to resolve it, hope some one can give me some advice. Ok here is my problem, i have the following
    -Server 1
    -Software product A
    -Java application A
    -Server 2
    -Software product B
    -Java application B
    Both servers are windows servers.
    Software product A runs as a windows service, at some point it will obtain an input file, it then does a command execution to start Java application A. Java application A processes the input file(extracting info into a DB) and copies it to server 2, when it is done it exits and software application A does another command execution to start Java application B. Java application B then calls software product B, software product B takes the input file and produces output files(pdf, html), once it is complete java application B takes these output files and moves them to different locations on the network.
    This process is complicated due to the software products and how they work, the problem with this method is that when software product A calls java application B the java application runs on Server 1 and not on server 2 where it is installed and because java application B calles software product B this also runs on server 1.
    I need software product B and java application B to run on server 2, the only way that i can see this happening is to either write a socket program or use RMI and letting java application 1 call java application 2(hence making application 2 a server and application 1 being the client) with either of the mentioned solutions. If any one has any less complicated method to achieve this please let me know. Now my question regarding the RMI route would be how to make sure the RMIREGISTRY is started automatically as well as load the server(java application 2) when the windows server restarts.
    If any one can shed some lite on this i would be very great full.

    LocateRegistry.createRegistry()

  • RMI Registry Workaround

    Hi,
    I don't want to start RMI registry for my server in different window. How can i bind my remote object without starting RMI Registry externally. I think it can be done , but how i don't know.
    Please help
    Ritesh Alagh

    Read the APIs...
    http://java.sun.com/j2se/1.4.2/docs/api/java/rmi/registry/LocateRegistry.html

  • How does one start the RMI registry in VisualAge?

    To start the RMI registry in a DOS session, one can type rmiregistry. How can I do this in VisualAge for Java?

    In VAJ 3.5 you do: window (from top menu) -> options... -> RMI Registry -> Restart RMI Registry

  • Has the RMI registry properly started?

    I removed all the package statements from the ComputePi example in the java.sun.com rmi tutorial. I compiled all the classes in one folder and also generated the stub and skeleton. Then I said start rmiregistry. Another Dos window briefly appears and vanishes. Then I said java ComputeEngine. Connection refused to host. Nested ecxeption is java.net.ConnectException.... Can anyone tell me what the problem could be. I am not getting any confirmation that the rmi registry started properly. I am using windows 2000 professional.

    Is there a registered process in the Windows task-manager that looks like the registry??

  • Default domain won't start properly on Redhat Linux ES3.0

    I was able to install App Server 8.1 without incident on a Redhat Linux ES3.0 box.
    When I try to start the server using:
    asadmin start-domain domain1
    It will not start properly. My error stack is as follows:
    ********************** Begin error stack
    [#|2004-12-31T02:32:28.977-0600|SEVERE|sun-appserver-pe8.1|javax.enterprise.system.core|_ThreadID=10;|Service
    [email protected]0 cannot be started! : com.sun.appserv.server.ServerLifecycleException: Cannot bind to URL
    [rmi://server1.wip.com:8686/management/rmi-jmx-connector]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host:
    server1.wip.com; nested exception is:
         java.net.ConnectException: Connection timed out]|#]
    [#|2004-12-31T02:32:28.977-0600|SEVERE|sun-appserver-pe8.1|javax.enterprise.system.core|_ThreadID=10;|CORE5071: An error occured during initialization
    com.sun.appserv.server.ServerLifecycleException: Cannot bind to URL [rmi://server1.wip.com:8686/management/rmi-jmx-connector]: javax.naming.ServiceUnavailableException [Root
    exception is java.rmi.ConnectException: Connection refused to host: server1.wip.com; nested exception is:
         java.net.ConnectException: Connection timed out]
         at com.sun.enterprise.admin.server.core.JmxConnectorLifecycle.onStartup(JmxConnectorLifecycle.java:101)
         at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:300)
         at com.sun.enterprise.server.PEMain.run(PEMain.java:294)
         at com.sun.enterprise.server.PEMain.main(PEMain.java:220)
    Caused by: java.io.IOException: Cannot bind to URL [rmi://server1.wip.com:8686/management/rmi-jmx-connector]: javax.naming.ServiceUnavailableException [Root exception is
    java.rmi.ConnectException: Connection refused to host: server1.wip.com; nested exception is:
         java.net.ConnectException: Connection timed out]
         at javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:798)
         at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:430)
         at com.sun.enterprise.admin.jmx.remote.server.JmxConnectorServerDriver.startConnectorServer(JmxConnectorServerDriver.java:173)
         at com.sun.enterprise.admin.server.core.JmxConnectorLifecycle.onStartup(JmxConnectorLifecycle.java:93)
         ... 3 more
    Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: server1.wip.com; nested exception is:
         java.net.ConnectException: Connection timed out]
         at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:117)
         at com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:208)
         at javax.naming.InitialContext.bind(InitialContext.java:355)
         at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:619)
         at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:426)
         ... 5 more
    Caused by: java.rmi.ConnectException: Connection refused to host: server1.wip.com; nested exception is:
         java.net.ConnectException: Connection timed out
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
         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.bind(Unknown Source)
         at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:111)
         ... 9 more
    Caused by: java.net.ConnectException: Connection timed out
         at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
         at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:521)
         at com.sun.enterprise.server.ss.ASClientSocketImpl.connect(ASClientSocketImpl.java:151)
         at java.net.Socket.connect(Socket.java:452)
         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)
         ... 14 more
    |#]
    ********************** End error stack
    Any assistance would be great.

    The error indicates that JMX connector server could not be started on port 8686. It is hard to say why that is happening, here are some suggestions --
    - Make sure that there is no firewall blocking port 8686 on server1.wip.com
    - It is possible that rmi runtime is using incorrect host name (server1.wip.com). You might want to set java property java.rmi.server.codebase to the IP address of the machine. [To do this, edit DOMAIN_DIR/config/domain.xml and search for java-config element. Add a jvm-option entry similar to -
    <jvm-options>-Djava.rmi.server.hostname=xx
    </jvm-options>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Urgent Help Required For Starting RMI server from servlet.

    I am currently working on rmi project.
    I want to send request to remote machine(Web host) where my application is from desktop client .For that we are using RMI.
    I am writing servlet and inside it i am binding object to registry for rmi server.
    which will be deployed on remote server.
    code ....
    Registry reg;
    reg=LocateRegistry.createRegistry(1099);
    Server server=new Server("server");//class whose remote object to be accessed
    //extends unicast remote object.Implement ServerInt interface which extends Remote.
    reg.bind("server",server);
    When i am trying to access this object i am getting following exception.
    javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalExcepti
    on: error unmarshalling return; nested exception is:
            java.lang.ClassNotFoundException: ServerModule.ServerInt]
    at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
    at com.sun.jndi.toolkit.url.GenericURLContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at RequstReplication.main(RequstReplication.java:27)
    Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested excep
    tion is:
    java.lang.ClassNotFoundException: ServerModule.ServerInt
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    ... 4 more
    Caused by: java.lang.ClassNotFoundException: ServerModule.ServerInt
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
    at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
    at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    ... 5 more
    I can access naming enumeration of registry and object bound to it.
    by following program.I shows corect objects.
    Context namingContext=new InitialContext();
    NamingEnumeration<NameClassPair> e=namingContext.list("rmi:");
    while(e.hasMore())
    System.out.println(e.next().getName());
    While when i start RMI server from simple java program i can access these objects from registry.
    I am not getting what is problem problem.Is there any other way to send request?
    Plese give quick response.

    I am currently working on rmi project.
    I want to send request to remote machine(Web host) where my application is from desktop client .For that we are using RMI.
    I am writing servlet and inside it i am binding object to registry for rmi server.
    which will be deployed on remote server.
    code ....
    Registry reg;
    reg=LocateRegistry.createRegistry(1099);
    Server server=new Server("server");//class whose remote object to be accessed
    //extends unicast remote object.Implement ServerInt interface which extends Remote.
    reg.bind("server",server);
    When i am trying to access this object i am getting following exception.
    javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalExcepti
    on: error unmarshalling return; nested exception is:
            java.lang.ClassNotFoundException: ServerModule.ServerInt]
    at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
    at com.sun.jndi.toolkit.url.GenericURLContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at RequstReplication.main(RequstReplication.java:27)
    Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested excep
    tion is:
    java.lang.ClassNotFoundException: ServerModule.ServerInt
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    ... 4 more
    Caused by: java.lang.ClassNotFoundException: ServerModule.ServerInt
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
    at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
    at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    ... 5 more
    I can access naming enumeration of registry and object bound to it.
    by following program.I shows corect objects.
    Context namingContext=new InitialContext();
    NamingEnumeration<NameClassPair> e=namingContext.list("rmi:");
    while(e.hasMore())
    System.out.println(e.next().getName());
    While when i start RMI server from simple java program i can access these objects from registry.
    I am not getting what is problem problem.Is there any other way to send request?
    Plese give quick response.

  • 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.

  • RMI in RedHat Linux 9

    I developed a RMI Server/Client. The Server works without problems on Windows 2000, but fails on RH Linux 9.
    Q1: When run server in win2000,I use
    -Djava.rmi.server.codebase=file:///D:/myrmi/classes/
    What the codebase should be in Linux (suppose I put all the classes needed in /home/myrmi/classes/*.class)
    Q2:If I remove the codebase property,I got the exception :
    CalculateServer: Error unmarshaling return header; nested exception is:
    java.net.SocketException: Connection reset
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
    java.net.SocketException: Connection reset
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)

    rmic won't compile the program for you, it only creates the stub/skel files.. you must javac your files first... After that rmic the class that implements the interface.. Before you do that:
    cd /usr/bin and rename the java related files that are there:
    cd /usr/bin
    mv java java.old
    mv rmic rmic.old
    mv javac javac.old
    mv javah javah.old
    make symlinks that point to the 1.4 versions:
    ln -s /jdk1.4/bin/java
    ln -s /jdk1.4/bin/javac
    ln -s /jdk1.4/bin/javah
    ln -s /jdk1.4/bin/rmic
    This puts your 1.4 jdk in the path, and renames the stock version. This will rule out version mismatches.. If it still doesn't work, then post some code, there's probably something simple..

  • Is the RMI registry "process-atomic"?

    Hi,
    Sorry if this is a really stupid question, and I have really tried to find this out on my own.
    When I say "process" I mean Process, as opposed to Thread.
    What I mean is, if one Process calls Registry.bind( String, Remote ), can we be sure that another Process which does the same thing one nanosecond later will get an AlreadyBoundException if it calls with the same String?
    The context is that up to now I have been starting the RMI Server (only for logging at the mo, these are my first steps) explicitly in a Process. But now I want to move to "lazy" startup of the RMI registry and of the Server... so I would go LoggerInterface.log( bindingName, message ), and if the name "bindingName" is not presently in the registry it will create a new Server, and log the message using it.
    More specifically, this is about me trying to automate OpenOffice apps using Java... and it occurs to me that 2 events could indeed happen almost simultaneously, so in fact even explicitly starting up the Server in each handler module might encounter "Process concurrency" problems ... so I need to have an answer to this.
    I hope the answer is yes... otherwise I'm going to be a bit flummoxed about how to ensure one doesn't start up one Server Process from one calling Process, and another Server Process from another calling Process.
    Thanks

    I mean to use rebind() instead of the lookup()/bind() pair. It is atomic.... I understand it is atomic, but my point is that between checking whether you need to rebind (because the bound stub is invalid) and actually doing the rebind there will be an interval. If you systematically use rebind, without a prior check to make sure your Remote is actually attached to an existing Process, every call will cause a new Server Process to be created and then rebound, one after another. Which would be a mess.
    I'm going to spend a bit of time looking at your two references... thanks for them.
    I have thought of a possible solution involving a sort of lock, but I'm not sure if it works.
    1. create a "DummyInterface" extending Remote:
    public interface DummyInterface extends Remote {
    }2. in the Process + Thread which actually sets up the Registry, bind a DummyInterface
    Registry reg = null;
    try {
      reg = LocateRegistry.createRegistry( 1099 );
    } catch (RemoteException e) {
      return; // is this right? see below...
    DummyInterface dummyStub = new DummyInterface(){};
    try {
      dummyStub = (DummyInterface) UnicastRemoteObject.exportObject( dummyStub, 0);
    } catch (RemoteException e) {
      // TODO sthg
      e.printStackTrace();
    try {
      reg.bind( "DummyLockForLoggerServer", dummyStub );
    } catch (AlreadyBoundException e) {
      // every Thread in every Process (except the first such) to call "bind" will get here
      return;
    } catch (Exception e) {
      // TODO sthg
      e.printStackTrace();
    }3.     the first Process + Thread which wants to set up the LoggerServer will have first to unbind the DummyLock.
    try {
       reg.unbind( "DummyLockForLoggerServer" );
    } catch (AccessException e) {
       // TODO sthg
       e.printStackTrace();
    } catch (RemoteException e) {
       // TODO sthg
       e.printStackTrace();
    } catch (NotBoundException e) {
      // every Thread in every Process (except the first such) to call "unbind" will get here
      return;
    // only one Thread in one Process will ever succeed in getting here
    // start the LoggerServer
    String qualifiedClassName = ".... rmi.LoggerServer";
    String[] a_commandArgs = { "java", qualifiedClassName, "logName" };
    Process process = null;
    try {
      process = Utils.runSubprocess(a_commandArgs, null, ProcessSettings.getJavaRootDir());
    } catch (IOException e) {
       // TODO sthg
       e.printStackTrace();
    }... however there seem to be one or two questions about this:
    - does reg = LocateRegistry.createRegistry( 1099 ); throw a RemoteException if the Registry is already bound? I don't know and intend to do a few experiments to find this out for myself. But in any event only one Process+Thread can ever bind the dummy lock
    - there might be a race condition nonetheless to do with the interval between creating the Registry and binding the dummy lock... during this interval the Registry is established, and the dummylock is not yet set up... but I think this does no harm, as a Process trying to start the LoggerServer during this time will get the "NotBoundException" and simply return (and the calling thread will then sleep for a bit before trying again).

  • 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.

  • Port 1099 being used by other processes ,need an alt port for RMI-Registry

    I am using port 1099 for RMI and the o/s is windows 2003.
    We want that the RMI registry shud automatically be started with the windows startup processes.But we found that some other processes are usoing the same port.
    Is there any other port which can be used for the same?
    or any method to make other processes release the port forcefully.

    If you read the documentation or do a quick google search, you will discover the rmiregistry program can be assigned any port you wish. Simply invoke via:
    rmiregistry -h from windows or "man rmiregistry" from mac or unix and you will be greeted with:
    Usage: rmiregistry <options> <port>
    In a nut shell just specify the port:
    i.e.
    rmiregistry 5000
    etc...
    Hope this helps.
    -Lemont

  • Error in re-creating RMI registry when reloading Tomcat server.

    Hi,
    I use LocateRegistry.createRegistry() in a servlet which is load-on-startup. I've unexport the registered remote object in the HttpServlet.destroy().
    But when I reload the tomcat server, such an exception ocurrs:
    java.rmi.server.ExportException: internal error: ObjID already in use
            at sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:168)
            at sun.rmi.transport.Transport.exportObject(Transport.java:69)
            at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:190)
            at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
            at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
            at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
            at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)
            at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:78)
            at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:164)
            at RmiUtils.rebindLocal(RmiUtils.java:86)Here is the binding code in RmiUtils.rebindLocal:
            try {
                Naming.rebind(url, rmiImpl);
            } catch (RemoteException ce) {
                if (!ru.isLocalhost()) {
                    ce.printStackTrace();
                    // cannot cache
                    return;
                } else {
                    // try to create the registry in local machine if not created
                    try {
                        LocateRegistry.createRegistry(ru.getPort());
                        Naming.rebind(url, rmiImpl);
                    } catch (RemoteException e) {
                        System.err.println("Failure in create Registry on port "
                                + ru.getPort() + ", maybe it's been created already!");
                        e.printStackTrace();// handle exception
            }Can anybody help?
    Thanks.

    Hi
    I havent code for quite a while.
    I would think that this wont work.
    The registry is created on startup (possibly init method in ur servlet) but it is never destroyed.
    You are better off starting the registry externally to ur servlet engine, and then use do a bind/rebind on startup, unbind on destroy.
    Hope this helps.

  • How to start RMI Server Jar on server?

    Im using RMI, I have two jar files. One Server Jar which contains rmi server, registry start code and all methods which performs action on database .
    I put this jar file on tomcat web-apps directory.
    Another jar is containing User Interface code, which runs on client side.
    for performing any action server jar needs to be run all the time and RMI Registry always needs to be started so that client can communicate with database.
    How can i execute this server jar from client ?

    You can't execute the server from the client. The question doesn't begin to make sense. The server has to be already running for the client to have anything to connect to. You have to organise something at the server side to start it. And putting JAR files into the web apps directory doesn't accomplish that. You could write a Servlet or a listener that starts the RMI server when it's initialised, and stops it when destroyed. If you have to run it inside Tomcat at all, which isn't necessarily a good idea.

  • Strange unmarshalling exception when starting RMI server

    I've run into a strange problem when running my RMI server. It worked fine yesterday, though I made a few changes since then, none of those changes should cause this to happen, as far as I know.
    Here's the exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: pub.interfaces.ClientIface
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at priv.server.TCMaster.<init>(TCMaster.java:97)
    at priv.server.TCMaster.main(TCMaster.java:71)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: pub.interfaces.ClientIface
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassNotFoundException: pub.interfaces.ClientIface
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:707)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
    at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
    at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
    at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
    ... 9 more
    pub.interfaces.ClientIface is in the SAME directory as the RMI server class! What could be causing this?
    NOTE: I'm running this on Redhat Linux 9, jdk 1.5.0_04.

    Usually an unmarshalling exception is caused by the classes not matching up on the server & client end. The classes are there I think, because otherwise it would have thrown a classnotfound exception instead. Can you try actually copying and pasting the classes either from the server to the client or vice versa? I've had weird issues where sometimes the compiler compiles the same class differently in different locations, so your safest bet is to make sure the client & server classes (that you're passing as arguments & returning from the server) are identical.
    Good luck!

Maybe you are looking for

  • Zen Micro Battery Issue: Won't Char

    Hello: I got my Micro for Christmas and really like it so far. I also got lucky and received one of the limited edition ones with the extra battery. However, it doesn't appear that the extra battery charges to full. I have the new firmware and everyt

  • HT1491 how do i buy an app for a friend?

    how do i buy an app for a friend?

  • Transport of org.units and structure

    Hi all I know there is a possibility to transport org.units and its structure (PPOMA_BBP). There are some settings to do in table T77S0 (key = TRSP.CORR) and 2 reports RHMOVE30 and/or RHMOVE50 to be used depending on the setting done in T77S0. It is

  • Missing primary foreign key in grandchild table

    I have a model with a two inheritance generations. https://www.dropbox.com/s/4rghqcmxx24bgvt/pf_logical.png When I engineer all entities everything is fine. The child tables get their primary foreign keys: https://www.dropbox.com/s/t4v5bexxwdrn5y1/pf

  • Creating playlists for ZEN To

    Just got the 40 gig Touch and love it. My problem is that creating playlists on the Zen is very cumbersome and I would like to create plylists on my PC as I can run a mouse faster than work on the zen. My zen is loaded with songs and I want to make p