users@glassfish.java.net

Catch the exception (COMM_FAILURE) Connection failure -

From: <forums_at_java.net>
Date: Tue, 09 Nov 2010 03:04:56 -0800

Hi,
I'm having the following problem:
I've a client application that uses the Sun GlassFish Communications Server
2.0 ((v2.1 Patch06)(9.1_02 Patch12)) (build b31g-fcs).
Now I want that:
1 - My application, when is connecting to the app server, can detect that the
App Server is down;
2 - During its lifetime, my application is able to detect that the app server
crashed.
When one of the mentioned situations happen, I got the following exception:
9/Nov/2010 9:50:37
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType:
IIOP_CLEAR_TEXT; hostname: 192.168.2.5; 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:2783)
        at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2804)
        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:184)
        at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:328)
        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:134)
        at
com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
        at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:159)
        at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:409)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
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.<init>(SocketOrChannelConnectionImpl.java:244)
        ... 14 more
Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect(Native Method)
        at
sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
        at
com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
        at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
        ... 15 more
....
This output repeats about aprox. 1 minute. Only after that time, is that my
application can catch an exception.
I already have tried to use the exception refered in this web site:
http://manuals.sybase.com/onlinebooks/group-eag/eag0500e/eastg/@Generic__BookTextView/4779
[1] (Handling exceptions in Java Clients) but it doesn't work.
I also have tried this:
http://blogs.sun.com/ejcorba/entry/client_side_transport_timeouts_and [2] and
this: http://blogs.sun.com/ejcorba/entry/more_on_tcp_timeouts_in [3]  but it
doesn't work either.
Anyone knows how can I resolve this problem without having to wait aprox 1
minute to catch an exception?
Best regards


[1]
http://manuals.sybase.com/onlinebooks/group-eag/eag0500e/eastg/@Generic__BookTextView/4779
[2] http://blogs.sun.com/ejcorba/entry/client_side_transport_timeouts_and
[3] http://blogs.sun.com/ejcorba/entry/more_on_tcp_timeouts_in

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