users@glassfish.java.net

Use of UserTransaction object produces IOP00410201 COMM_FAILURE

From: <glassfish_at_javadesktop.org>
Date: Wed, 01 Oct 2008 15:14:49 PDT

We have a stand-alone Java Swing client that connects to a EJB component hosted on a Glassfish v2ur2 server. The client application is able to perform various operations with the EJB component (e.g., log in, querying the database, ...). However, it is not able to start a bean-managed transaction. I have the following code segment in the client:

[code]
tx = (UserTransaction)Main.initialContext.lookup("UserTransaction");
tx.begin();
ret = saveAnnotation();
tx.commit();
[/code]

where [code]saveAnnotation()[/code] contains a few EJB method invocations. The following error is what I get when trying to execute the [code]tx.begin()[/code] line:

[code]
"IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 192.168.1.101; port: 64939"
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 org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:431)
        at org.omg.CosTransactions._CoordinatorStub.register_synchronization(_CoordinatorStub.java:235)
        at com.sun.jts.CosTransactions.TopCoordinator.register_synchronization(TopCoordinator.java:2433)
        at com.sun.jts.jta.TransactionState.registerSynchronization(TransactionState.java:434)
        at com.sun.jts.jta.TransactionImpl.registerSynchronization(TransactionImpl.java:304)
        at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.getTransaction(J2EETransactionManagerOpt.java:462)
        at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:3273)
        at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1244)
        at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:202)
        at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:77)
        at $Proxy142.insertDays(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:154)
        at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
        at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
        at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
Caused by: java.lang.RuntimeException: java.net.NoRouteToHostException: No route to host
        at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
        ... 30 more
Caused by: java.net.NoRouteToHostException: No route to host
        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)
        ... 31 more
[/code]

and after a while, the client throws the following exception:

[code]
class javax.ejb.EJBException

Message:
nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
        java.rmi.RemoteException: nested exception is: java.lang.SecurityException; nested exception is:
        java.lang.SecurityException

Stack Trace:
com.kebok.denialtracking._DayManagerRemote_Wrapper.insertDays(com/kebok/denialtracking/_DayManagerRemote_Wrapper.java)
denialtracking.AdmissionAnnotationDialog$SaveAnnotationButtonActionTask.saveAnnotation(AdmissionAnnotationDialog.java:738)
denialtracking.AdmissionAnnotationDialog$SaveAnnotationButtonActionTask.doInBackground(AdmissionAnnotationDialog.java:614)
org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
java.util.concurrent.FutureTask.run(FutureTask.java:138)
org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:619)
[/code]

I've run some experiments trying to figure out the exact cause. So far I've identified two variables. If I do not use the bean-managed transaction, this problem does not occur. Furthermore, how the client machine is connected to the network plays a role too. When bean-managed transaction is used, If the client machine is connected via LAN, the problem does not occur. If the client machine is connected wirelessly, the above error message appears.

I got this feeling that the problem might not be in the client/EJB/Glassfish but in the network. Any pointer on how to debug this problem is appreciated.

Thanks!
[Message sent by forum member 'bentsou' (bentsou)]

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