> Hi!
> I'm using JBoss-2.4.4_Jetty-3.1.3-1.  
> I'm building my first app containing a Servlet that call an EJB.(using
> FORTE) 
> My project contains a web modul and a EJB modul.
> I take the example "interest" at JBoss:
> 
> 
> **************************************************************************
> *****************************
> public class InterestServlet extends HttpServlet
> {
>    private InterestHome interestHome = null;
>    
>    /** Looks up the InterestHome interface and saves it for use in
>     doGet().
>     */
> 
>    public void init() throws ServletException
>    {
>       try
>       {
>          // Get a naming context
>          InitialContext jndiContext = new InitialContext();
>          // Get a reference to the Interest Bean
>          Object ref  = jndiContext.lookup("java:comp/env/ejb/Interest");
> 
>          // Get a reference from this to the Bean's Home interface
>          interestHome = (InterestHome) PortableRemoteObject.narrow(ref,
> InterestHome.class);
>       }
>       catch(Exception e)
>       {
>          throw new ServletException("Failed to lookup
> java:comp/env/ejb/Interest", e);
>       }
>    }
> **************************************************************************
> *****************************
> [INFO,J2eeDeployer] J2EE application:
> file:/D:/JBoss-2.4.4_Jetty-3.1.3-1/jboss/deploy/HiApplic.ear is deployed 
> My application index.html file can't reach the servlet and what I see at
> browser is:
> 
> HTTP ERROR: 503 Service Unavailable
> javax.servlet.UnavailableException: Could not construct servlet
> RequestURI=/defaultContext/servlet/HiServ 
> 
> The problem is with the marked line.
> Of course I write 
>          Object ref  = jndiContext.lookup("java:comp/env/ejb/Multiply");
> (Multiply is the name of my EJB.)
> 
> Thats what I see at command line
> 
>  
> [INFO,J2eeDeployer] J2EE application:
> file:/D:/JBoss-2.4.4_Jetty-3.1.3-1/jboss/deploy/HiApplic.ear is deployed
> 
> [INFO,JettyService] Servlet_HiServ: init
> [WARN,JettyService] WARNING:
> javax.servlet.ServletException: Failed to lookup
> java:comp/env/ejb/Multiply
>         at HiServ.init(HiServ.java:47)
>         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:441)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:403)
>         at
> org.mortbay.http.HandlerContext.handle(HandlerContext.java:1037)
>         at org.mortbay.http.HandlerContext.handle(HandlerContext.java:992)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:699)
>         at
> org.mortbay.http.HttpConnection.service(HttpConnection.java:745)
>         at
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:918)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:760)
>         at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:148)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
>         at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716)
>         at java.lang.Thread.run(Unknown Source)
> getRootCause():
> javax.naming.NameNotFoundException: ejb not bound
>         at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
>         at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
>         at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
>         at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
>         at org.jnp.server.NamingServer.lookup(NamingServer.java:256)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:457)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
>         at javax.naming.InitialContext.lookup(Unknown Source)
>         at HiServ.init(HiServ.java:41)
>         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:441)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:403)
>         at
> org.mortbay.http.HandlerContext.handle(HandlerContext.java:1037)
>         at org.mortbay.http.HandlerContext.handle(HandlerContext.java:992)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:699)
>         at
> org.mortbay.http.HttpConnection.service(HttpConnection.java:745)
>         at
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:918)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:760)
>         at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:148)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
>         at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716)
>         at java.lang.Thread.run(Unknown Source)
> getRootCause():
> 
> [WARN,JettyService] WARNING: Servlet Exception for
> /defaultContext/servlet/HiServ
> javax.servlet.UnavailableException: Could not construct servlet
>         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:473)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:403)
>         at
> org.mortbay.http.HandlerContext.handle(HandlerContext.java:1037)
>         at org.mortbay.http.HandlerContext.handle(HandlerContext.java:992)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:699)
>         at
> org.mortbay.http.HttpConnection.service(HttpConnection.java:745)
>         at
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:918)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:760)
>         at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:148)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
>         at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716)
>         at java.lang.Thread.run(Unknown Source)
> getRootCause():
> 
> 
> What is the meaning of this "path"("java:comp/env/ejb/Multiply");
> ?????????????? 
> Can you help me?
> 
> THANKS AT ADVANCE!
> 
> Bentzy

<<attachment: winmail.dat>>

Reply via email to