RMI server doesn't reliably start

I have a simple RMI server with one object that has one method:
public interface Foo extends Remote {
      // the Blah class is Serializable
      java.util.ArrayList <Blah> getListOfBlahs (String name);
public class FooImpl impelments Foo {
    java.util.ArrayLIst <Blah> getListOfBlahs (String name) {
             // Do whatever...
}My server is pretty simple at the moment and looks like this:
    public static void main (String [] args) {
        try {
            Foo stub = (Foo)UnicastRemoteObject.exportObject (new FooImpl(), 0);
            Registry registry = LocateRegistry.getRegistry();
            try {
                registry.unbind ("foo");
            } catch (NotBoundException ex) {
                System.out.println ("the thing isn't bound at the moment");
            registry.bind ("foo", stub);
            System.out.println ("Server Ready.....");
        } catch (RemoteException rmi) {
            rmi.printStackTrace ();
        } catch (AlreadyBoundException ex) {
            ex.printStackTrace ();
    }The problem is that sometimes when I start it, it promptly dies again with no error messages.
A couple things:
1) The server runs on a Fedora Core 8 machine, and the firewall is shutdown.
2) Before I run the server, I make sure to start the rmiregistry.
Usually I have to start the server a few times before the process doesn't just die again.
My hypothesis is that it's trying (unsuccessfully) to bind my Foo class to a port that is in use, but why don't I get an error?
Are there other log files to look at? Maybe in /var/log somewhere?
Thanks
-matthew
Edited by: matthew on Aug 29, 2008 1:11 PM

Yep.
After making some static references to the remote objects, the server starts and stays running:
class Server {
   private static FooImpl foo;
    public static void main (String [] args) {
        try {
            foo = new FooImpl ();
            Foo stub = (Foo)UnicastRemoteObject.exportObject (foo, 0);
            Registry registry = LocateRegistry.getRegistry();
            try {
                registry.unbind ("foo");
            } catch (NotBoundException ex) {
                System.out.println ("the thing isn't bound at the moment");
            registry.bind ("foo", stub);
            System.out.println ("Server Ready.....");
        } catch (RemoteException rmi) {
            rmi.printStackTrace ();
        } catch (AlreadyBoundException ex) {
            ex.printStackTrace ();
}-matthew

Similar Messages

  • JDK6 And ClassNotFound Exception during RMI server start

    Hello,
    I have been write a simple Hello World RMI, but I'm unable to start the server always get this exeception:
    Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: rmi.Hello
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: rmi.Hello
         at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:396)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
         at sun.rmi.transport.Transport$1.run(Transport.java:159)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
         at java.lang.Thread.run(Thread.java:619)
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
         at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
         at rmi.HelloMain.main(HelloMain.java:21)
         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:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)The sources are these:
    package rmi;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Hello extends Remote {
        public void sayHello() throws RemoteException;
    package rmi;
    import java.rmi.RemoteException;
    public class HelloServer implements Hello{
        public HelloServer() {
            super();
        public void sayHello() throws RemoteException {
            System.out.println("Ciau!");
    package rmi;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import java.rmi.server.UnicastRemoteObject;
    public class HelloMain {
        public static void main(String[] args) {
         try {
             Hello obj = new HelloServer();
             Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
            // Bind the remote object's stub in the registry
            Registry registry = LocateRegistry.getRegistry();
            registry.bind("Hello", stub);
            System.err.println("Server ready");
        } catch (Exception e) {
            System.err.println("Server exception: " + e.toString());
            e.printStackTrace();
    }May be I'm wrong with start command, but I tried differents syntax without result.
    Can you help me?
    Thanks to all.
    PS:Sorry for my spaghetti-english :D

    I had similar issue and i got rid of it by doing the following:
    i. Start rmiregistry from the server code (so that the JVM remains the same) like this
    // Server.java
    Process pro = Runtime.getRuntime().exec("rmiregistry 1099 &");
    // ... ii. Use java.rmi.server.codebase property while starting the server
    D:\rmiEx\bin>java -Djava.rmi.server.codebase=file:/D:\rmiEx\bin example.hello.Server

  • RMI server behind firewall--must use host as name, not IP

    Server is running behind a firewall, which runs such that any machine behind the firewall cannot use the external IP to get back to itself.
    That is:
    - outside IP = 192.171.20.5 (port forwards 1099 to 192.168.1.5:1099)
    - inside IP = 192.168.1.5 (rmi server listens on 1099)
    from the machine inside (192.168.1.5), it is IMPOSSIBLE to create a socket to [outside ip](192.171.20.5), port 1099, and expect it to get back to the machine inside--the firewall prohibits this.
    I -can- use name-based lookups, such that I can edit the hosts file on the inside box to route (myhost.com to 192.168.1.5). So, if everyone's DNS resolves myhost.com -> 192.171.20.5, then clients anywhere can go to myhost.com:1099 and will be redirected to my internal machine (192.168.1.5:1099).
    The problem with this is that the names get translated to IPs and sent back to the client.
    Is there a way to keep the names as names, so that both client (using external real-world DNS entries) and server (using local hosts file) can both resolve to the proper IP addresses?
    I'm starting server, as follows:
    java -Djava.rmi.server.codebase=http://myhost.com/rmi/ -Djava.security.policy=/policypath/policy -Djava.rmi.server.hostname=myhost.com mypkg.myclass
    The client connects and gets this message (from a connection exception):
    java.rmi.ConnectException: Connection refused to host: 192.168.1.5;

    Server is running behind a firewall, which runs such
    that any machine behind the firewall cannot use the
    external IP to get back to itself.I dont really understand this statement.. Machines behind the firewall referring to the external ip would be going to the gateway, not themselves.. Or do you have an internal AND external ip on the machines behind the firewall? Or are we referring to the gateway machine as an internal machine as well as external?
    That is:
    - outside IP = 192.171.20.5 (port forwards 1099 to
    192.168.1.5:1099)
    - inside IP = 192.168.1.5 (rmi server listens on
    1099)looks good, what kinda OS/firewall? If we're talking linux/ipchains (or iptables) with ip masquerading, I may be of some use to you...
    from the machine inside (192.168.1.5), it is
    IMPOSSIBLE to create a socket to [outside
    ip](192.171.20.5), port 1099, and expect it to get
    back to the machine inside--the firewall prohibits
    this.If you're on the internal network, why can't you just go for the internal ip addr? If I'm understanding correctly, you want internal dns requests for myhost.com to resolve to 192.168.1.5, and external dns requests to resolve to 192.171.20.5? That should't be a problem...
    I -can- use name-based lookups, such that I can edit
    the hosts file on the inside box to route (myhost.com
    to 192.168.1.5). So, if everyone's DNS resolves
    myhost.com -> 192.171.20.5, then clients anywhere can
    go to myhost.com:1099 and will be redirected to my
    internal machine (192.168.1.5:1099).the hosts file has nothing to do with routing, it's simply a dns-type thing... If your dns is giving external users a 192.168 address as the ip for myhost.com, they will never get to it. 192.168 is not routable on the internet, i think most inet routes will drop packets from 192.168.x.x or 10.x.x.x.
    Is there a way to keep the names as names, so that
    both client (using external real-world DNS entries)
    and server (using local hosts file) can both resolve
    to the proper IP addresses?As long as your dns is working correctly, java doesn't care if you use ips or host names.. Hostnames are preferable, so when you change your network around, you wont affect your rmi server.
    I'm starting server, as follows:
    java -Djava.rmi.server.codebase=http://myhost.com/rmi/
    -Djava.security.policy=/policypath/policy
    -Djava.rmi.server.hostname=myhost.com mypkg.myclass
    The client connects and gets this message (from a
    connection exception):
    java.rmi.ConnectException: Connection refused to host:
    192.168.1.5;Is your server compiled with the 192.171 ip? That's not gonna work, you have to use the same IP the server is running on. I'm still not clear on your network layout, is 192.171.20.5 and 192.168.1.5 the 2 gateway ip's, or is 192.168.1.5 a physically different machine? I'd be willing to bet that your server is compiled with the external address, and if that's not the same machine, then there's no chance of that working....
    There's more than port forwarding going on.. IIRC, java rmi keeps track of its own ip's.. A client request to an external ip will not connect to a server running on the internal ip, even if you forward the port, rmi itself doesn't recognize the internal as the ip it's trying to get to (even if it is true), so it bombs out.. This can happen if you run the rmi server on a gateway, and compile the server with the external ip, and try to connect to the internal ip.. If you want external machines to connect, you MUST run the server on an external ip.
    Give a little more info, we'll getcha running... I'm also assuming you have full control of your network (ie, firewall/dns)
    doug

  • RMI Server Concurrent Connections Limitation

    Using Java 7 update 5 (I know it's old...), we are trying to send concurrent requests to a RMI Server. When we start to tamp up the load (not too much - up to 50 concurrent requests) we start to see many IO Problems like Broken Pipe and Connection Reset By Peer.
    Could we be hitting some unknown limitation on concurrent access? Is there such limitation?

    No, there is no limit, only the platform's limits, and your code's. Are you sure all the calls concerned work individually?

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

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

  • Server doesn't start after applying SP3

    Hi,
    after applying SP3 the server doesn't start.
    I just get the following error within the server log.
    Any hints ?
    Regards
    Gerald Eder
    JVMX version - May 20 2007 23:27:34 - 01_REL - optU - windows amd64 - bas2:78002 (mixed mode, sharing)
    (CompilerOracle exclude com/sapportals/portal/pb/layout/taglib/ContainerTag addIviewResources)
    (CompilerOracle exclude com/sap/engine/services/keystore/impl/security/CodeBasedSecurityConnector getApplicationDomain)
    (CompilerOracle exclude com/sap/engine/services/rmi_p4/P4StubSkeletonGenerator generateStub)
    (CompilerOracle exclude com/sapportals/portal/prt/util/StringUtils escapeToJS)
    (CompilerOracle exclude com/sapportals/portal/prt/core/broker/PortalServiceItem startServices)
    (CompilerOracle exclude com/sap/engine/services/webservices/server/deploy/WSConfigurationHandler downloadFile)
    (CompilerOracle exclude com/sapportals/portal/prt/jndisupport/util/AbstractHierarchicalContext lookup)
    (CompilerOracle exclude com/sapportals/portal/navigation/cache/CacheNavigationNode getAttributeValue)
    (CompilerOracle exclude com/sapportals/portal/navigation/TopLevelNavigationiView PrintNode)
    (CompilerOracle exclude com/sapportals/wcm/service/ice/wcm/ICEPropertiesCoder encode)
    (CompilerOracle exclude com/sap/lcr/pers/delta/importing/ObjectLoader loadObjects)
    (CompilerOracle exclude com/sap/engine/services/webservices/jaxrpc/encoding/InstanceBuilder readElement)
    (CompilerOracle exclude com/sap/engine/services/webservices/jaxrpc/encoding/InstanceBuilder readSequence)
    (CompilerOracle exclude com/sap/engine/services/webservices/jaxrpc/encoding/TypeMappingImpl initializeRelations)
    (CompilerOracle exclude com/sap/engine/services/webservices/jaxrpc/encoding/GeneratedComplexType _loadInto)
    (CompilerOracle exclude com/sap/lcr/pers/delta/importing/ObjectLoader loadObjects)
    The active factory is : com.sap.engine.boot.loader.StandardClassLoaderFactory
    Using an index file : D:\usr\sap\TC1\J20\j2ee\cluster\bin\index.list
    [GC [ParNew: 14592K->4114K(29120K), 0.0102761 secs] 14592K->4114K(116544K), 0.0103466 secs]
    Reading kernel properties from kernelProperties.bin file...
       Checked the data for 32 ms.
       Read the objects for 250 ms.
       Substituted the values for 47 ms.
    Finished reading kernel objects for 297 ms.
    StartupFramework returned mode [NORMAL]
    StartupFramework returned action [NONE]
    SAP J2EE Engine Version 7.10.3301.162847.20070927153007 is starting...
    Loading: LogManager ... 578 ms.
    Loading: PoolManager ... 0 ms.
    Loading: ApplicationThreadManager ... Error - ID:000004. System is halted. Exception is:
    java.lang.NoClassDefFoundError: com/sap/jvm/Capabilities
         at com.sap.engine.core.thread.impl3.ErrorQueueHandler.<clinit>(ErrorQueueHandler.java:34)
         at com.sap.engine.core.thread.impl3.ThreadManagerImpl.init(ThreadManagerImpl.java:204)
         at com.sap.engine.core.Framework.loadSingleManager(Framework.java:665)
         at com.sap.engine.core.Framework.loadManagers(Framework.java:367)
         at com.sap.engine.core.Framework.start(Framework.java:296)
         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 com.sap.engine.boot.FrameThread.startFramework(FrameThread.java:161)
         at com.sap.engine.boot.FrameThread.run(FrameThread.java:183)
         at com.sap.engine.boot.StartFrame.work(StartFrame.java:101)
         at com.sap.engine.boot.Start.main(Start.java:33)
    Caused by: java.lang.ClassNotFoundException: com.sap.jvm.Capabilities
    Loader Info -
    ClassLoader name: [system:Kernel]
    Living status: alive
    Direct parent loaders:
       [library:core_lib]
    Resources:
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\jenqulib.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcantlr~runtime.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcblcachemgmtapi_for_assembly.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcblcachemgmtimpl.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcblcache_pluginslib.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcblframekrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_cacheimpl.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_classloadkrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_clusterkrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_configurationkrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_databasekrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_licensingkrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_lockingkrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_logkrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_poolkrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_servicekrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcbljkernel_threadkrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcblopensqlkernelimplOpenSQLKrn.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcjeoffline_deployimpl.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcjesessionmgmtimpl.jar
       D:\usr\sap\TC1\J20\j2ee\cluster\bin\kernel\sap.comtcseclikeylikey_assembly.jar
         at com.sap.engine.boot.loader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:259)
         at com.sap.engine.boot.loader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:228)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:353)
         ... 13 more

    After upgrading the SAPVM the server starts

  • Starting the RMI server on Windows

    Hi
    I am just trying to use the three files in suns tutorial: http://java.sun.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html
    Hello.java - a remote interface
    Server.java - a remote object implementation that implements the remote interface
    Client.java - a simple client that invokes a method of the remote interface
    I have started the rmiregistry by running "start rmiregistry" in the java bin directory. There is no output in this window, i hope this is correct.
    But when I try to run the server I get the following message:
    Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: Hello
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: HelloI'm suspecting it has to do with the codebase parameter that I have omitted. But even if I try to add it I can't seem to figure out a way for it to start.

    I have started the rmiregistry by running "start rmiregistry" in the java bin directory. There is no output in this window, i hope this is correct. This is correct.
    I'm suspecting it has to do with the codebase parameter that I have omitted.Omitted from what?
    But even if I try to add it I can't seem to figure out a way for it to start.'It' being what?
    The RMI 'codebase' is a list of URLs where classes can be found. You define it in your server JVM via the java.rmi.server.codebase property. Normally the URLs are http: URLs, which means you need an HTTP server which will serve classes or JAR files from the specified URLs.
    Alternatively you can:
    (a) start the client with a classpath that contains the classes mentioned in the remote interface, including itself, and
    (b) (i) start the Registry ditto, or
    (b) (ii) start the Registry inside the server JVM via LocateRegistry.createRegistry.

  • Can't start RMI server using JAR file

    I found it interesting that if I start my RMI server from
    a plain directory, everything goes fine.
    But if I jar all these necessary files into a jar file,
    and start my RMI server with command below
    java -jar server.jar
    UnmarshalException and ClassNotFoundException are
    thrown to indecate that my stub class can't be found
    (which I'm sure my stub class is in jar file)
    Why is jar file so special that it can't act like
    what it originally does when it hasn't been jared?
    or I really should take care of some configuration
    before I really can run a jar file?
    thanks

    To clarify few things...
    What I don't understand is that when I convert all my
    directories and class files properly into the jar file, they
    just can't work properly.
    I don't know if it's a problem of JAR file,
    or it's RMI that make this JAR file special?
    I'll simulate my JAR file structure that listed below,
    these structure works fine when they have'nt been
    converted into JAR file.
    META-INF/
    META-INF/MANIFEST.MF
    a/b/x1.class
    a/b/x2.class
    a/b/c/Y.class
    a/b/c/Y_Skel.class
    a/b/c/Y_Stub.class
    And when I use command "java -jar server.jar"
    to run my application, ClassNotFound exception
    is thrown to indecate my stub class is not found.
    Is there anything I can do to correct this?
    thanks

  • How to Start Java RMI Server Application as Windows NT Service

    Hi!!,
    I have problem regarding the Installation of Java Application as NT Service this Java app in turn will start RMI Registry using LocateRegistry.createRegistry() at some specific port number. The Service is created successfully but i have problem regarding the Accessing of this Remote Object using Lookup() .(ie) I am able to get the RMI Registry Obj Refererce of the Java Rmi Application but couldn't able to Lookup for the Object registered to this Rmi Registry.I am not able to proceed after getting the Rmi Registry reference.
    So any help Regarding this is appreciated.
    Thanks in Advance.
    with regards,
    Ramakrishna M
    Mail: [email protected]

    Hello,
    I have started a Java RMI Server Application as NT Service using JNT (download it from www.eworksmart.com/JNT/ ).
    It is working fine.
    S. Navaneethakrishnan
    [email protected]

  • Starting and stopping an RMI server

    I'm trying to figure out how to best stop and start my server.
    My server class has two executions. One for starting and one for stopping.
    Start Steps:
    1) create my remote object ( an extension of UnicastRemoteObject )
    2) create a registry ( LocateRegistry.create() )
    3) bind my remote object
    When I run this start method of my RMI server class, everything get's set up. I'm not doing any sort of waiting loop or anything to determine the lifecycle of my server. My understanding is that my rmiregistry, and my registered remote object, will continue to be available indefinitely. Perhaps this is incorrect.
    Stop Steps:
    When I want to stop the server, I'm calling my stop method. This is another invocation of my server class, so it's a separate JVM. In this stop method I want to do the following steps:
    1) get the registry that I created earlier, by port number
    2) get my remote object via reg.lookup()
    3) unbind my remote obect ( reg.unbind() )
    4) unexport my remote object ( UnicastRemoteObject.unexport ( myRemoteObj, true ) )
    My concerns here are whether this makes sense. Does the unexport method work like this? i.e. from a remote handle to the object -- I'm not in the local JVM when the stop method runs. Also, does the rmiregistry "just die" at this point? It's not holding anything and when my method exits there's no reference to it anywhere. Except maybe in client code . . .

    My understanding is that my rmiregistry, and my registered remote object, will continue to be available indefinitely. Perhaps this is incorrect.That's correct as long as you store static references to them both in the server JVM.
    My concerns here are whether this makes sense. Does the unexport method work like this? i.e. from a remote handle to the objectNo. You have to have the actual remote object. You could make shutdown() an RMI method itself.
    Also, does the rmiregistry "just die" at this point?No, you have to unexport that as well.

  • MDM Server doesn't start after upgrade to SP 5

    hi,
    i'm not used to sap services on windows hosts.
    After the Update from 7.1.04 to 7.1.05 the mdm server doesn't start. I found only a few logs (unter c:/usr/sap/SID/MDS00/work). Most of them from sapcpe (without errors or warnings). Only the sapstart.log contains a bit information:
    SAP-R/3-Startup Program
    Starting at 2010/08/16 21:29:18
    Startup Profile: "C:\usr\sap\MDM\SYS\profile\MDM_MDS00_mdmtest"
    Starting Programs
    (1684) Execute: C:\usr\sap\MDM\SYS\exe\uc\NTAMD64\sapcpe.EXE pf=C:\usr\sap\MDM\SYS\profile\MDM_MDS00_mdmtest list:C:\usr\sap\MDM\SYS\exe\uc\NTAMD64/mds.lst
    (976) Execute: C:\usr\sap\MDM\SYS\exe\uc\NTAMD64\sapcpe.EXE pf=C:\usr\sap\MDM\SYS\profile\MDM_MDS00_mdmtest list:C:\usr\sap\MDM\SYS\exe\uc\NTAMD64/shared.lst
    (3632) Execute: C:\usr\sap\MDM\SYS\exe\uc\NTAMD64\sapcpe.EXE pf=C:\usr\sap\MDM\SYS\profile\MDM_MDS00_mdmtest list:C:\usr\sap\MDM\SYS\exe\uc\NTAMD64/sapinstance.lst
    (2172) Execute: C:\usr\sap\MDM\MDS00\exe\mdmcpc.bat C:\usr\sap\MDM\SYS\profile\MDM_MDS00_mdmtest.INI C:\usr\sap\MDM\MDS00\config\mds.ini
    (3652) CreateProcess: C:\usr\sap\MDM\MDS00\exe\mds.EXE
    Process 3652 died unexpectedly, restarting process
    (3612) Restart CreateProcess: C:\usr\sap\MDM\MDS00\exe\mds.EXE
    Process 3612 died unexpectedly, restarting process
    (2364) Restart CreateProcess: C:\usr\sap\MDM\MDS00\exe\mds.EXE
    Process 2364 died unexpectedly, restarting process
    (3576) Restart CreateProcess: C:\usr\sap\MDM\MDS00\exe\mds.EXE
    Process 3576 died unexpectedly, restarting process
    (3588) Restart CreateProcess: C:\usr\sap\MDM\MDS00\exe\mds.EXE
    Process 3588 died unexpectedly, final process restart.
    Process will not be restated in the future because of frequent failure.
    (1396) Restart CreateProcess: C:\usr\sap\MDM\MDS00\exe\mds.EXE
    This isn't really much I can work with. In the sapmmc I found the Option Developer Trace. I try to 'switch it on', but there is no difference.
    With 7.1.04 the server was running well.
    I happy for any suggestions

    Hi,
    Please check out Note 1482822 - MDM Server not starting after MDM 7.1 SP05 was installed.
    hope it helps you.
    Best regards,
    sudhanshu

  • Problem in starting RMI server, please help!

    Hi , all:
    I am learning RMI from SUN's tutorial. I set all of program packages as same as the tutorial, compiled all of programs . and built all of the jar files, the server classes and the client classes.When I run the server, ComputeEngine, it did not work ,and the following messages were showed at command lines:
    C:\RMI\doc>java -Djava.rmi.server.codebase=file:/c:\rmi\ann\public_html\classes/
    -Djava.rmi.server.hostname=localhost -Djava.security.policy=java.policy eng
    ine.ComputeEngine
    ComputeEngine exception: access denied (java.net.SocketPermission 127.0.0.1:1099
    connect,resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    27.0.0.1:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:
    399)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
    at java.net.Socket.<init>(Socket.java:262)
    at java.net.Socket.<init>(Socket.java:100)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
    SocketFactory.java:25)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
    SocketFactory.java:120)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at engine.ComputeEngine.main(ComputeEngine.java:25)
    Please give helps .
    Thanks!

    Thank.
    Thank.
    I have put them at the same directory, but is deos not work.
    Something I am not sure.
    On the SUN's tutorial , the follows is given:
    Win32:
    java -Djava.rmi.server.codebase=file:/c:\home\ann\public_html\classes/
    -Djava.rmi.server.hostname=zaphod.east.sun.com
    -Djava.security.policy=java.policy
    engine.ComputeEngine
    I changed hostname = localhost
    I also changed the code of the server class given by tutorial :
    String name = "//host/Compute" ;
    to:
    String name = "//localhost/Compute";
    Should I make such changes?
    Here is the server class given by the tutorial:
    package engine;
    import java.rmi.*;
    import java.rmi.server.*;
    import compute.*;
    public class ComputeEngine extends UnicastRemoteObject
    implements Compute
    public ComputeEngine() throws RemoteException {
    super();
    public Object executeTask(Task t) {
    return t.execute();
    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    String name = "//host/Compute";
    try {
    Compute engine = new ComputeEngine();
    Naming.rebind(name, engine);
    System.out.println("ComputeEngine bound");
    } catch (Exception e) {
    System.err.println("ComputeEngine exception: " +
    e.getMessage());
    e.printStackTrace();

  • Problem in starting RMI server, help please

    Hi , all:
    I am learning RMI from SUN's tutorial. I set all of program packages as same as the tutorial, compiled all of programs . and built all of the jar files, the server classes and the client classes.When I run the server, ComputeEngine, it did not work ,and the following messages are showed at command lines:
    C:\RMI\doc>java -Djava.rmi.server.codebase=file:/c:\rmi\ann\public_html\classes/
    -Djava.rmi.server.hostname=localhost -Djava.security.policy=java.policy eng
    ine.ComputeEngine
    ComputeEngine exception: access denied (java.net.SocketPermission 127.0.0.1:1099
    connect,resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    27.0.0.1:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:
    399)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
    at java.net.Socket.<init>(Socket.java:262)
    at java.net.Socket.<init>(Socket.java:100)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
    SocketFactory.java:25)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
    SocketFactory.java:120)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at engine.ComputeEngine.main(ComputeEngine.java:25)
    Please give helps .
    Thanks!

    You are setting the security policy to the file named
    java.policy, make sure that it is in the same
    directory where you are invoking the java compiler.Thank.
    I have put them at the same directory, but is deos not work.
    Something I am not sure.
    On the SUN's tutorial , the follows is given:
    Win32:
    java -Djava.rmi.server.codebase=file:/c:\home\ann\public_html\classes/
    -Djava.rmi.server.hostname=zaphod.east.sun.com
    -Djava.security.policy=java.policy
    engine.ComputeEngine
    I changed hostname = localhost
    I also changed the code of the server class given by tutorial :
    String name = "//host/Compute" ;
    to:
    String name = "//localhost/Compute";
    Should I make such changes?
    Here is the server class given by the tutorial:
    package engine;
    import java.rmi.*;
    import java.rmi.server.*;
    import compute.*;
    public class ComputeEngine extends UnicastRemoteObject
    implements Compute
    public ComputeEngine() throws RemoteException {
    super();
    public Object executeTask(Task t) {
    return t.execute();
    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    String name = "//host/Compute";
    try {
    Compute engine = new ComputeEngine();
    Naming.rebind(name, engine);
    System.out.println("ComputeEngine bound");
    } catch (Exception e) {
    System.err.println("ComputeEngine exception: " +
                   e.getMessage());
    e.printStackTrace();

  • 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