1

I am trying to use Tile plugin in my struts2 application, but I am receiving the following error,

"Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener. Please see server.log for more details."

I have the following jar files:

tiles-api-3.0.1.jar
tiles-autotag-core-runtime-1.1.0.jar
tiles-compat-3.0.1.jar
tiles-core-3.0.1.jar
tiles-el-3.0.1.jar
tiles-extras-3.0.1.jar
tiles-freemarker-3.0.1.jar
tiles-jsp-3.0.1.jar
tiles-mvel-3.0.1.jar
tiles-ognl-3.0.1.jar
tiles-request-api-1.0.1.jar
tiles-request-freemarker-1.0.1.jar
tiles-request-jsp-1.0.1.jar
tiles-request-mustache-1.0.1.jar
tiles-request-servlet-1.0.1.jar
tiles-request-servlet-wildcard-1.0.1.jar
tiles-request-velocity-1.0.1.jar
tiles-servlet-3.0.1.jar
tiles-template-3.0.1.jar
tiles-velocity-3.0.1.jar
commons-beanutils-1.8.0.jar
commons-digester-2.0.jar
jcl-over-slf4j-1.5.8.jar
slf4j-api-1.5.8.jar

Web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
        <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
        <param-value>/WEB-INF/tiles.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
    </listener>
    <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>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

Struts.xml

<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
    <!-- Configuration for the default package. -->
    <package name="default" extends="struts-default">

        <result-types>
            <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>
        </result-types>
        <action name="register">
            <result type="tiles">register</result>
        </action>
    </package>


</struts>

My struts library files

Struts 2.3.4 Core Libraries - xwork-core-2.3.4.jar
Struts 2.3.4 Core Libraries - struts2-core-2.3.4.jar
Struts 2.3.4 Core Libraries - struts2-convention-plugin-2.3.4.jar
Struts 2.3.4 Core Libraries - ognl-3.0.5.jar
Struts 2.3.4 Core Libraries - javassist-3.11.0.GA.jar
Struts 2.3.4 Core Libraries - freemarker-2.3.19.jar
Struts 2.3.4 Core Libraries - commons-lang3-3.1.jar
Struts 2.3.4 Core Libraries - commons-io-2.0.1.jar
Struts 2.3.4 Core Libraries - commons-fileupload-1.2.2.jar
Struts 2.3.4 Core Libraries - asm-tree-3.3.jar
Struts 2.3.4 Core Libraries - asm-commons-3.3.jar
Struts 2.3.4 Core Libraries - asm-3.3.jar
Daniel Morgan
  • 782
  • 5
  • 15
  • 43
  • Have you added the new struts2-tiles3 plugin? https://cwiki.apache.org/confluence/display/WW/Tiles+3+Plugin how are you managing dependencies, maven? – Quaternion Feb 08 '13 at 00:53
  • I also see you have the conventions plugin in place... once you get basic functionality working let me know, I might suggest a method to tie struts2 into conventions. – Quaternion Feb 08 '13 at 00:56
  • @Quaternion, I have downloaded and added the struts2-tiles-plugin-2.2.3.1.jar but it does not work yet. – Daniel Morgan Feb 08 '13 at 00:58
  • Well download netbeans and follow this step by step guide: http://stackoverflow.com/questions/5718418/struts2-netbeans-7, which will get all the resources using maven... it will download all the required jars... then you can take the jars and put them into your own project. You'll also very quickly realize why maven is so awesome. – Quaternion Feb 08 '13 at 01:07
  • Oh the above does not address adding that particular plugin but the first link spells out the maven co-ordinates and the second link explains how to use them. You'll easily figure it out. – Quaternion Feb 08 '13 at 01:09
  • @Quaternion, yes I tried but got confused as it found many files except the one I am looking for. – Daniel Morgan Feb 10 '13 at 22:44
  • The jars that maven obtains are all dependencies... what is confusing? If you are missing any, your program will not work. – Quaternion Feb 10 '13 at 23:17
  • 1
    If it is still not working I'll supply a dump of all dependencies in a minimal struts2 + tiles3 _ struts2-conventions-plugin application... – Quaternion Feb 14 '13 at 23:05

0 Answers0