users@glassfish.java.net

Problem call EJB on remote glassfish from standalone java application

From: <glassfish_at_javadesktop.org>
Date: Wed, 21 Jul 2010 23:03:51 PDT

Hi all.
I've use glassfish v3.0.1 and deploy simple example:
Remote interface
package ddd;
 
import javax.ejb.Remote;
 
@Remote
public interface MishaRemote {
 
    String test();
    
}


Bean class
package ddd;
 
import javax.ejb.Stateless;
 
@Stateless(mappedName="Misha")
public class Misha implements MishaRemote {
 
    public String test() {
 
        return "Hello!!!";
        
    }
    
}

They are packed in EJBModule1.jar and successfully deployed.


Standalone application
package javaapplication8;
 
import ddd.MishaRemote;
import javax.naming.InitialContext;
import javax.naming.NamingException;
 
public class Main {
 
    public static void main(String[] args) throws NamingException {
 
        MishaRemote m = (MishaRemote) new InitialContext().lookup("Misha");
 
        System.out.println(m.test());
 
    }
    
}

Running command line
java -classpath /opt/sun/glassfishv3/glassfish/modules/gf-client.jar:./:./EJBModule1.jar -Dorg.omg.CORBA.ORBInitialHost=127.0.0.1 javaapplication8.Main


I've read https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#Step_3._Include_appserv-rt.jar_and and all works fine onto one machine.

But if i try to run this from remote(windows xp machine)
java -classpath /opt/sun/glassfishv3/glassfish/modules/gf-client.jar:./:./EJBModule1.jar -Dorg.omg.CORBA.ORBInitialHost=10.0.0.100 javaapplication8.Main


I see slooow timeout and trying to connect to localhost round-robin ports 3700, 3820, 3920
netstat -na
...
 TCP 127.0.0.1:4188 127.0.0.1:3700 SYN_SENT
...


Firewall turned off, no antiviruses installed "telnet 10.0.0.100 3700" command opens connection.

Any ideas?

Is it possible on 3.0.1 (J2EE6) version?
[Message sent by forum member 'mozheyko_d']

http://forums.java.net/jive/thread.jspa?messageID=478235