RMI Server on MultiHome machine

Dear all,
I have a machine with two network interfaces (two IP addresses) , one IP address is "192.168.69.1" other is "192.168.70.1"(hostname is bind to this IP) , I am invoking this server's methods remotly using Client application that is running on "192.168.69.14", from the client machine only "192.168.69.1" is accessible and i have no access to IP "192.168.70.1".
When i start rmi registry via rmiregistry command without giving any port number then program works fine.
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class Server implements Hello {
    public Server() {}
    public String sayHello() {
        return "Hello, world!";
    public static void main(String args[]) {
        try {
             //RMI hostname
          System.setProperty("java.rmi.server.hostname", "192.168.69.1");
             Server obj = new Server();
             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();
}Client.java
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class Client {
    private Client() {}
    public static void main(String[] args) {
        String host = (args.length < 1) ? null : args[0];
        try {
            Registry registry = LocateRegistry.getRegistry(host);
            Hello stub = (Hello) registry.lookup("Hello");
            String response = stub.sayHello();
            System.out.println("response: " + response);
        } catch (Exception e) {
            System.err.println("Client exception: " + e.toString());
            e.printStackTrace();
}Whenever i start rmiregistry on some specified port e.g. rmiregistry 6655 , and uses the server version that access the rmiregistry from specified port like blow
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class Server implements Hello {
    public Server() {}
    public String sayHello() {
        return "Hello, world!";
    public static void main(String args[]) {
        try {
             //RMI hostname
          System.setProperty("java.rmi.server.hostname", "192.168.69.1");
             Server obj = new Server();
             Hello stub = (Hello) UnicastRemoteObject.exportObject(obj,0);
             //Bind the remote object's stub in the registry
             Registry registry = LocateRegistry.getRegistry(6655);
             registry.bind("Hello", stub);
             System.err.println("Server ready");
         } catch (Exception e) {
             System.err.println("Server exception: " + e.toString());
             e.printStackTrace();
}My Client application is unable to invoke remote Object
I got following exception
$ java Client 192.168.69.1
Client exception: java.rmi.ConnectException: Connection refused to host: 192.168.69.1; nested exception is:
        java.net.ConnectException: Connection refused
java.rmi.ConnectException: Connection refused to host: 192.168.69.1; nested exception is:
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at Client.main(Client.java:15)
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:516)
        at java.net.Socket.connect(Socket.java:466)
        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)
        ... 5 moreKindly someone have idea to solve the problem ?
Thanks

did you try starting your rmiregistry with "-J-Djava.rmi.server.hostname=192.168.69.1" ?

Similar Messages

  • What can't client connect to RMI server on same machine?

    I'm trying to get a client to connect to an RMI server that resides on the same machine, but it's not working. When run, I get the following exception:
    java.rmi.ConnectException: Connection refused to host: 121.0.0.55; nested exception is:
    java.net.ConnectException: Connection refused
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
    at java.net.Socket.<init>(Socket.java:273)
    at java.net.Socket.<init>(Socket.java:100)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
    The machine in question is a Solaris 8 system running Java 1.3. I've checked all the networking permissions, and they seem to be ok. Any ideas as to what might be causing this?

    Thanks for the reply! Dumb question: How do I start the registry? I see debugging code that indicates that the server is [probably] being started.
    Usually this means that the registry isn't running or
    the server isn't running.

  • Start managed server in multihomed machine with cluster?

    Hi,
              I have problems with starting a remote managed server.
              I have a cluster configured with 2 managed servers in the same machine. I added a new managed server but assigned to other machine.
              MachineA:
              -AdminServer:7001,
              -ManagedServerA1: 7004, ManagedServerA2:7006
              -Cluster
              MachineB:
              -ManagedServerB: 7003
              I tried to start ManagedServerB in Machine A but I have got this error:
              startManagedWeblogic.cmd ManagedServerB http://MachineA:7001
              <Error> <Server> <BEA-002606> <Unable to create a server socket for listening on channel "Default". The address “IP of MachineB that I am using” might be incorrect or another process is using port 7003: java.net.BindException: Cannot assign requested address: JVM_Bind.>
              <Emergency> <Security> <BEA-090087> <Server failed to bind to the configured Admin port. The port may already be used by another process.>
              But the port is not used by any other process or server.
              Other question: is it necessary to start all managed servers, local and remote in the server where my application is deployed?
              Is it the correct way for using a cluster in multihomed machine?
              Is there any documentation for configuring a cluster specifically for this case?
              By the way, I am using Weblogic 91.
              Regards,
              Hicyo

    Hi,
              I am also having the same problem below.Can someone suggest a solution to my problem?
              I have a cluster configured with 2 managed servers in the same machine. I added a new managed server but assigned to other machine.
              MachineA:
              -AdminServer:7001,
              -ManagedServerA1: 7004, ManagedServerA2:7006
              -Cluster
              MachineB:
              -ManagedServerB: 7003
              I tried to start ManagedServerB in Machine A but I have got this error:
              startManagedWeblogic.cmd ManagedServerB http://MachineA:7001
              <Error> <Server> <BEA-002606> <Unable to create a server socket for listening on channel "Default". The address “IP of MachineB that I am using” might be incorrect or another process is using port 7003: java.net.BindException: Cannot assign requested address: JVM_Bind.>
              <Emergency> <Security> <BEA-090087> <Server failed to bind to the configured Admin port. The port may already be used by another process.>
              But the port is not used by any other process or server.

  • Host name clashes while ping the rmi server

    i am having rmi server in the machine which is connected to internet.
    the machine name is "bugs".while calling remote method thru rmi client
    it tries to ping some other machine in the internet which has same name of rmi server.
    my rmi url "rmi://hostname:port/<service_name>
    how can i give unique machine name or ip address while rmi server is connected to internet.
    for this scenario which is best ip address or machine name

    Talk to the people who run your network. Sounds like you have a DNS problem. (Not a Java problem.)

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

  • RMI Server Offline Problem

    Hello all, I am e newbie in the world of RMI programming. I have developed an application that can control two devices over the internet. The code files are given below :
    Parallel.java
    import java.rmi.*;
    public interface Parallel extends Remote
         void relayDriver(byte k) throws RemoteException;
         byte currentStatus() throws RemoteException;
    ParallelImpl.java
    import parport.ParallelPort;
    import java.rmi.*;
    import java.rmi.server.*;
    public class ParallelImpl extends UnicastRemoteObject implements Parallel
         private Byte ctrlValue;
         ParallelPort lpt1 = new ParallelPort(0x378); // 0x378 is normally the base address for the LPT1 port
         public ParallelImpl(byte a) throws RemoteException
              ctrlValue = a;
              lpt1.write(ctrlValue);
              System.out.println("Device Actuation Code "+ctrlValue);
         public void relayDriver(byte k) throws RemoteException
              ctrlValue = k;
              System.out.println("Device Actuation Code "+ctrlValue);
              lpt1.write(ctrlValue);
         public byte currentStatus() throws RemoteException
    return ctrlValue;
    ParallelClient.Java
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ParallelClient extends JApplet implements ActionListener
         Byte g;
         String url = "rmi://169.254.196.149/";
         private Container container;
         private javax.swing.JTextArea resultArea;
         public void init()
              container = getContentPane();
              container.setLayout( new BorderLayout() );
              resultArea = new javax.swing.JTextArea();
              JRadioButton buttonZero = new JRadioButton("No Device
    On");
         buttonZero.setMnemonic(KeyEvent.VK_A);
         buttonZero.setActionCommand("0");
         buttonZero.setSelected(true);
         JRadioButton buttonOne = new JRadioButton("Device 1 On
    Only");
         buttonOne.setMnemonic(KeyEvent.VK_B);
         buttonOne.setActionCommand("1");
         JRadioButton buttonTwo = new JRadioButton("Device 2 On
    Only");
         buttonTwo.setMnemonic(KeyEvent.VK_C);
         buttonTwo.setActionCommand("2");
         JRadioButton buttonThree = new JRadioButton("Device 1
    and 2 Both On");
         buttonThree.setMnemonic(KeyEvent.VK_D);
         buttonThree.setActionCommand("3");
         //Group the radio buttons.
         ButtonGroup group = new ButtonGroup();
         group.add(buttonZero);
         group.add(buttonOne);
         group.add(buttonTwo);
         group.add(buttonThree);
         //Register a listener for the radio buttons.
         buttonZero.addActionListener(this);
         buttonOne.addActionListener(this);
         buttonTwo.addActionListener(this);
         buttonThree.addActionListener(this);
              JPanel radioPanel = new JPanel(new GridLayout(0, 1));
         radioPanel.add(buttonZero);
         radioPanel.add(buttonOne);
         radioPanel.add(buttonTwo);
         radioPanel.add(buttonThree);
         container.add(radioPanel, BorderLayout.LINE_START);
              container.add(resultArea, BorderLayout.SOUTH);
         public void actionPerformed(ActionEvent e)
              try
                   Parallel r1 = (Parallel)Naming.lookup(url +
    "inival");
                   if(r1.currentStatus()==0)
                             resultArea.setText("Previous
    Status: No Devices Online....");
                        else if(r1.currentStatus()==1)
                             resultArea.setText("Previous
    Status: Device 1 Online. Device 2 Offline.");
                        else if(r1.currentStatus()==2)
                             resultArea.setText("Previous
    Status: Device 2 Online. Device 1 Offline.");
                        else
                             resultArea.setText("Previous
    Status: Device 1 & 2 both are Online.");
                   g = Byte.parseByte(e.getActionCommand());
                   r1.relayDriver(g);
                   if(r1.currentStatus()==0)
                             resultArea.setText("Current
    Status: No Devices Online....");
                        else if(r1.currentStatus()==1)
                             resultArea.setText("Current
    Status: Device 1 Online. Device 2 Offline.");
                        else if(r1.currentStatus()==2)
                             resultArea.setText("Current
    Status: Device 2 Online. Device 1 Offline.");
                        else
                             resultArea.setText("Current
    Status: Device 1 & 2 both are Online.");
              catch(Exception et)
                   resultArea.setText("Server OffLine");
    ParallelServer.java
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    public class ParallelServer
         public static void main(String args[])
              try
                   System.out.println("Constructing Server Implementations ....");
                   ParallelImpl p1 = new ParallelImpl((byte)0);
                   System.out.println("Binding Server Implementation to registry ....");
                   Naming.rebind("inival",p1);
                   System.out.println("Waiting for invocations from Client ....");     
              catch(Exception e)
                   System.out.println("Server is Offline or Line has broken. Error : "+ e);
    The corresponding stub files, class files have been loaded on the internet. http://rcviproject.110mb.com/
    On the server machine the rmi registry is on and the ParallelServer program is also running. But when the applet at the URL is actuated then it shows 'server offline'. Why is this happening? Please help.

    That did not print anything. The server when started by the following commands :
    start rmiregistry
    start java ParallelServer
    continues to run at Waiting for invocation from client ...... no error msg is shown.
    do i need tomcat on the server machine in addition to this ?

  • 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 appears to deadlock but is fine after...

    I have a RMI server that is providing services to clients on my network.
    When I run tests from the clients (an app that constatnly makes demanding method calls to the RMI server) everything runs fine.
    I have one Windows 2000 client and one Slackware Linux 10.1 client, everyone has the same version JVM. They both run the "stress test" at the same time. The Server is a Windows XP MCE on a dual core Processor, the OS has been configured to run both processors.
    Both clients run for hours (all day) and so does the server without problem. Except sometimes I come back and it looks as though my clients are expererinceing some type of deadlock and when I check the server it is sitting there not doing anything as if everything is deadlocked.
    Now the magic, at the server console I smack a few keys on the keyborad and everything jumps back into business humming along just fine.
    What the heck? I have had this happen more than once. My apps have no input facilities whatsoever except CTRL+C which I use to kill them when I'm done with my "stress test".
    I have noticed Windows clients can kinda drag everyone else down because of the way it schedules threads.
    Any ideas?
    Sean

    Sometimes thread prioroties can be used effectivly on
    Windows if you are having problems with your WINDOWS
    machines handling the threads "properly". But not
    much use really.
    For testing? OK.
    I have been developing and testing parallel threaded
    applcations and it would not be possible without a
    dual-processor machine (properly configured).
    Number of processors is irrelevant. Why do you think this makes any difference at all?
    You cannot test threaded applications on a single
    processor. Single processor runs ONE thread at a
    time. Dual-Core or dual processors can run THREADS
    in parallel. I've seen it work, beautifully. your
    threaded app may run fine on one processor BUT if you
    run it on a dual machine it may break. In computer
    science parallel computing has been around for a long
    time but the majority of people (programmers) have no
    idea about it whatsoever and there is a lot of
    misconceptions.
    I happen to have a Masters in distributed computing. I quite enjoy it. And I still insist that a dual core system is not going to do anything to your threads that a single core system won't do to your threads.
    I challenge you to write a program that can tell the number of processors present, without checking the system property. If the OS is properly written and the chipset is working as it should, your program can not tell.
    One thing I see repeated is that dual-core machines
    have liitle impact on performance because most
    applications have only a single thread. Horse
    feathers!!! Windows and any other OS is going to run
    applications in parallel!! I have noticed a nice
    improvemnet in basic operations on a dual-core
    (properly configured).
    applications don't run in parallel, threads do. adding a 2nd core may make your computer more responsive if the OS preemptive scheduler is poorly written. Otherwise its no different than adding a faster CPU.
    This is a wonderful subject (Parallel Computing, the
    new PC)and I'm hooked (bad) mainly because this area
    is almost unexplored by the masses and there is a lot
    of work (read innovation) that needs done in the next
    decade on the software end. If you like serious PC
    check out Solaris (awsome).I love it. I was working on parallel code in Linux several years back while in school. Its not unexplored really. Search for distributed computing and you will find lots of info. The thing that is new is the attempt to take advantage automagically of multi cpu by programs that were not written to take advantage.
    >
    P.S. My dual-core 1gig SATA (XPS) Dell machine just
    caught up with my PIII single CPU 512mb SCSI U-160
    (500sc)machine in total throughput. seat-of-pants
    All this swapping has to go.
    Sean
    Message was edited by:
    DataVirtueMy last dual cpu machine was a abit BP6 dual celeron. Its a nice novelty, but buying dual/cpu dual core makes no sense unless the fastest single CPU is not fast enough or the price is right. Dual-cores has come about because the CPU folks are having difficulty making the single CPUs faster. Its a cop-out really. Instead of advancing technology, they add a 2nd CPU and try to act like they did something.
    Anyone that chooses a dual-core CPU over a twice as fast single core CPU either does not understand distributed computing, or enjoys the novelty.

  • RMI server fails on a few PCs, works on others

    I have a small RMI server, started on various PC, to which a UNIX server connects to send them messages.
    On each PC I have :
    - An RMI registry.
    - A Java RMI server, ready to receive messages from the UNIX machine.
    All the PC are running Win NT 4 SP6, and the JRE 1.3.1.
    On some PC, when the RMI server receives a RMI call from the UNIX machine, I get this error on the UNIX side :
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.io.InvalidClassException: pop2PcServer_Stub; Local class not compat
    ible: stream classdesc serialVersionUID=2 local class serialVersionUID=385818717
    3882730883
    at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:107)
    at java.rmi.Naming.lookup(Naming.java:60)
    at pop2Pc.main(pop2Pc.java:41)
    It happens every time when these specific PCs are involved.
    I tried everything : the programs don't use a security manager, the PC part starts the registry itself (instead of relying on a separate rmiregistry process). Whatever I do. I can't make the RMI process work correctly on these PC.
    I really don'ty understand, because my program is identical in every case.

    Unfortunately, this is already the case. The classe have been all compiled on the Unix server, and every time they are all bundled in a jar file which is on every PC the same.
    On all the PC I also bundle the JRE 1.3.1 in a subdirectory of my program. With the PATH and CLASSPATH variables I directly point to it, as well as to the jar file.

  • 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

  • Bug with RMI server under Unix

    I have a server/client apps, and it work under Windows but not under Unix.
    With Unix i have an exception :
    java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
    java.net.ConnectException: Connection refused
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:20)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:115)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:78)
    at ServeurChatImpl_Stub.connect(Unknown Source)
    at ClientDistantImpl.main(ClientDistantImpl.java:85)
    Why?

    Your question is very vague. Are you running the client and the server on the same machine or not at least it seems so. Are you using UnicastRemoteObject, RemoteObject or Activatable for extension. Also post some of your code and settings only then would somebody be able to help u.

  • 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

  • RMI server double identity

    I have 2 PC in a small LAN, both with Windows XP professional.
    The machine acting as server has 2 IP adresses: the first one, static, from a permanent ADSL connection (213.155...), the second one from the LAN ethernet connection (192.168.0.1).
    The machine acting as client is a notebook, which sometimes is linked to the LAN with an ethernet connection, and sometimes is directly connected to the WAN by modem connection.
    Well, in the first case (LAN) RMI dialog works fine.
    But in the second case (direct modem connection to WAN), things don't work.
    RMI client tries to contatct the server using it's WAN IP addess (213.155..), and after a while it gets a time-out exception for connection to node 192.168.0.1 (i.e. the LAN server IP address, currently unused).
    Why does the RMI server, receiving a connection request on it's WAN address, try to assume the alternate LAN identity ?

    I've found the solution.
    The problem can be avoided inserting in the server application a statement like this:
    System.setProperty("java.rmi.server.hostname", <WAN IP address>);
    before binding the Implementation class in registry.
    Hope this will help somebody.
    Luigi Fonti

  • RMI SERVER behind the router....!!!!!!!!!!!!

    Hi I am new here...And Have a problem regarding to java RMI...
    I have a uni assignment which asks us to write an online tic tac toe game using RMI..well assigment only request if it can be run on the same machine and I finished..
    But now I am trying to config it to real life with internet instead of LAN.
    Basically I have one static IP assigned by my ISP... and I have local IP addresses on my machines. The addresses will be translated by my router to the public one...
    My server is running on port 8081 of my server computer with an local IP addresses... and I did port forwarding in my router to forward all the 8081 request to this server...
    And the the client use the public IP to locate my server they can acctually connect to my server and get the stub or ref to it...But when they acctually trying to call a method on
    the server side, I realised they actually using the local IP addresses of my server machine instead of the public one..so i think the stub acctually bind the machine IP and ask client to use this IP to communicate.
    This obviously not going to work...And In the API it seems like I can not acctually do anything about IP address when create the Registry..
    Any clue on this Thank you.......

    No, the stub consists of a single Java object which contains the IP address and port number of the host from which the remote object was exported. The client knows the initial lookup address for the Registry but it performs all subsequent communications via the information embedded in the stub.
    @OP: you need to export your remote object on a fixed port, have the router forward that port, and set the system property java.rmi.server.hostname in the server JVM to the external IP address of the router.

  • J2EE problem while accessing RMI server

    Hi,
    I have a J2EE application in Oracle 9iAS server, I have created an application which access a RMI Server runs in a different PC, it works fine in my /dev site, I moved the same files to /test site (Same machine but different context), which also access the same RMI Server, now my application throws the following error in /test site where as it is working perfectly in /dev site.
    If you have any idea on this please let me know. Thanks in advance.
    Regards,
    Venkat
    ----------- Exception throws in server --------------------
    500 Internal Server Error
    java.lang.ClassFormatError: com/sgsap/feed/server/IFeed (Extra bytes at the end of the class file)     at java.lang.ClassLoader.defineClass0(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:493)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].naming.ContextClassLoader.findClass(ContextClassLoader.java:250)     at java.lang.ClassLoader.loadClass(ClassLoader.java:299)     at java.lang.ClassLoader.loadClass(ClassLoader.java:255)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)     at java.lang.ClassLoader.defineClass0(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:493)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].naming.ContextClassLoader.findClass(ContextClassLoader.java:250)     at java.lang.ClassLoader.loadClass(ClassLoader.java:299)     at java.lang.ClassLoader.loadClass(ClassLoader.java:255)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:195)     at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:654)     at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:121)     at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:918)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)     at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)     at java.rmi.Naming.lookup(Naming.java:84)     at com.sgsap.feed.client.FeedClient.getData(FeedClient.java:99)     at ReportManager.updatePostTradeFeedServerValues(ReportManager.java:998)     at ReportManager.updatePostTradeFeedValues(ReportManager.java:961)     at ReportManager.getPostTradeData(ReportManager.java:1449)     at /html/Trade/PostTradeReportExcel.jsp._jspService(/html/Trade/PostTradeReportExcel.jsp.java:84) (JSP page line 44)     at com.orionserver[Oracle9iAS (1.0.2.2) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpApplication.serviceJSP(HttpApplication.java:5458)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.JSPServlet.service(JSPServlet.java:31)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:501)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:170)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:576)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:62)

    Looks like ClassLoader tries to load different class. Check your classpath, check where are classes com/sgsap/feed/server/IFeed and if there are more than one such class, check why if your app is in /dev it is loading different class than when it is in /test.
    Other solution could be that something gone wrong while compilation. Are you sure you was not recompiling any code between testing it on /dev and on /test?
    I do not know, I am just trying to give some clues.
    Regards
    Pawel

Maybe you are looking for

  • How can I get my non purchased song content from ipod touch 4 back to my itunes library. My library

    How can I get my non purchased song content back into my itunes library from my ipod touch 4. My itunes had disappeared so I had to get another itunes & start again. I still have the original song content in the ipod.

  • Help with Album Artwork nightmare?

    I don't know how a device that has been around for 10 years still has such unbelievable problems simply maintaining and transferring songs. I recently synched my iPhone 4S with a new MacBook Pro. So, of course, it wiped out mostly everything that was

  • Edit Locally

    Please tell me What is the difference between Edit Locally and Edit Online ? Thanks, Kavya

  • Correct answer? (SQL)

    I am reading the following question from a book. If we are required to construct an equi join of 30 tables, how many join conditions will be required? a. 30 b. 20 c. 29 d. The number cannot be determined I wonder what is the correct answer to the fol

  • Livecycle ES 8.2 installation help

    Hi, I am trying to install LivecycleES 8.2 on Windows vista HomePremium 64-bit,4gb RAM downloaded from Adobe website. JBoss Application Server 4.0.3SP1 MySQL Database 5.0.18 MySQL JDBC driver 3.1.2 java_ee_sdk-5_01-windows I ran through the Turnkey i