tomcat一启动就报错,困扰一天了。望帮助
小弟初学Struts2,利用struts2做了个练习。用的是struts2.3.1.2 IDE:MyEclipse8.6.1
启动其他项目没任何问题,就是这struts2才出现问题。tomcat和MyEclipse都重装了,但还是没解决。参照了一些网上的办法,还是没法解决
2012-2-17 17:48:08 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: C:\Program Files (x86)\Java\jdk1.6.0_10\bin;F:\studytools\Tomcat6.0\bin
2012-2-17 17:48:08 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2012-2-17 17:48:08 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 492 ms
2012-2-17 17:48:08 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2012-2-17 17:48:08 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.35
2012-2-17 17:48:09 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: Could not create JarEntryRevision for [jar:file:/G:/training/struts2/WebRoot/WEB-INF/lib/struts2-core-2.3.1.2.jar]!
java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
at com.opensymphony.xwork2.util.FileManager$JarEntryRevision.build(FileManager.java:309)
at com.opensymphony.xwork2.util.FileManager.loadFile(FileManager.java:145)
at com.opensymphony.xwork2.util.FileManager.loadFile(FileManager.java:105)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:935)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:155)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:122)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
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:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
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(ClassLoader.java:320)
... 30 more
2012-2-17 17:48:09 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2012-2-17 17:48:09 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:201)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
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:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
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(ClassLoader.java:320)
... 26 more
2012-2-17 17:48:09 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2012-2-17 17:48:09 org.apache.catalina.core.StandardContext start
严重: Context [/struts2] startup failed due to previous errors
2012-2-17 17:48:09 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2012-2-17 17:48:09 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2012-2-17 17:48:09 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2012-2-17 17:48:09 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2012-2-17 17:48:09 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2012-2-17 17:48:09 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2012-2-17 17:48:09 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2012-2-17 17:48:09 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2012-2-17 17:48:09 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2012-2-17 17:48:09 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/18 config=null
2012-2-17 17:48:09 org.apache.catalina.startup.Catalina start
信息: Server startup in 1035 ms
struts.xml如下:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="struts2" extends="struts-default">
<action name="helloworld" class="com.test.action.HelloWorld">
<result name="success">/helloworld.jsp</result>
</action>
</package>
</struts>
web.xml如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
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">
<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>
</web-app>
在线求助,先道谢啦
[解决办法]
应该是Struts2 的相关包有问题...
[解决办法]
严重: Exception starting filter struts2
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
少东西了。应该是你自己定义的类!
[解决办法]
你试试看只把框架导进去,,,不写任何代码,,,看看运行是不是有问题...
[解决办法]
struts2-core-2.3.1.2.jar重新倒下
这个版本struts还真不知道你的web.xml配置的对不对
[解决办法]
你这是少了文件上传的包
[解决办法]
你jdk重装一下试试,还有环境变量
[解决办法]
几个可能 环境变量 相应的包缺失 类没有编译完全,clean你的工程然后重新编译看看
[解决办法]
加一个commons_lang.jar包
[解决办法]
你先查查org/apache/commons/lang/StringUtils这个类包含在哪个jar包中,然后去网上下载相应的jar包