一尘不染

执行教程时的Tomcat错误

tomcat

我正在执行http://viralpatel.net/blogs/tutorial-create-struts-2-application-
eclipse-example/中的教程中的代码,但出现以下错误

janv. 09, 2014 11:20:02 AM org.apache.struts2.dispatcher.Dispatcher error
Grave: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/K:/sop/java/code/.
metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/StrutsHelloWorld/W
EB-INF/lib/struts2-core-2.3.16.jar!/struts-default.xml:64:179
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatche
r.java:445)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperation
s.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(S
trutsPrepareAndExecuteFilter.java:57)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilte
rConfig.java:281)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilter
Config.java:262)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterCon
fig.java:107)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:47
75)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5452)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
59)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
49)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: Unable to load bean: type:org.apache.struts2.dispatcher.multipart.Mul
tiPartRequest class:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequ
est - bean - jar:file:/K:/sop/java/code/.metadata/.plugins/org.ecli
pse.wst.server.core/tmp0/wtpwebapps/StrutsHelloWorld/WEB-INF/lib/struts2-core-2.
3.16.jar!/struts-default.xml:64:179
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(X
mlConfigurationProvider.java:245)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlC
onfigurationProvider.java:102)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(Def
aultConfiguration.java:234)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rationManager.java:67)
    ... 16 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUpl
oadBase$SizeLimitExceededException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getDeclaredConstructors(Unknown Source)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(X
mlConfigurationProvider.java:235)
    ... 19 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileU
ploadBase$SizeLimitExceededException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1702)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1547)
    ... 23 more

我使用的jar是:

  • commons-logging-1.1.3.jar
  • commons-lang3-3.1.jar
  • commons-logging-1.1.3.jar
  • freemaker-2.3.19.jar
  • javassist-3.11.0.GA.jar
  • ongl-3.0.6.jar
  • struts2-core-2.3.16.jar
  • xwork-core-2.3.16.jar

有人可以告诉我我错了吗?是Tomcat服务器吗?是代码吗?

另一个问题是,我尝试在Internet上尝试更多教程,并且每次在将struts2应用于网页时遇到错误。有人可以告诉我Tomcat我缺少什么吗?

PS我正在使用Eclipse kepler,这可能是问题吗?


阅读 213

收藏
2020-06-16

共1个答案

一尘不染

Javassist库丢失。您可以从Maven下载它,以下是链接。这是在异常本身中提到的:)

http://mvnrepository.com/artifact/javassist/javassist

2020-06-16