[wicket] Wicket 1.5 WEB框架 TOMCAT6下 报错! filterStart

zengmuansha 2011-09-20
搞个HELLO WORLD DEMO 就那么麻烦! 从官方网站web.xml
http://wicket.apache.org/learn/examples/helloworld.html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
    <display-name>Wicket Examples</display-name>
    <filter>
        <filter-name>HelloWorldApplication</filter-name>
        <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
        <init-param>
          <param-name>applicationClassName</param-name>
          <param-value>org.apache.wicket.examples.helloworld.HelloWorldApplication</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>HelloWorldApplication</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

它吗的照抄都无法运行

而下载的lib库里有个DEMO WEB.XML  这个DEMO 就能运行起来 真她们的
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
<display-name>Wicket Examples</display-name>

<context-param>
<param-name>configuration</param-name>
<param-value>deployment</param-value>
</context-param>

    <!--
     Parameter used by Spring to locate its context configuration used for creating
     a WebApplicationContext.
    -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

<filter>
<filter-name>HelloWorldApplication</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
  <param-name>applicationClassName</param-name>
  <param-value>org.apache.wicket.examples.helloworld.HelloWorldApplication</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>HelloWorldApplication</filter-name>
<url-pattern>/helloworld/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
</filter-mapping>

<!-- EVENTS APP -->
<filter>
<filter-name>EventsApplication</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
  <param-name>applicationClassName</param-name>
  <param-value>org.apache.wicket.examples.events.EventsApplication</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>EventsApplication</filter-name>
        <url-pattern>/events/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>HomePageApplication</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

<!-- LISTENER -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- SERVLET -->
<servlet>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>org.apache.wicket.examples.HelloWorldServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/helloworldservlet/*</url-pattern>
</servlet-mapping>

<servlet>
   <servlet-name>ServletTest</servlet-name>
   <servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
   <init-param>
     <param-name>applicationClassName</param-name>
     <param-value>org.apache.wicket.examples.helloworld.HelloWorldApplication</param-value>
   </init-param>
   <load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>ServletTest</servlet-name>
<url-pattern>/servlettest/*</url-pattern>
</servlet-mapping>


<session-config>
<session-timeout>5</session-timeout>
</session-config>
</web-app>

我把这个XML 照抄也不行!  谁遇到该问题 麻烦告知下
zengmuansha 2011-09-20
2011-9-20 15:32:15 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter HelloWorldApplication
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.apache.wicket.protocol.http.WicketFilter.<clinit>(WicketFilter.java:102)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1276)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:625)
at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 33 more
2011-9-20 15:32:15 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2011-9-20 15:32:15 org.apache.catalina.core.StandardContext start
严重: Context [/WebApplication3] startup failed due to previous errors
zengmuansha 2011-09-20
谢谢 我搞定了
添加slf4j-api-1.6.1.jar和slf4j-log4j12-1.6.1.jar即可!
发现下载的WICKET 1.5/LIB 下没.后来在DEMO.WAR 运行后抠出来的.
zengmuansha 2011-09-20
wicket 工作人员麻烦工作认真点
wad12302 2011-09-21
照搬在社会主义国家行不通的!!!
lavakn 2011-09-21
这么简单的问题看不懂????
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at

我看你也不适合搞程序。
魔力猫咪 2011-09-22
这个不能怪wicket。我也遇到过这个问题。
在Netbeans里面就没事情,在Eclipse里面就同样报 java.lang.ClassNotFoundException: org.slf4j.LoggerFactory。
总感觉eclipse的maven插件有问题。
Global site tag (gtag.js) - Google Analytics