4 Replies Latest reply on Apr 2, 2002 11:44 AM by Jules Gosnell

    Error deploying servlet with JBoss-Jetty

    Norton Newbie

      Hi,

      I've been having trouble with a servlet I'm trying to run on JBoss 2.4.4 and Jetty 3.1.3.
      The servlet is in the WEB-INF/classes directory in a war and also in a jar packaged
      up with the war in an ear. When I deploy the ear, I get the following in my server.log:

      [12:20:00,209,ContainerFactory] Deployed application: file:/usr/local/JBoss-2.4.
      4/tmp/deploy/Default/myapp.ear
      [12:20:00,210,J2eeDeployer] Starting module myapp.war
      [12:20:00,215,JettyService] WARNING: Unsuitable contextPathSpec /myapp, Assuming
      : /myapp/*
      [12:20:00,693,JettyService] Registered Jetty:Jetty=0,context=/myapp,WebApplicati
      onContext=0
      [12:20:00,732,JettyService] resolving -//Sun Microsystems, Inc.//DTD Web Applica
      tion 2.2//EN : http://java.sun.com/j2ee/dtds/web-app_1_2.dtd
      [12:20:00,750,JettyService] resolved -//Sun Microsystems, Inc.//DTD Web Applicat
      ion 2.2//EN : jar:file:/usr/local/jetty-3.1.3-1/lib/org.mortbay.jetty.jar!/org/m
      ortbay/jetty/servlet/web.dtd
      [12:20:00,797,JettyService] no jboss-web.xml found
      [12:20:00,972,JettyService] AbstractWebContainer.parseWebAppDescriptors, Begin
      [12:20:00,996,JettyService] Linking java:comp/UserTransaction to JNDI name: User
      Transaction
      [12:20:00,997,JettyService] addEnvEntries
      [12:20:00,997,JettyService] linkResourceEnvRefs
      [12:20:00,997,JettyService] linkResourceRefs
      [12:20:00,997,JettyService] linkEjbRefs
      [12:20:00,998,JettyService] linkSecurityDomain
      [12:20:00,998,JettyService] Binding security/securityMgr to NullSecurityManager
      [12:20:01,045,JettyService] AbstractWebContainer.parseWebAppDescriptors, End
      [12:20:01,060,JettyService] Started SetupHandler in WebApplicationContext[/myapp
      ,file:/usr/local/JBoss-2.4.4/tmp/deploy/Default/myapp.ear/web1003/]
      [12:20:01,081,JettyService] Started SecurityHandler in WebApplicationContext[/my
      app,file:/usr/local/JBoss-2.4.4/tmp/deploy/Default/myapp.ear/web1003/]
      [12:20:01,086,JettyService] Started ServletHandler in WebApplicationContext[/mya
      pp,file:/usr/local/JBoss-2.4.4/tmp/deploy/Default/myapp.ear/web1003/]
      [12:20:01,110,JettyService] WARNING:
      javax.servlet.UnavailableException: java.lang.ClassNotFoundException: com.myapp.
      servlet.ProcesRequestServlet
      at org.mortbay.jetty.servlet.ServletHolder.initializeClass(ServletHolder
      .java:263)
      at org.mortbay.jetty.servlet.ServletHandler.start(ServletHandler.java:20
      8)
      at org.mortbay.http.HandlerContext.start(HandlerContext.java:1166)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationC
      ontext.java:338)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:199)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:262)
      at org.jboss.web.AbstractWebContainer.deploy(AbstractWebContainer.java:1
      91)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:505)
      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:
      459)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:190)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
      at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:371)
      at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103
      )
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(Conf
      igurationService.java:967)
      at $Proxy0.start(Unknown Source)
      at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
      28)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
      23)
      at org.jboss.Main.(Main.java:208)
      at org.jboss.Main$1.run(Main.java:110)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.Main.main(Main.java:106)
      getRootCause():

      [12:20:01,119,JettyService] JSP: init
      [12:20:01,126,JettyService] Started WebInfProtect
      [12:20:01,140,JettyService] ResourceHandler started in file:/usr/local/JBoss-2.4
      .4/tmp/deploy/Default/myapp.ear/web1003/
      [12:20:01,144,JettyService] Started ResourceHandler in WebApplicationContext[/my
      app,file:/usr/local/JBoss-2.4.4/tmp/deploy/Default/myapp.ear/web1003/]
      [12:20:01,148,JettyService] Stopped SetupHandler in WebApplicationContext[/myapp
      ,file:/usr/local/JBoss-2.4.4/tmp/deploy/Default/myapp.ear/web1003/]
      [12:20:01,152,JettyService] Destroyed SetupHandler in null
      [12:20:01,152,JettyService] successfully deployed file:/usr/local/JBoss-2.4.4/tm
      p/deploy/Default/myapp.ear/web1003/ to /myapp
      [12:20:01,153,J2eeDeployer] J2EE application: file:/usr/local/JBoss-2.4.4/deploy
      /myapp.ear is deployed.


      I was able to deploy successfully using JBoss 2.4.4 with Catalina 4.0.3 and was
      able to access the servlet fine.

      Is there an additional classpath somewhere that needs to be set with Jetty? Can't
      it get the servlet from within the war?

      Here's my web.xml in the war:

      <?xml version="1.0" encoding="Cp1252"?>

      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
      " "http://java.sun.com/j2ee/dtds/web-app_1_2.dtd">

      <web-app>

      <servlet-name>ProcesRequestServlet</servlet-name>
      <servlet-class>com.myapp.servlet.ProcesRequestServlet</servlet-class>

      <servlet-mapping>
      <servlet-name>ProcesRequestServlet</servlet-name>
      <url-pattern>/ProcesRequestServlet</url-pattern>
      </servlet-mapping>
      </web-app>

      As a side note, in my working JBoss-Catalina version, I can only access the servlet
      with the URL:

      http://host/myapp/servlet/com.myapp.servlet.ProcessRequestServlet

      The URL:

      http://host/myapp/ProcessRequestServlet

      doesn't work.

      Thanx in advance for your help.

      Norton