Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem doing a looup on a remote server

843829Aug 8 2003 — edited Apr 3 2007
I have a web application that calls an entity bean on a remote machine.
During testing, when the web app is running on the same application server as the one where the container is, everything works fine. But when I try to do a lookup from a web app running on a different physical machine than the one where the container is, I get the below error. (The server is running)

Any help would be greatly appreciated.

My lookup code looks like this:
boolean localTesting = false;
if(request.getMethod().equals("POST")){
	InitialContext jndiContext = null;
	if(localTesting)
		jndiContext = new InitialContext();
	else{
		Properties props = new Properties();
		props.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
		props.put(Context.PROVIDER_URL,"iiop://xx.xx.xx.xx/");
		jndiContext = new InitialContext(props);
	}
	ref = jndiContext.lookup("ejb/cmbndBeans/ProductHome");
	home = (ProductHome)PortableRemoteObject.narrow(ref, ProductHome.class);
************************************************************

[8/7/03 13:21:56:202 EDT] 64642b6b WebGroup I SRVE0180I:
[ProductBeanTest] [ProductBeanTest] [Servlet.LOG]:
/productBeanTestExtended.jsp: init
[8/7/03 13:23:02:026 EDT] 64642b6b WsnInitCtxFac W NMSV0602E: Naming
Service unavailable. A communications error occurred.
[8/7/03 13:23:02:126 EDT] 64642b6b WebGroup E SRVE0026E: [Servlet
Error]-[A communication failure occurred while attempting to obtain an
initial context using the provider url:
"iiop://xx.xx.xx.xx/". Make sure that the host and port
information is correct and that the server identified by the provider
url is a running name server. If no port number is specified, the
default port number 2809 is used. Other possible causes include the
network environment or workstation network configuration.]:
javax.naming.ServiceUnavailableException: A communication failure
occurred while attempting to obtain an initial context using the
provider url: "iiop://xx.xx.xx.xx/". Make sure that the host and port
information is correct and that the server identified by the provider
url is a running name server. If no port number is specified, the
default port number 2809 is used. Other possible causes include the
network environment or workstation network configuration. Root
exception is org.omg.CORBA.TRANSIENT: Operation timed out:
connect:host=nycwasdev01,port=9900 minor code: 4942F301 completed: No
at
com.ibm.CORBA.transport.TransportConnectionBase.connect(TransportConnectionBase.java:353)
at
com.ibm.ws.orbimpl.transport.WSTransport.getConnection(WSTransport.java:414)
at com.ibm.rmi.iiop.TransportManager.get(TransportManager.java:84)
at com.ibm.rmi.iiop.GIOPImpl.locate(GIOPImpl.java:177)
at
com.ibm.CORBA.iiop.ClientDelegate._createRequest(ClientDelegate.java:2404)
at
com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1276)
at
com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1175)
at com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1928)
at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:245)
at
com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:37)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1090)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:676)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:604)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:478)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at
com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at
org.apache.jsp._productBeanTestExtended._jspService(_productBeanTestExtended.java:113)
at
com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
at
com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:598)
at
com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:696)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)
at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at
com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:187)
at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)
at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)
----- Begin backtrace for rootCause
org.omg.CORBA.TRANSIENT: Operation timed out:
connect:host=nycwasdev01,port=9900 minor code: 4942F301 completed: No
at
com.ibm.CORBA.transport.TransportConnectionBase.connect(TransportConnectionBase.java:353)
at
com.ibm.ws.orbimpl.transport.WSTransport.getConnection(WSTransport.java:414)
at com.ibm.rmi.iiop.TransportManager.get(TransportManager.java:84)
at com.ibm.rmi.iiop.GIOPImpl.locate(GIOPImpl.java:177)
at
com.ibm.CORBA.iiop.ClientDelegate._createRequest(ClientDelegate.java:2404)
at
com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1276)
at
com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1175)
at com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1928)
at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:245)
at
com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:37)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1090)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:676)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:604)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:478)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:102)
at
com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:408)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:131)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at
org.apache.jsp._productBeanTestExtended._jspService(_productBeanTestExtended.java:113)
at
com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
at
com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:598)
at
com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:696)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)
at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at
com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:187)
at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)
at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2007
Added on Aug 8 2003
15 comments
229 views