users@glassfish.java.net

Ejbs, InitialContext, J2se

From: <glassfish_at_javadesktop.org>
Date: Thu, 12 Jul 2007 07:57:45 PDT

Hey,
How things guys?

I am trying to retrieve a remote interface of an EJB but I have some communication problems,

I tried to add javaee.jar/appserver-rt.jar/appserver-ext.jar to the classpath of a simple j2se app,

and execute the following code:
Properties props1 = new Properties();
        props1.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
props1.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
InitialContext ic = new InitialContext(props1);
TestRemoteIface testRemoteIface = (TestRemoteIface ) ic.lookup(TestRemoteIface .class.getName());

Where TestRemoteIface is the Remote interface of the EJB that is deployed,


I get a timeout connection as follows:
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 169.254.5.188; port: 3700"


This is weird, I have no clue where this IP came from, this is not what the OS resolves by localhost (it resolves it as 127.0.0.1),

and it seems that setting/not setting the 'ORBInitialHost' property does not affect the IP anyway,


Following is the full exception, just in case:
Jul 12, 2007 5:49:21 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 169.254.5.188; 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:2371)
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2392)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:230)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:243)
        at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
        at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:165)
        at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:154)
        at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:294)
        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:112)
        at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:166)
        at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:315)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at velo.tmp.quartz.SimpleTest.main(SimpleTest.java:47)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection timed out: connect
        at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:334)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:213)
        ... 12 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:507)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
        at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:318)
        ... 13 more





What's wrong?


Thanks,

Asaf.
[Message sent by forum member 'trouby' (trouby)]

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