geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lasan...@opensource.lk
Subject Locally Reffered EJB by Servlet Problem
Date Mon, 10 Jul 2006 05:16:53 GMT
Hi All,

I have been writing a sample EAR application to the Geronimo 1.1. This
sample application is basically HelloWorld application, which contains a
stateless session bean reffered by a servlet as in the follows.

	System.out.println("### Request Recieved ###");

	Context context = new InitialContext();
	HelloHome home = (HelloHome)context.lookup("java:comp/env/ejb/HelloLocal");
	Hello hello = home.create();
	hello.sayHello();

It gives following error in the console.
### Request Recieved ###
javax.naming.NameNotFoundException: env/ejb/HelloLocal
        at
org.apache.geronimo.naming.enc.AbstractReadOnlyContext.lookup(AbstractReadOnlyContext.java:81)
        at
org.apache.geronimo.naming.java.RootContext.lookup(RootContext.java:51)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.test.web.HelloServlet.sayHello(Unknown Source)
        at com.test.web.HelloServlet.doGet(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:46)
        at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:342)
        at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:31)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)


It looks EJB is not visible to the Servlet. How can I overcome this
problem? Herewith I have attached the configuration files used to create
the EAR.

Thanks,

Lasantha Ranaweera
Senior Software Engineer,
Lanka Software Foundation,
Sri Lanka.
Mime
View raw message