使用Tiles的Struts 2应用程序中的错误:java.lang.NoClassDefFoundError:org/apache/tiles/listener/TilesListener [英] Error in Struts 2 app with Tiles: java.lang.NoClassDefFoundError: org/apache/tiles/listener/TilesListener
问题描述
尽管我已经为Tiles放置了必要的jar文件,但我遇到了此错误:
I am getting this error, although I've already put necessary jar files for Tiles:
SEVERE: Exception while loading the app
SEVERE: Undeployment failed for context /FinalTilesStruts2
SEVERE: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
java.lang.IllegalArgumentException:
java.lang.NoClassDefFoundError: org/apache/tiles/listener/TilesListener
推荐答案
仅在Tiles 2.0.3中可用的类 org.apache.tiles.listener.TilesListener
,您可以下载此处.
The class org.apache.tiles.listener.TilesListener
only available in the Tiles 2.0.3 that you can download here.
在更高版本的Tiles中,侦听器类为 org.apache.tiles.web.startup.TilesListener
.
In higher versions of Tiles the listener class is org.apache.tiles.web.startup.TilesListener
.
如果可以帮助您解决正确的侦听器类的问题,则可以阅读此答案.
You can read this answer if it help you resolve problem with the right listener class.
如果将Tiles 2与Struts 2一起使用,则应使用
If you are using Tiles 2 with Struts 2 then you should use
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
这篇关于使用Tiles的Struts 2应用程序中的错误:java.lang.NoClassDefFoundError:org/apache/tiles/listener/TilesListener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!