因此,从我读到的内容来看,这应该很容易执行。我遵循了与创建 application.xml 文件时类似的设置。
<application>
<display-name>test</display-name>
<module>
<web>
<web-uri>foo.war</web-uri>
<context-root>foo</context-root>
</web>
</module>
<module>
<web>
<web-uri>bar.war</web-uri>
<context-root>bar</context-root>
</web>
</module>
</application>
我已经在这个 JVM 中分别测试了这两个应用程序,它们运行良好......但是当放在一起时,我遇到了 struts 2 错误(这两个应用程序都是使用 struts 2 框架创建的),我不确定是什么失踪。错误如下
[Servlet Error]-[Filter [struts2]: could not be initialized]: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - wsjar:file:<my filepath>/WEB-INF/lib/struts2-core-2.0.14.jar!/struts-default.xml:30:72
有什么想法吗?
*编辑所以我一直在阅读此错误可能是因为您在 WEB-INF/lib 目录中有冲突的 struts2 jars(或者它们在两个地方加载)。虽然我认为这不是问题,因为这些罐子在不同的 WAR 中。