troubleshooting Question

Finding EJBs from JSPs : javax.naming.NamingException: Error instantiating web-app JNDI-context

Avatar of gani_ganesh
gani_ganesh asked on
Web Languages and Standards
6 Comments1 Solution270 ViewsLast Modified:
This is what i did in my application

Context context = new InitialContext();
      Object homeObject =context.lookup("java:comp/env/MySessionEJB1");
      MySessionEJBHome home =(MySessionEJBHome) PortableRemoteObject.narrow(homeObject,MySessionEJBHome.class);
      MySessionEJB remote =(MySessionEJB) PortableRemoteObject.narrow(home.create(), MySessionEJB.class);

but the JSP throws the following exception

javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance of the type 'MySessionEJB' found for the ejb-ref MySessionEJB1
     at com.evermind[Oracle9iAS (2.0.0.0) Containers for J2EE].server.http.HttpApplication.getEnvironmentContext(HttpApplication.java:5915)
     at com.evermind[Oracle9iAS (2.0.0.0) Containers for J2EE].server.ApplicationContext.lookup(ApplicationContext.java:104)
     at com.evermind[Oracle9iAS (2.0.0.0) Containers for J2EE].server.ApplicationContext.lookup(ApplicationContext.java:63)
     at javax.naming.InitialContext.lookup(InitialContext.java:349)
     at _index._jspService(_index.java:61)
     [SRC:/index.jsp:11]
     at com.orionserver[Oracle9iAS (2.0.0.0) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:192)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:356)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:306)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
     at com.evermind[Oracle9iAS (2.0.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java, Compiled Code)
     at com.evermind[Oracle9iAS (2.0.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
     at com.evermind[Oracle9iAS (2.0.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java, Compiled Code)
     at com.evermind[Oracle9iAS (2.0.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java, Compiled Code)
     at com.evermind[Oracle9iAS (2.0.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java, Compiled Code)

I'm thinking there's a need for a jndi.properties but i put it in WEB-INF.
still i haven't find any solution.
Any ideas?
sundar in India.

ASKER CERTIFIED SOLUTION
BigRat

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros