Runtime exception by rmi server

Hi all,I need a help regarding this issue.iam having the following error on the logs.The only way to fix thi issue was restarting the managed server and it got resolved.Is there any resaon for the cause of this issue,as the code is moving to production i want to make sure to identify what could be the reason to get this error.Any help is greatly appreciated.
<<WLS Kernel>> <> <> <1300456918029> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.getAttribute(Ljavax.management.ObjectName;Ljava.lang.String;Ljavax.security.auth.Subject;)
javax.management.RuntimeMBeanException: javax.management.RuntimeMBeanException: MBean getAttribute failed: java.lang.NullPointerException.
javax.management.RuntimeMBeanException: javax.management.RuntimeMBeanException:MBean getAttribute failed: java.lang.NullPointerException
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:856)

I am suffering the same problem, any fix for this problem??

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

  • Raising new Exception within RMI server

    hi all,
    i implemented an RMI server which, in one of his method, throws my custom exception.
    Since my RMI server is loading classes dynamically, i grabbed all those exceptions that comes when a class cannot be loaded in an MyClassNotLoadedException
    in my code i write the following lined
    try {
    MyClass example = (MyClass)class.forName("MyClass").newInstance();
    } catch(Exception e) {
    throws new MyClassNotLoadedException(e);
    when i am running my test client, i always got the following exception:
    java.rmi.activation.ActivateFailedException: failed to activate object; nested e
    xception is:
    java.rmi.activation.ActivationException: group creation failed after 2 t
    ries; nested exception is:
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception
    is:
    java.lang.ClassNotFoundException: com.nokia.jiacc.IACClassNotLoadedExcep
    tion
    java.rmi.activation.ActivationException: group creation failed after 2 tries; ne
    sted exception is:
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception
    is:
    java.lang.ClassNotFoundException: com.nokia.jiacc.IACClassNotLoadedExcep
    tion
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.ClassNotFoundException: com.nokia.jiacc.IACClassNotLoadedExcep
    tion
    java.lang.ClassNotFoundException: com.nokia.jiacc.IACClassNotLoadedException
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
    RemoteCall.java:245)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
    220)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
    at sun.rmi.server.Activation$ActivatorImpl_Stub.activate(Unknown Source)
    at java.rmi.activation.ActivationID.activate(ActivationID.java:89)
    at sun.rmi.server.ActivatableRef.activate(ActivatableRef.java:250)
    at sun.rmi.server.ActivatableRef.invoke(ActivatableRef.java:110)
    at com.nokia.jiacc.IACCPlugInImpl_Stub.callMeRemotely(Unknown Source)
    at com.nokia.jiacc.examples.Client.main(Client.java:52)
    If instead, in the catch statement i don't raise any exception, everything works fine.
    can anyone help me?? is it so that every exception that i raise in my RMI server must
    extends RemoteException??
    hope that someone can help me
    thanx in advance and regards
    marco

    Don't need to extends RemoteException. But have you defined your
    Exception that is implements Serializable?
    public class YourException extends Exception
                                 implements Serializable
    {...}Regards,
    Geri

  • Java.rmi.server.ExportException...

    I am making a bridge code.
    the server is in a package called bridgeserver.
    The client in a package called bridgeclient.
    I have compiled all files in the packages.
    I do rmic bridgeserver.BridgeServer(name of server program) from jdk1.3
    I do c:\jdk1.3 >rmic bridgeclient\BridgeClient(name of client).
    then start rmiregistry
    then when I do java bridgeserver.BridgeServer(runnign thr server) I get the follwowing exceptions:
    java.rmi.server.ExportException : Unable to access remote reference,
    nested exception is
    java.rmi.server.SkeletonNotFoundException:
    Skeleton class not found :bridgeserver.BridgeServer_Skel;nested exception is ;
    java.lang.ClassNotFoundException :bridgeserver.BridgeServer-Skel
    Is there sometyhign wrong with the classpath?

    on your rmic line include the option
    -v1.2
    This should get rid of skeleton junk. (But of course may uncover other problems.)

  • Java.rmi.RemoteException: Runtime exception; nested exception

    I am developing a web service standalone client using J2SDK 1.5 and I get the following exception below in one of the generated stubs. I am using Netbean 5.0. Please how can the expected and actual be matched. Thanks
    java.rmi.RemoteException: Runtime exception; nested exception is:
    unexpected element name: expected=getAllLatestNoonRatesReturn, actual={http://v1_0.WebService.fxrates.markets}getAllLatestNoonRatesReturn
    at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:331)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:313)
    at fxwsclient.FXWS_Stub.getAllLatestNoonRates(FXWS_Stub.java:129)
    at fxwsclient.ClientMain.main(ClientMain.java:45)
    Caused by: unexpected element name: expected=getAllLatestNoonRatesReturn, actual={http://v1_0.WebService.fxrates.markets}getAllLatestNoonRatesReturn
    at fxwsclient.FXWS_getAllLatestNoonRates_ResponseStruct2_SOAPSerializer.doDeserialize(FXWS_getAllLatestNoonRates_ResponseStruct2_SOAPSerializer.java:55)
    at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:192)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:155)
    at fxwsclient.FXWS_Stub._deserialize_getAllLatestNoonRates(FXWS_Stub.java:322)
    at fxwsclient.FXWS_Stub._readFirstBodyElement(FXWS_Stub.java:290)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    ... 2 more
    BUILD SUCCESSFUL (total time: 6 seconds)

    Looks like the server is sending a namespace qualified response when a non-qualified response is expected. If you are accessing a .NET endpoint this is a known issue with their implementation.

  • Crazy Exception blocked my RMI server

    Hi all one crazy exception is thrown when I try to start the server. Plz reply me the the possible cause and solution.
    thanks in advance
    The exception is :
    Error starting service
    java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
    java.net.SocketException: JVM_Bind (code=10055)

    You cant listen / bind on port 0. Try a different port number greater than 1024. That should work out.

  • RMI server and client in one application - Exceptions during some calls

    I wrote an application, which is an RMI-Server (Server1), and another separate application, which is an RMI-Client (Client1). Because I wont use dynamic class loading, I gave the client beside the interface.java also an interface_implementation.java, which is only a dummy of the original interface_implementation of the server. This dummy contains only declarations of the methods (parameters and return values) and no functional code. From this dummy the _stub.class is generated, and it works fine - no problem.
    Now I want to modify Client1 to become also an RMI-Server (Server2) for a second, separate Client (Client2), the methods used are different from the first RMI connection. This Client2 uses a dummy of the implementation of Server2 in the same way as described above. The application Client1+Server2 only has to "translate" the calls from Client2 to Server2 into calls of Client1 to Server1 (Server1 is not changed at all). In case of primitive method parameters or return values this chain of RMI-applications works fine, but in case of more complex structures (my own classes) during the call of Client1 to Server1 an "ClassNotFoundException: access denied to class loader" occurs by running through the stub. Both stub.classes are found, all of the applications know the objects needed, the call of Client1 to Server1 is exactly the same call as it was during the simple version (only Server1 and Client1).
    Does anybody know, why this exception occurs and how I can overcome this ?
    Axel

    I figured out a solution - it's a problem of policies. In detail: Server1's codebase entry (file:) refers to the class directory of Server1's project. In the simple case of only Client1, which has no codebase entry, it works fine without a file permission on the side of Server1. In the complex case of Client1+Server2, which has to have a codebase entry (file:) refering to the class directory of the Server2's project on a separate machine, for exactly the same method call from Client1 to Server1 a file permission entry on the side of Server1 is needed for Server1's class directory. But WHY ???
    It seems to be a little confusing with the codebase entries, many of the posts are contrary to others and to my personal experiences. Some comments given by Adrian Colley throw a little light upon some aspects. Is there anybody, who can explain the whole topic, when, why, and which part of RMI application deals with codebase entries, also in case of not dynamic code downloading ? May be there is also a reference into the java docs, which I didn't found up to now.
    Thanks in advance
    Axel

  • Exception thrown by rmi server

    We are getting this follwing error -
    Thu Jul 18 09:41:45 EDT 2002:<E> <Adapter> Exception thrown by rmi server: [1509
    452174786178111S10.15.3.21:[7001,7001,7002,7002,7001,-1]/3]
    java.lang.SecurityException:
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.lang.RuntimeException.<init>(Compiled Code)
    at java.lang.SecurityException.<init>(SecurityException.java:39)
    at weblogic.t3.srvr.T3Srvr.checkServerLock(T3Srvr.java:1926)
    at weblogic.jndi.internal.WLNamingManager.checkServerLock(WLNamingManage
    r.java:97)
    at weblogic.jndi.internal.RemoteContextFactoryImpl.getContext(RemoteCont
    extFactoryImpl.java:95)
    at weblogic.jndi.internal.RemoteContextFactoryImpl_WLSkel.invoke(RemoteC
    ontextFactoryImpl_WLSkel.java:55)
    at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(Compiled Code
    at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(Compiled
    Co
    de)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(Compiled Code)
    Does any one has a clue about this? Thanks in advance.

    I am suffering the same problem, any fix for this problem??

  • RMI-server communicates oracle: Exception

    Hallo everybody,
    My task is:
    - to implement in oracle Java stored procedure,
    - to implement RMI server
    - to load in oracle wrapper for Connection-object (ConnectionImpl), that has a reference at Connection (default oracle Connection), this ConnectionImpl-object will be passed to RMI-server, the RMI-server will call a method on this object.
    - Stub and Skeleton of ConnectionImpl are on both sides available (inside of oracle (as .jar) and on RMI-server side).
    First I start RMI-server. Then I call the stored procedure. It finds RMI-server, calls the method on RMI-server side, then RMI-server tries to call the method of ConnectionImpl with the following result:
    Fehler: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketException: Connection reset
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketException: Connection reset
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketException: Connection reset
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
         at sun.rmi.transport.Transport$1.run(Transport.java:148)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
         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:534)
         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:133)
         at server.NativeDllServer_Stub.init(Unknown Source)
         at storedprocedure.OracleTest.verbinde(OracleTest:26)
    Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketException: Connection reset
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:274)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
         at elena.ConnectionImpl_Stub.returnString(Unknown Source)
         at server.NativeDllServer.init(NativeDllServer.java:18)
    I will be thankful for every tip, how I can resolve it.

    Its clear you have the java permission set to allow db Java to write to a socket, since the call to the RMI server works, but maybe you are missing the permission to allow db java to listen and/or read from a socket?
    See:
    http://download-west.oracle.com/docs/cd/B14117_01/java.101/b12021/security.htm#sthref714
    for java.net.SocketPermission
    Chris

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

  • My RMI Server application Not work under Linux: Exception: Connection reset

    Under Red Hat Linux 8.0 my RMI server application, when I try to bind the Impl class, sends me the exception:
    "java.rmi.UnmarshalException: Error unmarshaling return header;
    nested exception is: java.net.SocketException: Connection reset".
    And it works under Windows 2000 without any problem.
    What could it be?
    Many thanks,
    Ales.

    Hi Ales,
    Try to change your /etc/hosts file, and change the line that says :
    127.0.0.1     MDK localhost.localdomain localhost
    (where MDK is the machine's name).
    Remove MDK from this line and add a new one mapping it to a 'real' outside IP address, visible (check firewall!!!) to the network from where you are approaching the Linux Box
    Good luck,
    Aart

  • Why constructor of rmi server throws remote exception

    why is it that the constructor of the class extending UnicastRemoteObject i.e rmi server has to throw RemoteException?

    Writing an RMI server is a matter of defining a class, exporting it when constructed and implementing one or more remote interfaces. How to export?
    auto export happens when u call super() in the constructor. It is then registered with the rmi system and made to listen to a TCP port. The various constructors for UnicatRemoteObject allow the derived classes to export at the default port.
    Because this automatic export step occurs at construction the constructors throw this exception.

  • RMI server causes the system to slow down and crash with socketException

    Hi,
    My RMI server application is a simple rmi server which invokes a JNI method once when I invoke through my client application. Server is left as it is after invoking the JNI method. After around 12 hours, server stops running with the following exception
    ZoneInfo: C:\Program Files\Java\jre1.6.0\lib\zi\ZoneInfoMappi
    ngs (Insufficient system resources exist to complete the requested service)
    ZoneInfo: C:\Program Files\Java\jre1.6.0\lib\zi\ZoneInfoMappings (Insufficient s
    ystem resources exist to complete the requested service)
    Dec 29, 2008 10:09:34 AM sun.rmi.transport.tcp.TCPTransport$AcceptLoop executeAc
    ceptLoop
    WARNING: RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,por
    t=0,localport=2161] throws
    java.net.SocketException: socket closed
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.PlainSocketImpl.accept(Unknown Source)
    at java.net.ServerSocket.implAccept(Unknown Source)
    at java.net.ServerSocket.accept(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unkno
    wn Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Dec 29, 2008 10:10:35 AM sun.rmi.transport.tcp.TCPTransport$AcceptLoop executeAc
    ceptLoop
    WARNING: RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,por
    t=0,localport=2161] throws
    java.net.SocketException: socket closed
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.PlainSocketImpl.accept(Unknown Source)
    at java.net.ServerSocket.implAccept(Unknown Source)
    at java.net.ServerSocket.accept(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unkno
    wn Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Dec 29, 2008 10:12:36 AM sun.rmi.transport.tcp.TCPTransport$AcceptLoop executeAc
    ceptLoop
    WARNING: RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,por
    t=0,localport=2161] throws
    java.net.SocketException: socket closed
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.PlainSocketImpl.accept(Unknown Source)
    at java.net.ServerSocket.implAccept(Unknown Source)
    at java.net.ServerSocket.accept(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unkno
    wn Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Dec 29, 2008 10:15:37 AM sun.rmi.transport.tcp.TCPTransport$AcceptLoop executeAc
    ceptLoop
    WARNING: RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,por
    t=0,localport=2161] throws
    java.net.SocketException: socket closed
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.PlainSocketImpl.accept(Unknown Source)
    at java.net.ServerSocket.implAccept(Unknown Source)
    at java.net.ServerSocket.accept(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unkno
    wn Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Dec 29, 2008 10:20:40 AM sun.rmi.transport.tcp.TCPTransport$AcceptLoop executeAc
    ceptLoop
    WARNING: RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,por
    t=0,localport=2161] throws
    java.net.SocketException: socket closed
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.PlainSocketImpl.accept(Unknown Source)
    at java.net.ServerSocket.implAccept(Unknown Source)
    at java.net.ServerSocket.accept(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unkno
    wn Source)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    # An unexpected error has been detected by Java Runtime Environment:
    # Internal Error (4D555445583F57494E13120E4350500075), pid=1352, tid=1828
    # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)
    # Can not save log file, dump to screen..
    # An unexpected error has been detected by Java Runtime Environment:
    # Internal Error (4D555445583F57494E13120E4350500075), pid=1352, tid=1828
    # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    Does anyone has any idea?
    Regards
    Nidhin

    Your RMI server invokes a JNI method as you mentioned. It seems your system resource is become very low as from the exception from "ZoneInfoMappi"
    (Insufficient system resources exist to complete the requested service...I would suggest the following
    1- remove the JNI method invocation and replace by a simple method which does nothing special ( counting etc..)
    2- Run the RMI sever and stress test it again
    If you see the RMI server is working well after 12 hours, then your native method is leaking i.e consuming the system resources ( RAM etc..)
    You should profile the running RMI server using jconsole
    Regards,
    Alan Mehio

  • My first RMI server: problem

    Hi,
    I'm just trying to create my first RMI program, but I got already blocked immediately:
    It's just a stupid program with a function that returns "ok".
    So what I did is the following:
    1)I created a class OkServer.java
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface OkServer extends Remote {
    public String getOk() throws RemoteException;
    2)I created a class OkServerImpl.java
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.RMISecurityManager;
    import java.rmi.RemoteException;
    import java.rmi.Naming;
    public class OkServerImpl extends UnicastRemoteObject implements OkServer {
    public OkServerImpl() throws RemoteException {
    public String getOk() {
         return "ok";
    public static void main (String args[]) throws Exception {
              System.setSecurityManager(new RMISecurityManager());
              OkServerImpl OkSvr = new OkServerImpl();
              Naming.bind("OkServer", OkSvr);
    3) I compiled everything with javac *.java
    i use java version below:
    java version "1.5.0_12"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
    Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode)
    4)I opened a cmd window and started the registry with the command c:\rmiregistr
    (a cursor starts blinking, so I think it runs correctly)
    5)then I start the program with the command: C:\java OkServerImpl
    but I get the error below !!
    C:\Temp\rmitester>java OkServerImpl
    Exception in thread "main" java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,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:1034)
    at java.net.Socket.connect(Socket.java:513)
    at java.net.Socket.connect(Socket.java:469)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:179)
    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.bind(Unknown Source)
    at java.rmi.Naming.bind(Naming.java:111)
    at OkServerImpl.main(OkServerImpl.java:18)
    What's wrong???

    solved, but i don't understand why i encountered this particular issue (that isn't mentioned to happen or to configure in my book):
    i had to create a custom policy file:
    make a file "c:\temp\rmitester\policy.all" and past the text below in it:
    grant {
    permission java.security.AllPermission "", "";
    thereafter launch the server with this command:
    c:\temp\rmitester\java -Djava.security.policy=policy.all OkServerImpl
    and the client with this command:
    c:\temp\rmitester\java -Djava.security.policy=policy.all OkClient localhost
    Can anyone explain if it was normal that i encountered this problem or was it seldom behaviour that happens only to me?

  • Help me prevent restarting my RMI server

    I choose the RMI framework because I thought that this would support dynamic loading of classes. Now I'm beginning to doubt this feature, hope someone can fill in the blanks for me.
    The clients are built using Java Web Start. I use RMI for authentication and transactions (application events, files, etc.). The interfaces I use in RMI are very loose, they take an Object as parameter and returns an Object. I wrote it that way because I didn't know what functionality I would need in the future.
    Main problem: Compatibility issues when I rewrite classes on the client side....:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.io.InvalidClassException: jflex.rmi.RMIPostEvents; local class incompatible: stream classdesc serialVersionUID = 7574722854925780076, local class serialVersionUID = 8717205828862885031
         at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    yadayadayadayada.....
    How can get the RMI server to reload the client classes when this exception occurs? If I have to restart the RMI server everytime I modify RMI classes on the client the RMI technique is useless to me.
    Thanks in advance.

    OK, now I understand, and this is an interesting problem.
    I would have expected RMI to have annotated all remotely loaded codebase namespaces with a session id, to prevent this type of thing from happening. Not good. Unfortunately this issue is in the 'deep-water' of RMI internal implementation. The only expert on this I know on this forum is ejp. If you're reading this Esmond, little help here, please!
    It would seem that you are forced to also change the name of the implementation class of the JFlexServerTask implementation, or derive from it, a bit of a hassle for sure. Does the server hold persistent references to the loaded tasks? If not, the classes might be unloaded when the DGC runs, but again I am not sure of this. Also, you can never be sure when DGC will run. Otherwise it seems like over the long term, the server runtime could get pretty congested with unused classes.
    I guess I have not run into this problem before since I generally I do not allow servers to accept code from clients. The reason being that if there is an error in the client implementation, it can easily crash the server, accidentally or intentionally. Authentication I generally handle by sending the client a random value, which it then hashes with its password. (SHA or MD5 are good) Your present scheme could be easily cracked, unless you are running RMI over SSL, since your authentication object would be sent in plaintext over the network.
    However, I am guessing you want to send batch jobs to a server, on a highly trusted network. I'm not sure how to resolve the problem, this stumps me, and I have been doing this for a long time :-)

Maybe you are looking for