Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remote EJB Lookup Problem

6 views
Skip to first unread message

Fun...@hello.net

unread,
Mar 29, 2002, 6:42:25 PM3/29/02
to
Hi,
I am using WebSphere 3.5.5 and IBM's HTTP Server. I use the
following code to do a lookup on a EJB and it works if the code is run
on the same machine as the bean. When I run the code on a different
machine, I get a "Unable to load class: ejb._myBeanHome_Stub" error.
Any ideas?

Code:
env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");

env.put(javax.naming.Context.PROVIDER_URL,
"iiop://192.168.1.100:900");

javax.naming.InitialContext context = new
javax.naming.InitialContext(env);

myBeanHome home =
(myBeanHome)PortableRemoteObject.narrow(context.lookup("myBean"),
myBeanHome.class);

Is there any WebShpere configuring I have to do to make "IIOP"
work?

Thanks in advance.

Lorinda

unread,
Mar 29, 2002, 7:24:41 PM3/29/02
to
Hi,

I was having some similar errors to what you describe on 4.0. When I
updated the install to use the Fix Pack 2 for the EJB fixes, the problem was
resolved. You may check to ensure you have all the fixpacks installed for
3.5.

Good luck,
Lorinda

<Fun...@hello.net> wrote in message
news:q8u9auo81bf83gk8g...@4ax.com...

Bob

unread,
Apr 2, 2002, 1:49:38 AM4/2/02
to
When you run your client code, make sure that the stub jar file(the
deployment jar file) is in the classpath.

<Fun...@hello.net> wrote in message
news:q8u9auo81bf83gk8g...@4ax.com...

VidyaSagar

unread,
Apr 4, 2002, 12:28:13 AM4/4/02
to
"Bob" <crazyb...@yahoo.com> wrote in message news:<a8bk6c$10o2$1...@news.boulder.ibm.com>...

Hi , i am also using was 4.0 as application server and tomcat as a
JSP engine ,while i am making lookup to EJB's resids in WAS i am
getting the following error.

/***
javax.naming.ServiceUnavailableException: NULL returned when resolving
initial reference=NameService
at com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtxFactory.java:452)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:337)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContext(WsnInitCtxFactory.java:200)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:80)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.(InitialContext.java:198)
at jsp._0002fjsp_0002fClient_0002ejspClient_jsp_16._jspService(_0002fjsp_0002fClient_0002ejspClient_jsp_16.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)

***/

I put EJB jar file at clients class path also..
My code is like this...


Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY,

"com.ibm.websphere.naming.WsnInitialContextFactory");
parms.put(Context.PROVIDER_URL,"iiop://127.0.0.1:900");
Context ctx = new InitialContext(parms);

com.gtl.gqw.client.ClientHome home=(ClientHome)
ctx.lookup("com/gtl/gqw/client/ClientHome");


Please any body can help me in this..thanks..


sagar

0 new messages