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.

Similar Messages

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

  • How to Convert an RMI Server into WINNT service

    I have an RMI Server, that looks like the following
    SimpleRMIServer.java
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class SimpleRMIServer
    public static void main(String[] argv) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    LocateRegistry.createRegistry(1099);
    SimpleRMIImpl implementation = new SimpleRMIImpl("SimpleRMIImpl instance");
    // SimpleRMIImpl implementation = new SimpleRMIImpl("SimpleRMIImpl instance");
    System.out.println("SimpleRMIImpl ready");
    catch (Exception e) {
    System.out.println("Exception occurred: " + e);
    the SimpleRMIImpl.java also is available. (SimpleRMIImpl.class)
    now the problem is how to convert this Server to a service.
    I have seen a java class that extends a service class have been converted to a service like the following
    TestService.java
    // TestService.java
    // (C) Copyright 1995 - 1999 Microsoft Corporation. All rights reserved.
    import java.io.*;
    import com.ms.service.*;
    public
    class TestService extends Service
    static
    // Uncomment to disable the assassin. The service will fail to respond
    // in the time specified in the last waithint for the third pause
    // event received. If the assassin is enabled (i.e. this line is commented
    // out, the default), then the service will be forcibly killed.
    //Service.disableassassin = true;
    int pausecount;
    int intcount;
    public TestService (String[] args) throws IOException
    System.out.println("Sending updated pending status");
    CheckPoint(1000);
    System.out.println("Sending running status with all controls");
    setRunning(ACCEPT_SHUTDOWN | ACCEPT_PAUSE_CONTINUE | ACCEPT_STOP);
    System.out.println("Started");
    protected
    boolean handleStop ()
    setStopping(5000);
    System.out.println("dying");
    return true;
    protected
    boolean handlePause ()
    pausecount++;
    if (pausecount == 3)
    System.out.println("pause #3, sleeping for 30 seconds, should be killed in 2+5 seconds");
    setPausing(2000);
    try
    Thread.sleep(30000);
    catch (InterruptedException e)
    System.out.println("interrupted");
    else
    System.out.println("received pause #"+pausecount+", pausing for 2 seconds");
    setPausing(5000);
    try
    Thread.sleep(2000);
    catch (InterruptedException e)
    System.out.println("interrupted");
    System.out.println("sending paused");
    setPaused();
    System.out.println("sent paused");
    return false;
    protected
    boolean handleContinue ()
    System.out.println("received continue, continuing after 2 seconds");
    setContinuing(5000);
    try
    Thread.sleep(2000);
    catch (InterruptedException e)
    System.out.println("interrupted");
    System.out.println("sending running");
    setRunning();
    System.out.println("sent running after continue");
    return false;
    protected
    boolean handleShutdown ()
    System.out.println("received shutdown, treating as stop");
    return handleStop();
    protected
    boolean handleInterrogate ()
    System.out.println("received interrogate");
    setServiceStatus(getServiceStatus());
    System.out.println("sent status for interrogate");
    intcount++;
    if (intcount == 3)
    System.out.println("received 3rd interrogate, stopping self in 5 seconds");
    try
    Thread.sleep(5000);
    catch (InterruptedException iex)
    System.out.println("interrupted");
    System.out.println("stopping");
    StopServiceEventHandler(1000);
    return false;
    using the jntsvc.exe tool, that code have been converted to an executable, then installed as a service.
    I've tried to embed the RMIServer code in the constructor for this service, but it didn't work
    Hope you have a clear understanding of what I'm saying
    any help, highly appreciated
    thanx in advance
    here is my email [email protected]
    regards

    Our second installment of "Questions from the Past"
    Dear viewer, check out Tomcat's source, I believe they implement Tomcat as a service so just follow what they did.
    Steve - your answer Guru
    Tune in next week for our third installment of "Questions from the past"

  • Connect Via RMI To A Remote Service?

    Has anyone connected, via RMI, to a remote service within an application module? Currently this seems to wreak havoc upon all future and current ORMI communication to and from the application server in which a model is deployed (or at least within a container). Does anyone have any idea on how to do this correctly?
    -Brian
    When a connection is initiated I get the following stack trace:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.security.AccessControlException, msg=access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6301)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.security.AccessControlException: access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
         at java.net.InetAddress.getAllByName(InetAddress.java:1061)
         at java.net.InetAddress.getByName(InetAddress.java:958)
         at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
         at java.net.Socket.<init>(Socket.java:178)
         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:569)
         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:306)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at net.nighthawk.ifd.client.communications.Communications.updateFaxViewerRMIServer(Communications.java:156)
         at net.nighthawk.talon.model.bc.autorad.QCServicesAppModuleImpl.sendReport(QCServicesAppModuleImpl.java:5560)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6279)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

    Has anyone connected, via RMI, to a remote service within an application module? Currently this seems to wreak havoc upon all future and current ORMI communication to and from the application server in which a model is deployed (or at least within a container). Does anyone have any idea on how to do this correctly?
    -Brian
    When a connection is initiated I get the following stack trace:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.security.AccessControlException, msg=access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6301)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.security.AccessControlException: access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
         at java.net.InetAddress.getAllByName(InetAddress.java:1061)
         at java.net.InetAddress.getByName(InetAddress.java:958)
         at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
         at java.net.Socket.<init>(Socket.java:178)
         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:569)
         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:306)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at net.nighthawk.ifd.client.communications.Communications.updateFaxViewerRMIServer(Communications.java:156)
         at net.nighthawk.talon.model.bc.autorad.QCServicesAppModuleImpl.sendReport(QCServicesAppModuleImpl.java:5560)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6279)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • Some basic questions about rmi registry  context  "bind" and "lookup"

    We have more processing to do than can be accomplished with a single computer. To solve the problem I've implemented a distributed computing solution using RMI. (The first time I saw RMI was about 2 weeks ago, so please bear with me!)
    The implementation is a proof of concept not a fully fleshed out system. I have one "Workunit Distributor" computer and any number of "Data Processor" computers all on the same lan segment. "Workunit Distributor" and "Data Processor" computers are both RMI client and server to each other. The "Data Processor" computers are given the ip address and name of the "Data Distributor" on the commandline when they start. They communicate their willingness to receive and process a workunit to the ""Workunit Distributor" via a RMI call. Work units are sent to available "DataProcessors" and results are eventually returned to the "WorkunitDistributor" (minutes or hours later). The model program works quite well, and appears to be capable of doing the processing we need to get done.
    But now that it seems viable, I've been asked to make it a little more scalable, flexible and self configuring. In particular, instead of one "Workunit Distributor", any number of "Workunit Distributors" should be allowed to show up or disappear from the lan at any time and the system should continue to function. I've worked out a good scheme for how this can be done, but I have a couple of questions about the RMI registry (registries?). I'm trying to keep from implementing some functionality that may already be available as a library or subsystem.
    With my current model design, each computer binds to its own registry with a unique name. For instance:
    CRDataProcessorImpl crdpi = new CRDataProcessorImpl(svr);
    Context crDataProcessingContext = new InitialContext();
    crDataProcessingContext.bind("rmi:"+hostName, crdpi);
    Currently the "Data Processors" get the info they need for a Context lookup() of the one and only "Workunit Distributor" from the commandline. And the info the "Workunit Distributor" needs to do a Context lookup() of a "DataProcessor" is passed to it from each "DataProcessor" via a RMI call.
    But in the newer (yet to be implemented) scheme where any and all "Workunit Distributors" show up and disappear whenever they feel like, the naming bootstrapping scheme described above won't work.
    I can imagine a few ways of solving this problem. For instance, having "Workunit Distributors" multicast their contact information on the lan and have a worker thread on each "Data Processor" keep track of the naming information that was multicast. Another alternative (more organized, but more complex) might be to have a dedicated host with a "well known" address and port that "Workunit Distributors" and "Data Processors" could all go to, to register or look up at an application level. Sort of a "domain name service" for RMI. But both these schemes look like a lot of work to implement , debug and maintain.
    The BEST thing would be if there was one plain vanilla RMI registry that was usable by all RMI enabled computers instead of having each computer have its own local name registry. In volume 2 of the Core Java2 book it says that every registry must be local. I'm only hoping there's been progress since the book was published and now a central rmi registry is available.
    If you have any ideas about this I'd like to hear what you know.
    Thanks in advance for any advice.
    Lenny Wintfeld
    ps - I don't believe web services, as full featured as it is, is a useful alternative. I'm moving 100's (in the future possibly 1000's) of megabytes back an forth for processing.

    The local bind/rebind/unbind restriction is still there and it will always be there.
    I would look at
    (a) RMI/IIOP, where you use COSNaming as a registry, which doesn't have that registriction, and which also has location-independent object identifiers
    (b) Jini.

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

    This is the same problem I ran into. Unfortunately there is no way around this. I had to abondon using RMI registry and instead I changed my program to use the tnameserv/orbd stand-alone naming services in a typical JNDI fashion. This tutorial has some examples, good luck:
    http://java.sun.com/j2se/1.4.1/docs/guide/rmi-iiop/tutorial.html

  • Binding RMI-IIOP Remote Object in RMI Registry through JNDI

    hi friends
    I am writing RMI-IIOP Remote Object, both server program, and client program
    are java programs. Through JNDI (with cosnaming name service), my program is working.
    But what i want is, I want to use JNDI (with rmi registry name service) for my RMI-IIOP Remote Object ( and not RMI -JRMP Remote Object). Both my server
    program and client programs are java(and not corba)
    I am not getting this, while starting server its showing some error
    Is it not possible to bind rmi-iiop remote object in rmi registry through jndi, why

    because you are supposed to use the COSNaming service with IIOP. Even if you could bind an IIOP remote object into an RMIRegistry the clients wouldn't be able to use it because the RMI Registry doesn't do the extra processing that the COSNaming service does with IIOP references.

  • RMI Registry

    Hi!
    Is it possible to install more then one RMI Registry service
    in the same machine? If so, how can the clients make the
    distinction between objects ?
    Thanks!

    Yes, just bind each "registry" to a different port. The default port is 1099. So, for example, you can bind a "registry" to port 1098 with the following command:
    rmiregistry 1098Of-course, if port 1098 is already being used, the above command will fail -- and you will get an error message.
    Hope this helps.
    Good Luck,
    Avi.

  • Unable to contact the RMI registry

    Can anyone please help with this error?
    exception: flex.messaging.MessageException: Unable to contact
    the RMI registry on 'localhost' to look for the oldFusion Data
    Management Service: java.rmi.onnectionIOException: error during
    JRMP connection establishment; nested exception is:
    java.net.SocketTimeoutException: Read time out.
    This is a previously working flex app, but a fresh install of
    ColdFusion 7 and I've enabled FDS in CF Admin.

    Can anyone please help with this error?
    exception: flex.messaging.MessageException: Unable to contact
    the RMI registry on 'localhost' to look for the oldFusion Data
    Management Service: java.rmi.onnectionIOException: error during
    JRMP connection establishment; nested exception is:
    java.net.SocketTimeoutException: Read time out.
    This is a previously working flex app, but a fresh install of
    ColdFusion 7 and I've enabled FDS in CF Admin.

  • 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

  • Simple question about java.rmi.registry.Registry

    Hi,
    where the object java.rmi.registry.Registry takes a URL to rmiregistry when perform bind method.
    thanks.

    Ok, will try to explain.
    I have a server that I register in the RMI registry. Client from a remote machine get the server (as a remote object) and calls his method for the generation of another object on the parameters passed. The server creates this object and tries to register it in the RMI registry, and this raises an exception Registry.Registry.rebind disallowed; origin /11.0.10.31 is non-local host.
    11.0.10.31 is a IP - address of the client

  • Service Registry in Web Service Configuration

    Hi
    I have a unique problem
    I am using NWDS
    SAP NetWeaver Developer Studio
    SAP Enhancement Package 1 for SAP NetWeaver Developer Studio 7.1 SP04 PAT0000
    Build id: 200911281443
    In NWDS when I go to Windows --> Preferences --> Destination Configuration --> Web Service Configuration --> and say CREATE in the Destination Type I can not see the option of Service Registry I can only see the option of WSDL and WSIL
    and in the following doc
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e058a805-68b2-2b10-6a8b-fc570f1c37d1?quicklink=index&overridelayout=true
    How to Browse an Enterprise Services Registry in Visual Composer.pdf
    Page 13 they have shown a screenshot where it shows the Destination Type as Service Registry
    Can anyone tell me please how can I get the option of having Service Registry in Web Service Configuration
    I have also installed CE 7.1 EHP1 preview provided by SDN
    I know its a unique problem but if someone can throw light on this it will be very helpful to all those who want to work on Enterprise Service Repository
    Regards
    JM

    Hi John,
    I think the screenshot is wrong.
    You can use WSIL to configure the backend system.
    The WSIL url for ABAP systems is http://[host]:[port]/ sap/bc/srt/wsil?sap-client=[client_no]
    Regards,
    Christian

  • 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

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

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

Maybe you are looking for