Labels

Monday, May 28, 2012

org.jnp.interfaces.NamingContext] Failed to connect to localhost:1099 in GLASSFISH server

javax.servlet.ServletException: javax.naming.CommunicationException: Failed to retrieve stub from server 3.232.180.62:1400 [Root exception is java.io.StreamCorruptedException: unexpected block data]
            com.gehc.sf.filter.LoginFilter.doFilter(Unknown Source)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


root cause

com.gehc.sf.service.ServiceException: javax.naming.CommunicationException: Failed to retrieve stub from server 3.232.180.62:1400 [Root exception is java.io.StreamCorruptedException: unexpected block data]
            com.gehc.sf.service.UserRemoteService.lookUpSessionBean(Unknown Source)
            com.gehc.sf.service.UserRemoteService.createUser(Unknown Source)
            com.gehc.sf.filter.LoginFilter.setLoginUser(Unknown Source)
            com.gehc.sf.filter.LoginFilter.doFilter(Unknown Source)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter
[org.jnp.interfaces.NamingContext] Failed to connect to localhost:1099
javax.naming.CommunicationException: Failed to retrieve stub from server localhost:1099 [Root exception is java.io.EOFException]
            at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
            at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at com.gehc.sf.user.ejb.UserManagerUtil.lookupHome(Unknown Source)
            at com.gehc.sf.user.ejb.UserManagerUtil.getHome(Unknown Source)
            at com.gehc.sf.service.UserRemoteService.lookUpSessionBean(Unknown S

2011-11-25 02:59:11,009 DEBUG [(class com.ge.med.websol.webshop.tags.FormatTag)] <--<--FormatTag.doAfterBody()
2011-11-25 02:59:15,040 DEBUG [org.jnp.interfaces.NamingContext] Failed to connect to localhost:1099
javax.naming.CommunicationException: Failed to retrieve stub from server localhost:1099 [Root exception is java.io.EOFException]
            at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
            at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at com.gehc.sf.user.ejb.UserManagerUtil.lookupHome(Unknown Source)
            at com.gehc.sf.user.ejb.UserManagerUtil.getHome(Unknown Source)
            at com.gehc.sf.service.UserRemoteService.lookUpSessionBean(Unknown Source)
            at com.gehc.sf.service.UserRemoteService.createUser(Unknown Source)
            at com.gehc.sf.filter.LoginFilter.setLoginUser(Unknown Source)
            at com.gehc.sf.filter.LoginFilter.doFilter(Unknown Source)


If we get this error  we need to replace below code from JBoss code
localHashtable.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    localHashtable.put("java.naming.provider.url", "jnp://localhost:1099");
    localHashtable.put("java.naming.factory.url.pkgs", "org.jnp.interfaces");

To below  Glassfish code
localHashtable.put("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
 localHashtable.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");    localHashtable.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
    localHashtable.put("org.omg.CORBA.ORBInitialHost", "localhost"); localHashtable.put("org.omg.CORBA.ORBInitialPort", "3700");

No comments:

Post a Comment