users@glassfish.java.net

ic.lookup throws (COMM_FAILURE) Blocking read failed exception

From: <glassfish_at_javadesktop.org>
Date: Mon, 05 May 2008 16:44:41 PDT

Hi,

I am working with glassfish on JAVA 6 in windows vista OS. when i try to do a ic.lookup or even ic.list, i am getting the following error. The code works fine remotely from XP (tested that using same jars). Can someone please tell me how to resolve this issue.

I have check that appserv-rt and javaee jars are correctly in my class path, also initial context instance without the properties gives me the same error.

Exception and sourcecode is attached below.

thanks in advance,
mahim



[b][u]EXCEPTION[/u][/b]
---------- java ----------
this is hello world. :-)
Searching for ejb/UserBean {org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, com.sun.CORBA.transport.ORBTCPReadTimeouts=10000:6000000:18000000:2000, org.omg.CORBA.ORBInitialHost=localhost, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl:com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming:com.sun.enterprise.naming}
May 5, 2008 7:14:39 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl blockingRead
WARNING: "IOP00410229: (COMM_FAILURE) Blocking read failed, expected to read additional bytes: max wait time = 6,000ms total time spent waiting = 7,280ms"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 229 completed: No
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.blockingReadTimeout(ORBUtilSystemException.java:3476)
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.blockingReadTimeout(ORBUtilSystemException.java:3500)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.blockingRead(SocketOrChannelConnectionImpl.java:1863)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doOptimizedReadStrategy(SocketOrChannelConnectionImpl.java:1733)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1263)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
javax.naming.CommunicationException: Can't find SerialContextProvider [Root exception is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe]
        at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:165)
        at com.sun.enterprise.naming.SerialContext.list(SerialContext.java:580)
        at javax.naming.InitialContext.list(InitialContext.java:436)
        at RsMainUploader.main(RsMainUploader.java:33)
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectionAbort(ORBUtilSystemException.java:2862)
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectionAbort(ORBUtilSystemException.java:2880)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doOptimizedReadStrategy(SocketOrChannelConnectionImpl.java:1788)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1263)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 229 completed: No
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.blockingReadTimeout(ORBUtilSystemException.java:3476)
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.blockingReadTimeout(ORBUtilSystemException.java:3500)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.blockingRead(SocketOrChannelConnectionImpl.java:1863)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doOptimizedReadStrategy(SocketOrChannelConnectionImpl.java:1733)
        ... 2 more

Output completed (12 sec consumed) - Normal Termination

[b][u]SOURCE CODE[/u][/b]

import javax.naming.*;
import javax.rmi.*;
import java.util.*;
import com.rs.ejb.remote.*;

class RsMainUploader
{
        public static void main(String[] args)
        {
                System.out.println("this is hello world. :-)");
                try{
                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");

                // optional. Defaults to localhost. Only needed if web server is running
                // on a different host than the appserver
                props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");

                // optional. Defaults to 3700. Only needed if target orb port is not 3700.
                props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
                 props.put("com.sun.CORBA.transport.ORBTCPReadTimeouts", "10000:6000000:18000000:2000");
                 System.setProperty("com.sun.CORBA.transport.ORBTCPReadTimeouts", "1000:600000:180000:2000");


                InitialContext ic = new InitialContext(props);
                
                System.out.println("Searching for ejb/UserBean "+ic.getEnvironment());
                NamingEnumeration n = ic.list("");
                while(n.hasMore())
                   {
                           System.out.println(" -- "+n.nextElement());
                   }

                System.out.println("Searching for ejb/UserBean - 1.1" +n);
                Object o=ic.lookup("SerialContextProvider");
                //perform Portable Narrowing of the object to the
                //corresponding home interface of the bean.
                System.out.println("Searching for ejb/UserBean - 1.2 " + o);
                UploaderRemote uploaderBean= (UploaderRemote)(o);
                System.out.println("Searching for ejb/UserBean - 2");
                System.out.println(" uploader " +uploaderBean.upload("3IINFOTECH,EQ,101,102,97.3,99.9,100.35,98.9,108945,10827794.9,1-APR-2008,"));

                }
                catch(Exception e)
                {
                        e.printStackTrace(System.out);
                }
        }
}

/*

javac -classpath .;D:\MyWArea\Rs\Downloads\glassfish\lib\appserv-rt.jar;D:\MyWArea\Rs\Downloads\glassfish\lib\javaee.jar;D:\MyWArea\Rs\Rs_wspace\RsView\WebContent\WEB-INF\lib\RsRemote.jar; RsMainUploader.java


java -classpath D:\MyWArea\Rs\Downloads\glassfish\lib;.;D:\MyWArea\Rs\Downloads\glassfish\lib\appserv-rt.jar;D:\MyWArea\Rs\Downloads\glassfish\lib\javaee.jar;D:\MyWArea\Rs\Rs_wspace\RsView\WebContent\WEB-INF\lib\RsRemote.jar; RsMainUploader

May 4, 2008 7:06:33 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl blockingRead
*/
[u][/u]
[Message sent by forum member 'mishramahim' (mishramahim)]

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