RMI Server Object Pooling

Hello All,
Does WLServer6.1 take care of having a pool of RMI Server objects, similar
to the way EJB container does it for EJBs. I guess what I am trying to
achieve is an effect of Servlets that spawn light threads per invocation
though now using RMI Server Object. I did look at the "executeThreadPool"
options which would allow for increasing performance. I am not 100%
satisfied with it though. Is there any way I can do this. Thanks,
Chirag

"Pyung Yoon" <[email protected]> writes:
MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);This implies JRMP which the server does not support. You need to use t3 or iiop.
andy

Similar Messages

  • RMI server object lookup in a session bean

    Hi all,
    I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
    bean. Following is the code and exception. Please note that I am using java.rmi
    package instead of weblogic.rmi and that both the session bean and RMI server
    object (a startup class) is deployed on the same machine.
    Thanks for your help in advance.
    // a simple, replica-aware session bean method
    // some code here
    try {
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
    catch (Exception e) {
    // log the exception
    The exception:
    java.rmi.MarshalException: Error marshaling transport header; nested exception
    i
    s:
    java.io.EOFException
    java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:224)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
    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.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
    a:88)
    at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
    a:28)
    at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
    di8yo_EOImpl.java:46)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
    e)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
    ef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:762)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:295)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

    Hi Pyung,
    How about trying this instead:
    InitialContext ctx = new InitialContext();
    MediatorInterface mediator = (MediatorInterface) ctx.lookup("TestMediator");
    This assumes your startup class binds the Mediator to the JNDI name "TestMediator".
    - Matt
    Pyung Yoon wrote:
    Hi all,
    I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
    bean. Following is the code and exception. Please note that I am using java.rmi
    package instead of weblogic.rmi and that both the session bean and RMI server
    object (a startup class) is deployed on the same machine.
    Thanks for your help in advance.
    // a simple, replica-aware session bean method
    // some code here
    try {
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
    catch (Exception e) {
    // log the exception
    The exception:
    java.rmi.MarshalException: Error marshaling transport header; nested exception
    i
    s:
    java.io.EOFException
    java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:224)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
    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.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
    a:88)
    at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
    a:28)
    at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
    di8yo_EOImpl.java:46)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
    e)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
    ef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:762)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:295)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

  • RMI server object getting garbage collected

    Hi all,
    I have seen a number of posts regarding the ConnectException and found that this can occur in a number of situations.
    I am having a problem here.
    I am having an RMI server that is always up and running. And the server object gets requests from the client at regular intervals. But, when the server object is not receiving any requests for a long time (ex: 1 day), then I think the remote object itself is getting garbage collected. And so, tough I am able to get the remote reference using the lookup method, I am getting "Connection refused to host: 192.168.0.216; nested exception is:
         java.net.ConnectException: Connection refused" when I call a method using this reference.
    I believe that this is because the server object getting garbage collected as there are no requests for the server since long. Please correct me if my assumption is wrong.
    I want to know, after how much time the server object gets garbage collected if no requests are received. But, my requirement is that the server object should always be available and WHENEVER a client request comes then that should be processed. What should I do to accomplish this task.
    If any one have any suggestions, please reply as soon as possible.
    Thanks in advance,
    srik4u

    You might do some research into using an activatable remote object. You run rmid (the rmi activation deamon) and register a subclass of java.rmi.activation.Activatable (instead of the usual UnicastRemoteObject) with it. With an activatable object, the remote reference to the activatable object doesn't need to have a live object behind it. If an activatable object is not running (ie: it hasn't been constructed yet, or it has been garbage collected ...as in your case) a remote reference to the object can still be exported to a client. The first time the client calls a method on the remote object, the activation service on the server sees the object is not active, and activates the object for the client. If the object is running ...it is rmi as usual. But if it gets gc'd again, the next invocation on the remote object will trigger the activation service again.
    (The above explanation paraphrases author David Flanagan from Java Enterprise in a Nutshell, O'Reilly)
    I have only built one of these, which loosely followed an example from the above mentioned book. It's a whole other ballgame over and above a regular rmi object. But like anything else, if you dig in and get your head wrapped around it, it eventually makes sense. Ok, why lie ...it confused the hell out of me and left me a little queasy. But you know the drill, by the time you build a few of them it will probably seem as easy as mapping the human genome, right? At any rate, it seems like what you might be after ...so have a look at it. Good luck, and wear your lifejacket.

  • RMI Server Object Startup Error

    Greetings,
    I am trying to set up a computer lab at my college. I currently have one server running Slackware 9.1 and one client (my laptop) running Windows XP Home. I can telnet and ftp from my client. I can also access the Apache web server running on the Linux machine. I recently discovered RMI as a way to do distributed computing (we are trying to build a proof-of-concept distributed computing system). However, I cannot get RMI to work. When I take the code I wrote and use my laptop as both client and server, everything works. However, when I try to use both machines, it does not work. I want the Linux box to be the server and my laptop to be the client. After compiling my RMI server class (the class that registers the server object for use under RMI) and running it by typing java RemServer, I get a strange error (see bottom of this message). I cannot find this error anywhere else on the internet. I have the rmiregistry program running. I do everything the same as when I do RMI on just my laptop. Please help!
    RemServer Remote Exception: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.net.SocketException: Connection reset
    [Ljava.lang.StackTraceElement;@13d93f4
    Thanks,
    Jason

    One thing I did discover is that I have not been explicitly starting rmid. Some documentation says that rmi starts rmid automatically. If I need to start rmid, what parameters to I need to pass to it?
    Thanks,
    Jason

  • Regular RMI server object with WebLogic JNDI

    Is that possible to register a regular RMI object with WebLogic JNDI
    tree? I was building a simple program (using javac and rmic only) based
    on the java.rmi.* (without changing the import statements to
    weblogic.rmi.*) and using the weblogic.jndi to register the server
    object. Below is some piece of code,
    Context ctx = null;
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL, "t3://172.20.20.20:7001");
    ctx = new InitialContext(ht);
    ctx.bind("HelloServer", obj);
    The code failed for the following reason,
    javax.naming.NamingException. Root exception is
    java.rmi.MarshalException: failed to marshal public abstract void
    weblogic.jndi.internal.NamingNode.bind(java.lang.String,java.lang.Object,java.util.Hashtable)
    throws javax.naming.NamingException,java.rmi.RemoteException; nested
    exception is:
    java.rmi.server.ExportException: A description for
    examples.rmi.hello.HelloImpl was found but it could not be read due to:
    [Failed to find examples.rmi.hello.HelloImpl_WLStub or
    examples.rmi.hello.Hello_WLStub for class examples.rmi.hello.HelloImpl]
    java.rmi.StubNotFoundException: Failed to find
    examples.rmi.hello.HelloImpl_WLStub or examples.rmi.hello.Hello_WLStub
    for class examples.rmi.hello.HelloImpl
    at
    weblogic.rmi.internal.BasicDescriptor.<init>(BasicDescriptor.java:101)
    at
    weblogic.rmi.internal.BasicRuntimeDescriptor.<init>(BasicRuntimeDescriptor.java:50)
    at
    weblogic.rmi.internal.DescriptorManager.resolveClass(DescriptorManager.java:55)
    at
    weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:39)
    at
    weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:30)
    at
    weblogic.rmi.internal.OIDManager.getRequestDispatcher(OIDManager.java:281)
    at
    weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:270)
    at
    weblogic.rmi.internal.OIDManager.replaceObject(OIDManager.java:98)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:55)
    at
    weblogic.common.internal.ChunkedObjectOutputStream$NestedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:239)
    Any idea?
    - SteveC

    "Pyung Yoon" <[email protected]> writes:
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);This implies JRMP which the server does not support. You need to use t3 or iiop.
    andy

  • Stateful RMI server object

    How do I design and write stateful RMI client/server applications?
    I just find the examples on the Web that introduce RMI with some sample RMI client/server programs which are stateless, that means the RMI client and server do not maintain session information.
    I would like to design and write stateful client/server applications with RMI, i.e. a new instance of server object is invoked to handle a client Java applet connection session, and maintains state/session information such as security context in the server instance's local variables.
    Is that possible? Where can I find sample programs and design guidelines for this topic??

    I suggest that you approach this slightly differently.
    1. RMI generally gives access to a common server object, with each remote request being handled in a different thread. You can just as well have that common object do a lookup on a (synchronized) table of sessions. In other words, when a new client makes a request, look that client up, and if it is not in the table, then create a new session object and put it in the table. So now you have saved state.
    2. A variation on this: Make your common server object create a session object, and return a remote reference to the caller. All subsequent requests go to the individual session object. (The terminology hear is probably misleading; we have done such designs, and call the registered object an "entry", and the individual objects "servers".

  • XDK 9i Issues : setXSLT - NullPointerException And RMI Server hangs

    Present Scenario :
    JDK 1.3
    Oracle DB : 8.1.6
    JDBC Driver : OracleThin.jar
    XML Parser : xmlparserv2.jar : ( size = 1121488 )
    XML-SQL utility : xsu12.jar : ( size = 180522 )
    We use RMI with JDBC. RMI server object connects to database , uses xsu12.jar and xmlparserv2.jar to convert data into XML. Servlet connects to RMI server and gets this XML. Everything works fine.
    Problem Scenario :
    Since this parser does not support JAXP , I downloaded XDK 9i from oracle site.(9.2.0.1.0 - Dated 01/31/02 ) . After extracting , I replaced xmlparserv2.jar and xsu12.jar with this new ones. And problem started. There are 2 problems :
    A. setXSLT( String, String ) throws NullPointerExcpetion
    B. When I commented setXSLT method, RMI server completes execution of remote method which can be verified from Log. But it never returns , so client gets blocked. When RMI server is stopped by doing ctrl-C , client gets correct XML document.
    Then I installed latest JDBC2.0 driver for 8.1.6 from site which is classes.zip. This also resulted in to same problems mentioned above. But it did work fine wirh earlier version of xmlparserv2.jar and xsu12.jar. Just FYI : I noticed significant size difference betwenn new and old jars.
    New xmlparserv2.jar : size = 660421
    New xsu12.jar : size = 473249
    Thanks for patience
    What could be possible solution ?

    Thanks Jinu
    Problem A of setXSLT throwing NullPOinter Exception is solved. However problem B of RMI server not returning still there.
    Just as an FYI , following is system
    DB : oracle 8.1.6
    xmlparserv2.jar : 9i xdk
    xsu12_816.jar : 9i xdk
    classes12.zip : JDBC2.0 for 8.1.6
    When RMI server is stopped ( ctrl- C ) , client gets correct XML document alongwith proper Node names as set in setStyleSheet( String, String).

  • Lesson 8: RMI, Error in Run the RemoteServer Server Object

    Hello guys,
    Please Help!
    I try to test and run the samples in
    JavaTM Programming Language Basics, Part 1
    Lesson 8: Remote Method Invocation
    http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/rmi.html
    I already compiled the samples, but when I testing to run the RemoteServer Object it gives me error.
    Here's the following line command:
    java -Djava.rmi.server.codebase=file:
    g:\home\zelda\public_html\classes
    -djava.rmi.server.hostname=kq6py.eng.sun.com
    -Djava.security.policy=java.policy RemoteServer
    The ERROR:
    Exception in thread "main" java.security.AccessControlException: access denied (
    java.net.SocketPermission kq6py.eng.sun.com resolve)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkConnect(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.newCall(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Unknown Source)
    at RemoteServer.main(remoteserver.java:38)
    PLEASE HELP!!!
    Thanks in advance,
    Rodel

    Oooppssss, I got it.
    uh huh!!!!

  • Java.rmi.server.ExportException: object already exported

    I'm encountering an RMI error that I have never seen before. The exception is the following :
    <p><b>
    java.rmi.server.ExportException: object already exported
    </b>
    I am only invoking the UnicastRemoteObject.exportObject() method once. Any ideas on why this error is occurring? This one is about to drive me crazy.
    Thanks in advance!

    There is no need to exportObject() if your implementor extends the UnicastRemoteObject. In such a case it is automatically exported. However in the other case when not extending UnicastRemteObject it can be explicitly exported by exportObject methods.

  • Object passed to RMI Server

    Hello
    I have a function in the RMI client that passes an object to the RMI server. The server updates one of the members of this object.
    When I try to get this memebr from the client, I get 0.
    This is the Object code:
    public class Progress implements Serializable {
              private static final long     serialVersionUID     = 8168473416653301292L;
                        private int mProgress = 0;
        /** Creates a new instance of Progress */
        public Progress() {
        public int getProgress()
            return mProgress;
        public void setProgress(int progress)
                  System.out.println("progress = "+progress);
            mProgress = progress;
    }This is the function that passes the Object to the server:
              public RequestResult executeAdminAPI(int aDbTypeOrdinal, String aHost, int aPort, String aUser, String aPassword,
                                  String aInput, Progress progress) throws RMIClientException, SCException {
                        try {
                                  if (mServerInitialised)
                                            return mJNICommRMIServer.executeAdminAPIWrapper(aDbTypeOrdinal, aHost, aPort, aUser, aPassword, aInput, progress);
                                  else {
                                            synchronized (mServerInitializedMutex) {
                                                      return mJNICommRMIServer.executeAdminAPIWrapper(aDbTypeOrdinal, aHost, aPort, aUser, aPassword, aInput, progress);
                        catch (RemoteException e) {
                                  // We'll restart the server on JNIFatalException
                                  // means that we should kill the process and restart it
                                  // JNIFatalException means that the cpp code send an error code which
                                  // We don't restart the server on SocketTimeOut like the other functions,
                                  // because this function may take a long time to execute
                                  if (e.detail instanceof JNIFatalException) {
                                            restartServer("executeAdminAPI got an exception: " + e.detail.getMessage());
                                  if ((e.detail instanceof ConnectException)) // RMI-TODO check perhaps it
                                            // should be restartServer()
                                            startServer("executeAdminAPI got an exception: " + e.detail.getMessage());
                                  if (e.detail instanceof JNIException)
                                            throw new SCException(((JNIException) (e.detail)).getErrorCode(), ((JNIException) (e.detail)).getErrorMessage());
                                  else
                                            throw new RMIClientException(e);
              }The "setProgress" (called by the server) prints the correct numbers, but the "getProgress" (called by the client) returns 0.
    Can anyone explain please?
    Thanks,
    Libby

    Arguments are passed by value in RMI unless they are exported remote objects. So the update took place at the server only. If you want it reflected at the client, either (i) return the updated object as the result of the method, or (ii) make the updatable object an exported remote object, i.e. a callback. But note that (ii) doesn't play with firewals in place.

  • How to keep track of client in rmi server

    how can I keep track of a disconnected client in a rmi server ?
    And what logic do I use to disconnect a client fro mthe server ?

    When a RMI client receives a stub to the remote object, RMI client runtime sends a dirty() call to the RMI server runtime which in turn helps the RMI server runtime in updating the client references to the remote object. Client reference is nothing but a unique identification generated by client RMI runtime for that instance of JVM. RMI uses a reference counting algorithm for destroying unreferenced remote objects. Once all references (all clients who are holding the stub to this remote object) to a remote object drops to zero, local garbage collector takes care of freeing this remote object.
    RMI client runtime initiates a TCP connection with the remote object only when a method is invoked on the stub. RMI transport layer uses a simple connection pooling mechanism to use already established TCP connections with server objects in further remote method invocations. Let's say the client is invoking a remote method on the remote object's stub fetched from the registry service. Now RMI transport layer initiates a TCP connection with the remote object (exported at ("host1", 4567)). After completion of the remote method, RMI client's transport layer keeps the connection open for some time (some configurable value) to take the advantage of the already established TCP connection in future remote method invocations on remote objects exported on the same host and port ("Host1", 4567"). RMI transport layer also takes care of closing these connections if the connections are idle more than configured value of connection open time.
    From the RMI server's perspective, once the RMI server runtime receives a remote method invocation request from the RMI client, it creates a new thread and try to dispatch the method on the designated remote object. After returning the results of the remote method to the client, RMI client's transport layer may not end this conservation with this remote object to take the advantage of this TCP connection in future remote method invocations. So the same thread may be used for dispatching another remote method in future. This is actually the side effect of re-using the established TCP connections on the client side.
    RMI server maintains client's reference in the client's reference set of the remote object as long as the client holds a normal reference to remote object's stub in its JVM. Once the client relinquishes the reference to the stub (goes out of the scope or setting it to the null), RMI client automatically sends clean() call to the RMI server runtime to update client reference set of the remote object. There is no public API to lookup or manipulate the client references for a given remote object, but you can always unexport the remote object even some clients are holding stubs to the remote object. Next time when the client invokes the remote method using this stub, client will receive a "connection refused exception" from the server because the remote object is already unexported. Let's say if the RMI server is started again (remote object is exported and registered with registry service), the client once again obtains the stub to the remote object from the registry service instead of using earlier stale stub. (This time remote object may have been exported on different port, so the port details in the old stub may not be valid any more).
    At any point of time there can be more than one established TCP connection with the RMI client. This may be the temporary condition; RMI client's transport layer automatically closes these connections if it does not receive any remote method invocation requests with in a pre-determined interval of time (default: 2 min). You can always find out RMI client's host in a given remote invocation by using getClientHost(), but how can you semantically define a "disconnected client in a rmi server" in your application context ? You can always force all the clients to fetch the stub again in future remote method invocations by unexporting the remote object in RMI server. I hope this information helps ...
    -- Srinath Mandalapu

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

  • Not able to run a simple RMI server

    I am running an RMI program like follwing
    import java.rmi.* ;
    import java.rmi.registry.* ;
    import java.rmi.server.* ;
    public class CallBeanServer extends UnicastRemoteObject implements ICallBeanServer
         //main
         public static void main(String args[]) throws Exception
              int port = 1000 ;
              Registry reg = null ;
              if( args[0].equals("true"))
                   reg = LocateRegistry.createRegistry(port) ;
                   System.out.println("Successfully created registry") ;
              else
                   reg = LocateRegistry.getRegistry(port) ;
                   System.out.println("Connected to existing registry") ;
              CallBeanServer callBeanServer = new CallBeanServer(reg) ;
         }//main
         //constructor
         public CallBeanServer(Registry reg) throws Exception, RemoteException
              super() ;
              reg.rebind("CallBeanServer",this) ;
              System.out.println("CallBeanServer Object bound") ;
         //my public method
         public String callBeanServer() throws RemoteException
         {          return "Success" ;
    I have run the rmiregistry at port no 1000 like
    rmiregistry 1000
    I have compiled ICallBeanServer also and run rmic also over CallBeanServer like
    rmic CallBeanServer
    when I run this program using
    java CallBeanServer false
    it gives the follwoing errors
    Connected to existing registry
    Exception in thread "main" java.rmi.ServerException: Server RemoteException; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: CallBeanServer_Stub
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: CallBeanServer_Stub
    java.lang.ClassNotFoundException: CallBeanServer_Stub
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at CallBeanServer.<init>(CallBeanServer.java:38)
    at CallBeanServer.main(CallBeanServer.java:30)
    Can you please tell me what is the error?
    Thanks
    Prashant Gupta

    Add the classes (the stubs included) to the classpath when you start the registry.

  • Cannot add server to pool: OVMAPI_4004E, but hostname set to FQDN

    It's very simillar problem like thread "Cannot Add Server to Pool: OVMAPI_4010E Attempt to send command: dispatch..", but setting
    hostname with FQDN on Ora VM Manager and Ora VM Server, repairing all configuration files (using grep -R ...) and reboot OVM
    server and OVMM didn't brought any effect...
    Environment:
    Oracle VM Server version 3.2.2
    Build: 520
    Oracle VM Manager:
    Version: 3.2.2.520
    Build: 20130218_520
    Description:
    I have discovered and setup an OVM Server. Then I tried to create a new pool "ikr-pool". When I tried to attach discovered server ("srv01-xx.cssz.cz"),
    I got error attached bellow. After this actions svr01-xx stays incorrectly as "member of pool" in /etc/ovs-agent/db/server database, so I need on VM server
    to stop ovs-agent, remove file /etc/ovs-agent/db/server, start ovs-agent again, and then re-take ownership on VM server again. Then srv01-xx stays
    as "Unassigned server".
    Regards
    Vladislav Rames
    <-------------------------------------------------------------------------------------------------------------Begin of error message--------------------------------------------------------------------------->
    Job Construction Phase
    Job ID: 1364477027337
    begin()
    Appended operation 'Server Join Server Pool' to object '31:33:37:35:32:32:5a:43:32:32:35:30:30:57:44:46 (srv01-xx.cssz.cz)'.
    Appended operation 'Server Pool Construct' to object '0004fb0000020000d0b83b23645cbca2 (ikr-pool)'.
    Appended operation 'Server Pool Virtual IP Configure' to object '0004fb0000020000d0b83b23645cbca2 (ikr-pool)'.
    Appended operation 'Server Pool Member Update' to object '0004fb0000020000d0b83b23645cbca2 (ikr-pool)'.
    Appended operation 'Server Cluster Configure' to object '31:33:37:35:32:32:5a:43:32:32:35:30:30:57:44:46 (srv01-xx.cssz.cz)'.
    Appended operation 'Server Cluster Construct' to object '31:33:37:35:32:32:5a:43:32:32:35:30:30:57:44:46 (srv01-xx.cssz.cz)'.
    commit()
    Completed Step: COMMIT
    Objects and Operations
    Object (IN_USE): [Cluster] d0b83b23645cbca2
    Object (IN_USE): [Server] 31:33:37:35:32:32:5a:43:32:32:35:30:30:57:44:46 (srv01-xx.cssz.cz)
    Operation: Server Join Server Pool
    Operation: Server Cluster Configure
    Operation: Server Cluster Construct
    Object (IN_USE): [ServerPool] 0004fb0000020000d0b83b23645cbca2 (ikr-pool)
    Operation: Server Pool Construct
    Operation: Server Pool Virtual IP Configure
    Operation: Server Pool Member Update
    Job Running Phase at 2013-03-28 14:23:47,337
    Job Participants: []
    Actioner
    14:23:47,909: Starting operation 'Server Join Server Pool' on object '31:33:37:35:32:32:5a:43:32:32:35:30:30:57:44:46 (srv01-xx.cssz.cz)'
    14:23:47,914: Completed operation 'Server Join Server Pool' with direction ==> LATER
    14:23:47,920: Starting operation 'Server Pool Construct' on object '0004fb0000020000d0b83b23645cbca2 (ikr-pool)'
    14:23:47,971: Completed operation 'Server Pool Construct' with direction ==> DONE
    14:23:47,977: Starting operation 'Server Pool Virtual IP Configure' on object '0004fb0000020000d0b83b23645cbca2 (ikr-pool)'
    14:23:53,221: Completed operation 'Server Pool Virtual IP Configure' with direction ==> DONE
    14:23:53,232: Starting operation 'Server Pool Member Update' on object '0004fb0000020000d0b83b23645cbca2 (ikr-pool)'
    Job Internal Error (Operation)com.oracle.ovm.mgr.api.exception.FailedOperationException: OVMAPI_4010E Attempt to send command: dispatch to server: srv01-xx.cssz.cz failed. OVMAPI_4004E Server Failed Command: dispatch https://?uname?:[email protected]:8899/api/3 set_pool_member_ip_list [10.20.11.11], Status: org.apache.xmlrpc.XmlRpcException: I/O error while communicating with HTTP server: Connection timed out [Thu Mar 28 14:36:30 CET 2013] [Thu Mar 28 14:36:30 CET 2013]
    at com.oracle.ovm.mgr.action.ActionEngine.sendCommandToServer(ActionEngine.java:512)
    at com.oracle.ovm.mgr.action.ActionEngine.sendDispatchedServerCommand(ActionEngine.java:449)
    at com.oracle.ovm.mgr.action.ActionEngine.sendServerCommand(ActionEngine.java:383)
    at com.oracle.ovm.mgr.action.ServerPoolAction.setServerPoolMembers(ServerPoolAction.java:138)
    at com.oracle.ovm.mgr.op.virtual.ServerPoolMemberUpdate.updateMemberList(ServerPoolMemberUpdate.java:363)
    at com.oracle.ovm.mgr.op.virtual.ServerPoolMemberUpdate.action(ServerPoolMemberUpdate.java:138)
    at com.oracle.ovm.mgr.api.collectable.ManagedObjectDbImpl.executeCurrentJobOperationAction(ManagedObjectDbImpl.java:1156)
    at com.oracle.odof.core.AbstractVessel.invokeMethod(AbstractVessel.java:356)
    at com.oracle.odof.core.AbstractVessel.invokeMethod(AbstractVessel.java:333)
    at com.oracle.odof.core.storage.Transaction.invokeMethod(Transaction.java:865)
    at com.oracle.odof.core.Exchange.invokeMethod(Exchange.java:244)
    at com.oracle.ovm.mgr.api.virtual.ServerPoolProxy.executeCurrentJobOperationAction(Unknown Source)
    at com.oracle.ovm.mgr.api.job.JobEngine.operationActioner(JobEngine.java:230)
    at com.oracle.ovm.mgr.api.job.JobEngine.operationActioner(JobEngine.java:264)
    at com.oracle.ovm.mgr.api.job.JobEngine.operationActioner(JobEngine.java:264)
    at com.oracle.ovm.mgr.api.job.JobEngine.objectActioner(JobEngine.java:322)
    at com.oracle.ovm.mgr.api.job.InternalJobDbImpl.objectCommitter(InternalJobDbImpl.java:1340)
    at com.oracle.odof.core.AbstractVessel.invokeMethod(AbstractVessel.java:356)
    at com.oracle.odof.core.AbstractVessel.invokeMethod(AbstractVessel.java:333)
    at com.oracle.odof.core.BasicWork.invokeMethod(BasicWork.java:106)
    at com.oracle.odof.command.InvokeMethodCommand.process(InvokeMethodCommand.java:92)
    at com.oracle.odof.core.BasicWork.processCommand(BasicWork.java:81)
    at com.oracle.odof.core.TransactionManager.processCommand(TransactionManager.java:752)
    at com.oracle.odof.core.WorkflowManager.processCommand(WorkflowManager.java:467)
    at com.oracle.odof.core.WorkflowManager.processWork(WorkflowManager.java:525)
    at com.oracle.odof.io.AbstractClient.run(AbstractClient.java:42)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: com.oracle.ovm.mgr.api.exception.IllegalOperationException: OVMAPI_4004E Server Failed Command: dispatch https://?uname?:[email protected]:8899/api/3 set_pool_member_ip_list [10.20.11.11], Status: org.apache.xmlrpc.XmlRpcException: I/O error while communicating with HTTP server: Connection timed out [Thu Mar 28 14:36:30 CET 2013]
    at com.oracle.ovm.mgr.action.ActionEngine.sendAction(ActionEngine.java:803)
    at com.oracle.ovm.mgr.action.ActionEngine.sendCommandToServer(ActionEngine.java:508)
    ... 34 more
    FailedOperationCleanup
    Starting failed operation 'Server Pool Member Update' cleanup on object 'ikr-pool'
    Complete rollback operation 'Server Pool Member Update' cleanup on object 'ikr-pool'
    Rollbacker
    14:36:31,156: Starting rollbacker...
    Executing rollback operation 'Server Pool Member Update' on object '0004fb0000020000d0b83b23645cbca2 (ikr-pool)'
    <-------------------------------------------------------------------------------------------------------------End of error message----------------------------------------------------------------------------->

    Solved. Problem was the same like in thread "I/O error while communicating with HTTP server: Connection timed out" - it wasn't accessible IP connection between Ora VM Manager and Ora VM server IP alias for server pool. But there was very confusing message in errorlog: "dispatch https://?uname?:[email protected]:8899/api/3 set_pool_member_ip_list [10.20.11.11], Status: org.apache.xmlrpc.XmlRpcException: I/O error while communicating with HTTP server: Connection timed out [Thu Mar 28 14:36:30 CET 2013]". Noticed IP address was IP address for VM server, not for VM pool, which makes me quite angry.
    Best Regards
    Vladislav Rames

  • Help needed to move a java.rmi.Remote object.....

    Hi,
    I have an object extending java.rmi.Remote on a server. I want to get it onto a client (ie the actual object, not a reference to the object on the server).
    The catch (isn't there always one):
    The client must only get class definitions/interface definitions from the java.rmi.server.codebase
    (ie I don't want to use a network classloader).
    Anyone any ideas?
    Kev.

    If you have a class that implements java.rmi.Remote then the objects of that class by definition are available for Remote access (ie, they are passed by reference). Remote objects can't be passed by value. However, if you want objects of a particular class to be passed by value you could have the class implement java.io.Serializable instead of java.rmi.Remote.
    Hope this helps.

Maybe you are looking for