3 Replies Latest reply on May 5, 2005 12:15 PM by bombay

    javax.servlet.ServletException: Wrapper cannot find servlet

    bombay Newbie

      I am using JBoss 4.0.1sp1 on SuSE Linux 9.0 System.
      I have a WEB APPLICATION and access it using http://localhost:8080/mhin/admin.html and here is my Directory structure...

      /jboss/server/default/deploy/mhin.war --> this is a directory.
      /jboss/server/default/deploy/mhin.war/admin.html
      /jboss/server/default/deploy/mhin.war/WEB-INF/web.xml
      /jboss/server/default/deploy/mhin.war/WEB-INF/classes/t1.class
      /jboss/server/default/deploy/mhin.war/WEB-INF/classes/t2.class
      /jboss/server/default/deploy/mhin.war/WEB-INF/classes/util/p6.class
      /jboss/server/default/deploy/mhin.war/WEB-INF/classes/util/p9.class

      When I click on http://localhost:8080/mhin/admin.html I get following ERROR wonder why...
      (this HTML calls t1.java file)

      -------------------------------------------------------------------
      javax.servlet.ServletException: Wrapper cannot find servlet class t2 or a class it depends on
      org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      java.lang.Thread.run(Thread.java:534)
      root cause
      java.lang.ClassNotFoundException: t2
      java.net.URLClassLoader$1.run(URLClassLoader.java:199)
      java.security.AccessController.doPrivileged(Native Method)
      -------------------------------------------------------------------

      My WEB.XML file is:
      -------------------------------------------------------------------
      <web-app>

      <servlet-name>t1</servlet-name>
      <servlet-class>t1</servlet-class>


      <servlet-name>t2</servlet-name>
      <servlet-class>t2</servlet-class>


      <servlet-name>p6</servlet-name>
      <servlet-class>p6</servlet-class>


      <servlet-name>p9</servlet-name>
      <servlet-class>p9</servlet-class>

      <servlet-mapping>
      <servlet-name>t1</servlet-name>
      <url-pattern>/t1/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>t2</servlet-name>
      <url-pattern>/t2/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>p6</servlet-name>
      <url-pattern>/p6/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>p9</servlet-name>
      <url-pattern>/p9/*</url-pattern>
      </servlet-mapping>
      -------------------------------------------------------------------
      NOTE: t1.java and t2.java have "import util.*" in their declarations.
      and p6.java and p9.java have "package util" in their declarations...

      Questions:
      Are all the classes in the right directory?
      Am I using the right FQDN? Fully Qualified Domain Name? in my WEB.XML?
      Any other hints/ relevant informaiton would be appreciated...

      Sincerely,

      HARI

        • 1. Re: javax.servlet.ServletException: Wrapper cannot find serv
          bombay Newbie

          oops small typo... this ADMIN.HTML calls t1.java and not t1.java

          • 2. Re: javax.servlet.ServletException: Wrapper cannot find serv
            bombay Newbie

            oops again small typo... this ADMIN.HTML calls t2.java and not t1.java

            • 3. Re: javax.servlet.ServletException: Wrapper cannot find serv
              bombay Newbie

              I included ALL my class files in UTIL Package and also changed my WEB.XML file to have FQDN for <servlet-class>util.t2</servlet-class> etc but STILL get the same ERROR... wonder why...
              ------------------------------------------------------------------------------- -------------------------------
              09:55:10,642 INFO [Engine] StandardContext[/mhin]Marking servlet t2 as unavailable
              09:55:10,642 ERROR [Engine] StandardContext[/mhin]Error loading org.jboss.web.tomcat.tc5.WebCtxLoader$ENCLoader@247d4a util.t2
              java.lang.ClassNotFoundException: util.t2
              at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
              at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:964)
              at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 144)
              ------------------------------------------------------------------------------- ------

              Any related information on above is appreciated...!

              HARI