0

我想在我的 Web 应用程序中使用带有 struts2 的磁贴和碧玉插件,但是在部署应用程序时出现错误。做谷歌后,我发现我的应用程序中有插件版本不匹配。

当我使用struts2 2.2.3 和 jasper 插件时,它不起作用。但是当我使用struts2 2.1.8 和 jasper时,它的工作正常。然后我决定使用集成瓦片与 struts 2.1.8 并在部署时出错

SEVERE: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.apache.struts2.tiles.StrutsTilesListener
4

2 回答 2

2

Nutshell: whatever versions are used by the Struts 2.2.3 Tiles and Jasper plugins.

That it's being asked means you're not using Maven, instead managing transitive dependencies by hand--this is almost always a Really Bad Idea. Can't urge you strongly enough to not do this.

Long answer: When you have questions like this, use the Maven config files and/or Maven itself to find the answers, because that's how Struts 2 is being built.

You can use sites like http://mvnrepository.com when the info is explicit in the pom.

Struts 2 JasperReports Plugin Dependencies: JasperReports 3.1.2

Struts 2 Tiles Plugin Dependencies: Tiles 2.0.6, but not as easy to figure out since the Tiles version isn't explicit in the POM. Running mvn dependency:tree shows that it's 2.0.6:

[INFO] org.apache.struts:struts2-tiles-plugin:jar:2.2.3
[INFO] +- org.apache.tiles:tiles-core:jar:2.0.6:compile
[INFO] |  +- org.apache.tiles:tiles-api:jar:2.0.6:compile
[INFO] |  +- commons-digester:commons-digester:jar:2.0:compile (version managed from 1.8)
[INFO] |  |  \- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] |  \- commons-logging:commons-logging-api:jar:1.1:compile
[INFO] +- org.apache.tiles:tiles-jsp:jar:2.0.6:runtime
... etc ...
于 2012-06-16T13:59:20.070 回答
0

出现上述问题是由于插件与struts版本不兼容。选择与 struts 版本匹配的插件。升级你的碧玉插件。

给你下载链接

http://www.java2s.com/Code/Jar/s/Downloadstruts2jasperreportsplugin223jar.htm

于 2016-03-18T11:34:51.567 回答