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 ( Containers for J2EE].server.http.HttpApplication.getEnvironmentContext(
     at com.evermind[Oracle9iAS ( Containers for J2EE].server.ApplicationContext.lookup(
     at com.evermind[Oracle9iAS ( Containers for J2EE].server.ApplicationContext.lookup(
     at javax.naming.InitialContext.lookup(
     at _index._jspService(
     at com.orionserver[Oracle9iAS ( Containers for J2EE].http.OrionHttpJspPage.service(
     at oracle.jsp.runtimev2.JspPageTable.service(
     at oracle.jsp.runtimev2.JspServlet.internalService(
     at oracle.jsp.runtimev2.JspServlet.service(
     at javax.servlet.http.HttpServlet.service(
     at com.evermind[Oracle9iAS ( Containers for J2EE].server.http.ServletRequestDispatcher.invoke(, Compiled Code)
     at com.evermind[Oracle9iAS ( Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(
     at com.evermind[Oracle9iAS ( Containers for J2EE].server.http.HttpRequestHandler.processRequest(, Compiled Code)
     at com.evermind[Oracle9iAS ( Containers for J2EE], Compiled Code)
     at com.evermind[Oracle9iAS ( Containers for J2EE], Compiled Code)

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


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