求高手解决struts2问题
今天早上运行eclipse中的项目突然出现了一个问题说是 没有发现struts-tags 之后我百度了一下 说是随意修改一下保存九可以 我试了一下的确可以了但是有出现了另一个错误,下面是错误代码
2012-4-16 11:18:54 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\Java\jdk1.6.0_10\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;E:/Java/jdk1.6.0_10/bin/../jre/bin/client;E:/Java/jdk1.6.0_10/bin/../jre/bin;E:/Java/jdk1.6.0_10/bin/../jre/lib/i386;E:\Java\jdk1.6.0_10\bin;E:\tomcat6\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;C:\Program Files\Microsoft SQL Server\90\DTS\Binn;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;D:\Program Files\sql server\90\Tools\binn\;D:\Program Files\sql server\90\DTS\Binn\;D:\Program Files\sql server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;E:\MySQL\MySQL Server 5.0\bin;;E:\eclipse;
2012-4-16 11:18:54 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Wfyg' did not find a matching property.
2012-4-16 11:18:54 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Shopping' did not find a matching property.
2012-4-16 11:18:54 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:bookonlin' did not find a matching property.
2012-4-16 11:18:54 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Emt' did not find a matching property.
2012-4-16 11:18:54 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:JavaWeb08' did not find a matching property.
2012-4-16 11:18:54 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2012-4-16 11:18:54 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 471 ms
2012-4-16 11:18:54 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2012-4-16 11:18:54 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.26
2012-4-16 11:18:54 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Wfyg\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2012-4-16 11:18:54 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter//web.xml中<filter-class>修改成什么这就报什么错at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
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:3838)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2012-4-16 11:18:54 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2012-4-16 11:18:54 org.apache.catalina.core.StandardContext start
严重: Context [/Wfyg] startup failed due to previous errors
2012-4-16 11:18:55 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
[解决办法]
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\Java\jdk1.6.0_10\bin;.;
这一句的意思是说你的java环境变量找不到,看看路径配置是否出现问题(环境变量配置完,在doc窗口运行下,看编译,运行能否通过)!这样会引起后面的‘source’资源问题错误。
严重: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
这一句你到的类没错,在struts2中确实导入这个,就看代码写的有误没,有可能就是找不到jar包,还是前面问题引起的,
<!-- Struts2 配置-->
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
[解决办法]
tomcat 清理一下