1 Reply Latest reply on Apr 25, 2009 6:36 AM by kinson jiang

    How I can not find my servlet class in the seam application?

    kinson jiang Newbie
      I use seam tool to generate a simple war application in the eclipse enviroment. Then generate TestServlet. then get error, I can not see any diffrent with example seamspace.

      package org.domain.seamtest.session;

      public class TestServlet extends HttpServlet { }

      web.xml

      display-name>seamtest</display-name>
        <welcome-file-list>
          <welcome-file>index.html</welcome-file>
          <welcome-file>index.htm</welcome-file>
          <welcome-file>index.jsp</welcome-file>
          <welcome-file>default.html</welcome-file>
          <welcome-file>default.htm</welcome-file>
          <welcome-file>default.jsp</welcome-file>
        </welcome-file-list>
        <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.seam</url-pattern>
        </servlet-mapping>
        <context-param>
          <param-name>org.richfaces.SKIN</param-name>
          <param-value>blueSky</param-value>
        </context-param>
        <listener>
          <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
        </listener>
        <filter>
          <filter-name>Seam Filter</filter-name>
          <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
        </filter>
        <filter-mapping>
          <filter-name>Seam Filter</filter-name>
          <url-pattern>/*</url-pattern>
        </filter-mapping>
        <servlet>
          <servlet-name>Seam Resource Servlet</servlet-name>
          <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
        </servlet>
        <servlet-mapping>
          <servlet-name>Seam Resource Servlet</servlet-name>
          <url-pattern>/seam/resource/*</url-pattern>
        </servlet-mapping>
        <context-param>
          <param-name>facelets.DEVELOPMENT</param-name>
          <param-value>true</param-value>
        </context-param>
        <context-param>
          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
          <param-value>.xhtml</param-value>
        </context-param>
        <security-constraint>
          <display-name>Restrict raw XHTML Documents</display-name>
          <web-resource-collection>
            <web-resource-name>XHTML</web-resource-name>
            <url-pattern>*.xhtml</url-pattern>
          </web-resource-collection>
          <auth-constraint/>
        </security-constraint>
        <servlet>
          <servlet-name>Content Servlet</servlet-name>
          <servlet-class>org.domain.seamtest.session.TestServlet</servlet-class>
        </servlet>
        <servlet-mapping>
          <servlet-name>Content Servlet</servlet-name>
          <url-pattern>/test/*</url-pattern>
        </servlet-mapping>


      I try  http://localhost/seamtest/test/    get errors:

      HTTP Status 500 -

      --------------------------------------------------------------------------------

      type Exception report

      message

      description The server encountered an internal error () that prevented it from fulfilling this request.

      exception

      javax.servlet.ServletException: Wrapper cannot find servlet class org.domain.seamtest.session.TestServlet or a class it depends on
           org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
           org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
           org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
           org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
           java.lang.Thread.run(Unknown Source)


      root cause

      java.lang.ClassNotFoundException: org.domain.seamtest.session.TestServlet
           java.net.URLClassLoader$1.run(Unknown Source)
           java.security.AccessController.doPrivileged(Native Method)
           java.net.URLClassLoader.findClass(Unknown Source)
           java.lang.ClassLoader.loadClass(Unknown Source)
           java.lang.ClassLoader.loadClass(Unknown Source)
           org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
           org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
           org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
           org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
           java.lang.Thread.run(Unknown Source)


      note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.