ejb@glassfish.java.net

Re: call remote EJB on different network

From: Andrea Wang <Andrea.Wang_at_Sun.COM>
Date: Tue, 30 Jun 2009 14:12:01 +0800

Dear Sankar,

Thanks for your kindly hints!

Customer did not specify the IIOP address in JNDI, they hardcode it in
application with:

props.setProperty("org.omg.CORBA.ORBInitialHost", <host>);
props.setProperty("org.omg.CORBA.ORBInitialPort", <port>);


Customer test code:

/**

* Copyright 2009 DataComo Communications Technology INC.

*

* This source file is a part of TestEJBClient project.

* date: Jun 30, 2009

*

*/

*package* com;

*import* java.util.Properties;

*import* javax.naming.InitialContext;

*import* javax.naming.NamingException;

*
public* *class* Test {

/**

* *_at_param* args

*/

*public* *static* *void* main(String[] args) {

Properties props = *new* Properties();

props.setProperty("java.naming.factory.initial",

"com.sun.enterprise.naming.SerialInitContextFactory");

props.setProperty("java.naming.factory.url.pkgs",

"com.sun.enterprise.naming");

props.setProperty("java.naming.factory.state",

"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");

// EJB容器的ip

//props.setProperty("org.omg.CORBA.ORBInitialHost", "192.168.1.190");

* props.setProperty(**"org.omg.CORBA.ORBInitialHost", "192.168.1.190");*

// EJB容器端口,默认为:3700

* props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");*

InitialContext ctx;

*try* {

ctx = *new* InitialContext(props);

TestEJBServiceRemote testEJBServiceRemote = (TestEJBServiceRemote) ctx

.lookup(TestEJBServiceRemote.*class*.getName());

String a = testEJBServiceRemote.getString();

System./out/.println(a);

} *catch* (NamingException e) {

System./out/.println(e.getMessage());

}

}


}


__If the remote EJB host IP is within the same network, everything works
fine.

but if the hosts are on different networks, they get below error:

2009-6-30 11:53:36
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>

警告: "IOP00410201: (COMM_FAILURE) Connection failure: socketType:
IIOP_CLEAR_TEXT; hostname: 192.168.1.191; port: 3700"

org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No

at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(_ORBUtilSystemException.java:2690_)

at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(_ORBUtilSystemException.java:2711_)

at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(_SocketOrChannelConnectionImpl.java:261_)

at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(_SocketOrChannelConnectionImpl.java:274_)

at
com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(_SocketOrChannelContactInfoImpl.java:130_)

at
com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(_CorbaClientRequestDispatcherImpl.java:192_)

at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(_CorbaClientDelegateImpl.java:181_)

at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(_CorbaClientDelegateImpl.java:325_)

at org.omg.CORBA.portable.ObjectImpl._is_a(_ObjectImpl.java:112_)

at
org.omg.CosNaming.NamingContextHelper.narrow(_NamingContextHelper.java:69_)

at
com.sun.enterprise.naming.SerialContext.narrowProvider(_SerialContext.java:131_)

at
com.sun.enterprise.naming.SerialContext.getRemoteProvider(_SerialContext.java:220_)

at
com.sun.enterprise.naming.SerialContext.getProvider(_SerialContext.java:160_)

at com.sun.enterprise.naming.SerialContext.lookup(_SerialContext.java:398_)

at javax.naming.InitialContext.lookup(_InitialContext.java:351_)

at com.Test.main(_Test.java:45_)

Caused by: _java.lang.RuntimeException_: _java.net.ConnectException_:
Connection timed out: connect

at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(_IIOPSSLSocketFactory.java:347_)

at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(_SocketOrChannelConnectionImpl.java:244_)

... 13 more

Caused by: _java.net.ConnectException_: Connection timed out: connect

at sun.nio.ch.Net.connect(_Native Method_)

at sun.nio.ch.SocketChannelImpl.connect(_SocketChannelImpl.java:464_)

at
com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(_ORBUtility.java:105_)

at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(_IIOPSSLSocketFactory.java:332_)

... 14 more

_
Question

_Does it mean customer shall not code with ORBInitialHost, but shall use
JNDI instead?
Why ORBInitialHost not accessible if on different network?


Thanks again for any helps.

Andrea



On 06/29/09 18:20, Sankar Mariappan wrote:
> Hi andrea,
> Did you set the iiop ip address in glassfish.?
> Set the iiop address and then try......
>
> 2009/6/29 Andrea Wang <Andrea.Wang_at_sun.com <mailto:Andrea.Wang_at_sun.com>>
>
> Dear Expert,
>
> IHAC got below issue:
> EJB1 on host1 call EJB2 on host2.
> when host1 and host2 are one the same network (like *10.1.1*.1 and
> *10.1.1.*2) everything works fine.
> but if the two hosts are on different network (like *10.1.1*.1 and
> *10.1.2*.2) the call cannot be established.
>
> There's no firewall between the two machine.
> Network access between two hosts/ports are fine.
>
> They tried connect the two box directly, one IP *10.1.1*.1 and the
> other *10.1.2*.2, problem exists! and no problem if set the two IP
> within the same subnetwork (*10.1.1*.1 and *10.1.1.*2).
>
> There's no same issue if they test with JBOSS.
> They can reproduce the issue on Solaris, Linux and Windows.
>
> So customer wondering if any restriction on our
> GlassFish2.1/EJB3.0 for remote EJB call on different networks?
>
> The test case is under below:
> /net/snowren.prc/SCIC/Explorer/SunONE/Application/71255182/DEMO
> Project.zip
>
> Thanks if any advices for me.
>
> Andrea
>
>
> -------- Original Message --------
> Subject: GlassFish不同网段连接问题
> Date: Mon, 29 Jun 2009 16:58:56 +0800
> From: Zhuang Xulin <zhuangxulin2003_at_126.com>
> <mailto:zhuangxulin2003_at_126.com>
> To: Andrea.Wang_at_Sun.COM <mailto:Andrea.Wang_at_Sun.COM>
> CC: 119_at_sun.com <mailto:119_at_sun.com>
>
>
>
> Hello andrea:
>
> 附件是我们的一个简单的DEMO,来测试能否连接EJB服务(EJB3.0),在不
> 同的网段中不能够成功互联,请协助解决,谢谢。
>
>
> 庄徐麟
>
> 2009/6/29
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> 中电达通通信技术股份有限公司 技术支持中心
>
> DataComo Communications Technology Inc.
>
> Office: 0086-10-82606668
>
> Fax: 0086-10-82621665
>
> Mobile: 159 1095 1864
>
> MSN: zhuangxulin2003_at_msn.com <mailto:zhuangxulin2003_at_msn.com>
>
> Skype: zhuangxulin2003
>
>
> --
> Andrea Wang
>
> Engineer, Software Technical Service Centre - Business Integration
>
> For Troubleshooting tips / checklists / SW support information see http://wikis.sun.com/display/SoftwareSupport/Home
>
> If your current Service Request is not progressing to your satisfaction, please let me know. I will respond back within one business day, otherwise, you may send a short e-mail to my management at dmswtsc_at_callout.sfbay.sun.com <mailto:dmswtsc_at_callout.sfbay.sun.com> with "ESC:<space> <case#> " as the subject line, also include your contact information and brief problem summary in the body of your message.
>
> Thank you for using Sun Software Support for your Support needs.
>
>
>
>
>
>
> --
> ---
> Thanks & Regards,
> Sankar M
> InfoMindz R&D Sdn Bhd,
> Cyberjaya.


-- 
Andrea Wang
Engineer, Software Technical Service Centre - Business Integration
For Troubleshooting tips / checklists / SW support information see http://wikis.sun.com/display/SoftwareSupport/Home
If your current Service Request is not progressing to your satisfaction, please let me know.  I will respond back within one business day, otherwise, you may send a short e-mail to my management at dmswtsc_at_callout.sfbay.sun.com with "ESC:<space> <case#> " as the subject line, also include your contact information and brief problem summary in the body of your message. 
Thank you for using Sun Software Support for your Support needs.