Hi
          (I'm using Orion)                 I'm able to reach and display
the default index.html from my web application dir (my-planet-web).
But when I access servlet from the browser
<http://localhost:8888/planet/hello/web/HelloServlet>

I get error :-

Hello from hello servlet!
javax.naming.NameNotFoundException: ejb/MyEjb not found in Orion Primer Web
Application at com.evermind.naming.MapContext.lookup(MapContext.java:49) at
com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:121)
at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:63)
at javax.naming.InitialContext.lookup(Unknown Source) at
hello.web.HelloServlet.doGet(Unknown Source) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:195) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:309) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:336) at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispa
tcher.java:501) at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletReq
uestDispatcher.java:170) at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandle
r.java:576) at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)
at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62)
If you see this message, then ejb is not invoked properly!!


My servlet code is as follows :-
package hello.web;
import hello.ejb.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.naming.*;

public class HelloServlet extends HttpServlet
{
  public void doGet (HttpServletRequest request, HttpServletResponse
response)
    throws ServletException, IOException
  {

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();

    out.println("<html><head><title>Hello from Servlet</title></head>");
    out.println("<body><h1>Hello from hello servlet!</h1></body>");
    String s = "If you see this message, then ejb is not invoked
properly!!";
    try {
      HelloHome hh = (HelloHome) (new
InitialContext()).lookup("java:comp/env/ejb/MyEjb");
      Hello hr = hh.create();
      s = hr.sayHello();

    } catch (Exception e) {
      e.printStackTrace(out);
    }
    out.println("<br>" + s);
    out.println("</html>");
  }
}

Now it's unable to lookup for ("java:comp/env/ejb/MyEjb"). Question is does
this lookup name (ejb/MyEjb) has to defined in any of the descriptor file
and how should I go about it.

Pl through some light
Regards
Prashant

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to