【发布时间】:2014-01-04 01:31:32
【问题描述】:
我有一个使用 Eclipse、Struts2 并在 Tomcat 7 服务器上运行的 Web 应用程序。
我已经离开了http://javabrains.koushik.org 教程。
我已经准备好所有基本的 Struts 部件,但由于某种原因,当我将这段 sn-p 代码引入 web.xml 时。
<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>
它把书扔给我。
SEVERE: Dispatcher initialization failed
Unable to load configuration. - bean -
Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean -
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name struts has already been loaded by bean -
SEVERE: Exception starting filter struts2
Unable to load configuration. - bean -
Caused by: Unable to load configuration. - bean -
Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean -
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name struts has already been loaded by bean - jar:file:/C:/Program%20Files%20(x86)/Apache%20Software%20Foundation/Tomcat%207.0/lib/struts2-core-2.3.16.jar!/struts-default.xml:40:72
- bean -
我知道这不是完整的文本转储,但我不知道其余部分会有多大用处。我需要了解它为什么要这样做,这样我才能让它工作。
【问题讨论】:
-
需要更多信息。发布整个 web.xml 和 struts.xml
-
我遇到了同样的错误。但是如果我在 MyEclipse 中运行相同的程序。这是工作。我认为可能存在一些类路径问题。但不确定。
标签: java eclipse tomcat configuration struts2