users@glassfish.java.net

Re: gf-client ignoring my -Dorg.omg.CORBA.ORBInitialHost ...

From: <forums_at_java.net>
Date: Mon, 16 May 2011 10:32:22 -0500 (CDT)

Hi,

thank you both for the reply.

Here is the command line used to run:

java -Dorg.omg.CORBA.ORBInitialHost=10.100.0.8 -cp
"TestJavaApplication.jar;C:\software\glassfish3\glassfish\lib\gf-client.jar"
com.mycompany.jee.client.TestJavaApplication

The bean is defined as follows:

package com.mycompany.jee.ejb;
import javax.ejb.Singleton;
@Singleton
public class CalculateBean implements CalculateBeanRemote {
    @Override
    public int multiply(int x, int y) {
        return x*y;
    }
}

The Client:

        Context context = new InitialContext();
        System.out.println(context.getEnvironment());
        CalculateBeanRemote calculator = (CalculateBeanRemote)
               
context.lookup("java:global/TestEjbWebApplication/CalculateBean!com.mycompany.jee.ejb.CalculateBeanRemote");
        System.out.println("x*y=" + calculator.multiply(3, 4));

The strange thing is that it is working when the server in localhost is
started, although I add the -Dorg.omg.CORBA.ORBInitialHost

Does it fallback to localhost if it can't contact the other server?


--
[Message sent by forum member 'MohamzJava']
View Post: http://forums.java.net/node/802611