users@glassfish.java.net

accessing glassfish EJB through external client

From: <glassfish_at_javadesktop.org>
Date: Thu, 15 Jan 2009 14:56:43 PST

Hi all,

I've been trying to access a simple bean that I set up in glassfish using an external client. I followed the instructions here: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB

However when the client tries to connect I get the following error:

[code]15/01/2009 8:36:14 AM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl &lt;init&gt;
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; 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.&lt;init&gt;(SocketOrChannelConnectionImpl.java:261)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.&lt;init&gt;(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(Unknown Source)
        at org.omg.CosNaming.NamingContextHelper.narrow(Unknown Source)
        at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
        at com.sun.enterprise.naming.SerialContext.getCachedProvider(SerialContext.java:247)
        at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:205)
        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(Unknown Source)
        at standaloneclienttest.Main.main(Main.java:23)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
        at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.&lt;init&gt;(SocketOrChannelConnectionImpl.java:244)
        ... 14 more
[/code]


When I use TCP view, and look at all the open ports on my machine, 3700 doesn't seem to be there. But going by the article I linked this is supposed to be the default port used. I had a look through my glassfish directories and found domain.xml that contains the line:

[code]
&lt;iiop-listener id="orb-listener-1" address="0.0.0.0" port="3700" enabled="true" security-enabled="false"/&gt;
[/code]

so it appears that it should be opening the correct port.

I created an 'Enterprise Application Client' in Netbeans, and if I try to access the bean through that it works fine. I just can't get it to work from a stand alone client which is what I really need to do. I am running glassfish 2u2 and controlling it through Netbeans 6.5.

I am a pretty much a beginner when it comes to glassfish and EJB so I may be missing something simple.

Thanks
[Message sent by forum member 'henrika' (henrika)]

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