geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nirav Mehta" <>
Subject Re: EJB trouble
Date Tue, 30 May 2006 16:38:13 GMT
> One of the problems is that you have an  ejb-local-ref from the web app to
> the ejb.  This can only be deployed if the web app and ejb app are in the
> same ear.

Thanks david....this is learning for me. I removed the local ref, but now I
think there is something wrong with my code. This is how I am accessing my

        helloWorld.HelloWorld helloBean = null;
        try {
            javax.naming.Context ctx = new javax.naming.InitialContext();
            helloWorld.HelloWorldHome helloHome = (helloWorld.HelloWorldHome)
            helloBean = helloHome.create();
            request.getSession(true).setAttribute("HelloBean", helloBean);
        The Bean says :    <%=helloBean.sayHello()%>
        } catch (Exception e) {
        Error :    <br>
        <% e.printStackTrace(response.getWriter()); %>

This is the stack trace:

javax.naming.NameNotFoundException: HelloWorld at
com.sun.jndi.rmi.registry.RegistryContext.lookup( at
at javax.naming.InitialContext.lookup( at
org.apache.jsp.Hello_jsp._jspService(org.apache.jsp.Hello_jsp:55) at
org.apache.jasper.runtime.HttpJspBase.service( at
javax.servlet.http.HttpServlet.service( at
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service( at
javax.servlet.http.HttpServlet.service( at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at
org.apache.catalina.core.ApplicationFilterChain.doFilter( at
org.apache.catalina.core.StandardWrapperValve.invoke( at
org.apache.catalina.core.StandardContextValve.invoke( at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke( at
org.apache.geronimo.tomcat.valve.TransactionContextValve.invoke( at
org.apache.geronimo.tomcat.valve.ComponentContextValve.invoke( at
org.apache.geronimo.tomcat.valve.InstanceContextValve.invoke( at
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke( at
org.apache.catalina.valves.AccessLogValve.invoke( at
at org.apache.coyote.http11.Http11Processor.process(
( at at at
org.apache.tomcat.util.threads.ThreadPool$ at

I think there should be some more involved in finding the bean in the
JNDI....or is there something required in the bean code to register it? I am
not familiar with the concept of JNDI. Can someone suggest where I can learn
how to lookup EJBs from?

Thanks in advance for your patience :)


View raw message