java.lang.NoClassDefFoundError: com/opensymphony/xwork2/config/FileManagerProvider



I have done a project using struts2. Now I am trying to incorporate tiles into my project, so I started learning tiles. I am getting following error in console while building my first sample pages itself.



SEVERE: Exception starting filter struts2
java.lang.NoClassDefFoundError: com/opensymphony/xwork2/config/FileManagerProvider
at org.apache.struts2.dispatcher.Dispatcher.init_FileManager(Dispatcher.java:352)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:481)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4809)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5485)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1862)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.opensymphony.xwork2.config.FileManagerProvider
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 20 more


Going over Internet I thought error may be because of jars I am using... So I am posting my jars too.


enter image description here


My struts.xml file is



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://ift.tt/1iwXH3l">

<struts>

<package name="default" extends="struts-default">


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

<action name="*Link" method="{1}" class="com.classes.JustJsps">
<result name="welcome" type="tiles">welcome</result>
<result name="login" type="tiles">login </result>
</action>

</package>
</struts>


My tiles.xml file is



<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://ift.tt/19E1atl">
<tiles-definitions>
<definition name="welcome" template="/baseLayout.jsp">
<put-attribute name="title" value="DReST" type="string" />
<put-attribute name="myHeader" value="/head.jsp"/>
<put-attribute name="myMenu" value="/menu.jsp"/>
<put-attribute name="myBody" value="/home.jsp"/>
<put-attribute name="myFooter" value="/footer.jsp"/>
</definition>
<definition name="login" extends="welcome">
<put-attribute name="myBody" value="/login.jsp"/>
</definition>
</tiles-definitions>


My web.xml is



<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://ift.tt/ra1lAU"
xmlns="http://ift.tt/nSRXKP"
xsi:schemaLocation="http://ift.tt/nSRXKP http://ift.tt/QkDjq3 /javaee/web-app_3_0.xsd"
id="WebApp_ID"
version="3.0">

<display-name>Tiles</display-name>
<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>


<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>


index.jsp



<META HTTP-EQUIV="Refresh" CONTENT="0;URL=welcomeLink.action">


welcomeLink.action returns 'welcome'. What is the mistake I am doing?


No comments:

Post a Comment