Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuterFilter

Tags:

java

struts2

I copied all struts2 jars to the WEB-INF/lib folder and the struts.xml file is as shown below:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">*

I'm still getting this exception while running the application.
How can I solve this?

like image 268
user1581439 Avatar asked Dec 15 '22 16:12

user1581439


1 Answers

For new release of Struts2 class path changed as like below (Struts 2.5)

org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

Package names have changed Some classes were moved to different packages, see the list below for more details:


New:


org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
org.apache.struts2.dispatcher.filter.StrutsExecuteFilter
org.apache.struts2.dispatcher.filter.StrutsPrepareFilter
org.apache.struts2.dispatcher.listener.StrutsListener
org.apache.struts2.result.ServletRedirectResult
com.opensymphony.xwork2.interceptor.ValidationAware 

Old:


org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
org.apache.struts2.dispatcher.ng.listener.StrutsListener
org.apache.struts2.dispatcher.ServletRedirectResult
com.opensymphony.xwork2.ValidationAware 

For More Detail Click Here

like image 194
sujith s Avatar answered May 08 '23 18:05

sujith s