首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

struts基础有关问题

2013-09-11 
struts基础问题。小弟运行时出现了错误,网上的方法试了很多,还是没解决,求教各位大大。2011-5-11 20:41:41 o

struts基础问题。
小弟运行时出现了错误,网上的方法试了很多,还是没解决,求教各位大大。

2011-5-11 20:41:41 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: G:\eclipse\myEclipse\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;G:\tomcat\bin
2011-5-11 20:41:41 org.apache.coyote.AbstractProtocolHandler init
信息: Initializing ProtocolHandler ["http-bio-8080"]
2011-5-11 20:41:41 org.apache.coyote.AbstractProtocolHandler init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
2011-5-11 20:41:41 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 433 ms
2011-5-11 20:41:41 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
2011-5-11 20:41:41 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.12
2011-5-11 20:41:41 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory aaa
2011-5-11 20:41:41 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2011-5-11 20:41:41 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory manager
2011-5-11 20:41:41 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2011-5-11 20:41:41 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory struts
2011-5-11 20:41:42 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2011-5-11 20:41:42 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:198)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
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:380)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
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.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4562)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5240)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5235)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)


at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 20 more
2011-5-11 20:41:42 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
2011-5-11 20:41:42 org.apache.catalina.core.StandardContext startInternal
严重: Context [/struts] startup failed due to previous errors
2011-5-11 20:41:42 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory struts2
2011-5-11 20:41:42 org.apache.coyote.AbstractProtocolHandler start
信息: Starting ProtocolHandler ["http-bio-8080"]
2011-5-11 20:41:42 org.apache.coyote.AbstractProtocolHandler start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
2011-5-11 20:41:42 org.apache.catalina.startup.Catalina start
信息: Server startup in 1038 ms
web.xml

XML code
<?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>      <welcome-file-list>    <welcome-file>index.jsp</welcome-file>  </welcome-file-list></web-app>

struts.xml
XML code
<?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></struts>

是不是少了什么包啊?
我现在已经导入了fileupload,io,logging,freemarker,ognl,struts2-core-2.2.3,xwork这几个包。

[解决办法]
commons-lang.jar
[解决办法]
请问lz用的jdk的版本?1.6是自带的commons包。不然就导入commons包吧!

热点排行