java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher
If you have…
1.Included all necessary jars.
2.Configured build path correctly.
3.Added them all in deployment assembly Correctly.
Then also you getting “Java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher” error then you could be doing below things wrong.
solution:
check your struts2-core-x.x.jar version.
1__.if it is struts2-core-2.5.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
</filter-class>
2__.if it is struts2-core-2.1.3.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
FilterDispatcher is deprecated since Struts 2.1.3. If you are working with older versions then user above solution.
3__.if it is struts2-core-2.3.X.jar then change your filter class tag value in web.xml to
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
Reason behind all this is struts 2 controllers are placed in different location in different version of struts2-core jar and some time they are called by different name as you can see in 2.1.3.