aspose file tools*
The moose likes Struts and the fly likes ClassNotFoundException -->FilterDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ClassNotFoundException -->FilterDispatcher" Watch "ClassNotFoundException -->FilterDispatcher" New topic
Author

ClassNotFoundException -->FilterDispatcher

Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi All,
I'm facing the below problem.Struts 2.0 Exception is as shown below.


Initial Analysis from my side : I have started the Tomcat ServerV5.5,The STRUTS 2.0 Jar has been configured in the eclipse 3.4 build path. when i analysed the struts-core-XXXX.jar file,I was able to locate FilterDispatcher.class file.

But still i'm getting the below exception on starting the tomcat server.Need your help to resolve this.



Please help me to resolve this problem


When The Going Gets Tougher,The Tougher gets Going
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688

Hi..

Please Make sure you have include six jar for basic Struts 2.0 Application.
1 ) struts2-core-2.1.2
2 ) xwork-2.1.1
3 ) freemarker-2.3.12
4 ) ognl-2.6.11
5 ) commons-collections-3.2
6 ) commons-logging-1.1

And also make sure your wex.xml file looks like

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name>Struts2CRUD</display-name>

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</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>
<error-page>
<error-code>404</error-code>
<location>/pagenotfound.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
</web-app>


Thanks,
Nishan Patel.


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507



Please Make sure you have include six jar for basic Struts 2.0 Application.
1 ) struts2-core-2.1.2
2 ) xwork-2.1.1
3 ) freemarker-2.3.12
4 ) ognl-2.6.11
5 ) commons-collections-3.2
6 ) commons-logging-1.1

And also make sure your wex.xml file looks like

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name>Struts2CRUD</display-name>

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</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>
<error-page>
<error-code>404</error-code>
<location>/pagenotfound.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
</web-app>



Please find my comments below

Deepak's Interpretation: See below for details.

all the below jars have been configured in build path.

1 ) struts2-core-2.1.2
2 ) xwork-2.1.1
3 ) freemarker-2.3.12
4 ) ognl-2.6.11
5 ) commons-collections-3.2
6 ) commons-logging-1.1


and web.xml file is containing the below entry as well.

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name>Struts2CRUD</display-name>

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</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>
<error-page>
<error-code>404</error-code>
<location>/pagenotfound.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
</web-app>



NOT WORKING FOR ME,TRIED JUST NOW....
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688

Hi..

FilterDispacher class is xwork jar.

So please check your all jar put in lib floder.

I am sure it is one of your jar problem and check your build path.


Thanks,
Nishan Patel.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Yes,I have included all the jars including xwork.jar.
I have included all 6 jars in a folder called STRUTS2library and configured in the build path...

Should the STRUTS2library be specifically be put in WEB-INF/LIB folder ?
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
All of those jar files need to be in the class path of your server. WEB-INF/lib should be in your class path. So as Nishan said, you should put them there. When I'm not sure if one of my jar files is getting picked up by my application server I try to delete them off of the server. If they are in the class path then the server will put a lock on them and prevent me from deleting them. So if the server is running and I can delete them I know that the server isn't using the jar file for some reason. At least this works on windows based installations of sun/glassfish appservers.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

how should the jar file be configured in eclipse IDE ?
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
How its configured in your IDE isn't really relevant. The problem is Tomcat can't find the jar file. How are you deploying your code from eclipse to Tomcat? I don't any tomcat experience, so if you're trying to deploy to Tomcat using an eclipse plugin that lets you configure the deploy throught eclipse I probably can't be much help.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688

Hi ..

first of all Check your project is web project or not ?

If yes, Your web project contains WebRoot/WEB-INF/lib.

Just copy all jar file and past in this folder in your eclipse IDE..

Then select all your Jars and Right click on it and Select option Build Path -> select Add to Build Path.

Then restart your Server.And check again.


Thanks,
Nishan Patel.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi i did as you instructed, The build path is set properly,but my tomcat server on startup is giving the below exception...



Help me resolve this.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688

Hi..

I think your server not found your Jdk installation.

first install properly JDK and set your call path usinf Environment Variable.

Then configure tomcat in your eclipse and give it to Jdk path.


Thanks,
Nishan Patel.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507


Nishan wrote ::
Hi..

I think your server not found your Jdk installation.

first install properly JDK and set your call path usinf Environment Variable.

Then configure tomcat in your eclipse and give it to Jdk path.


Thanks,
Nishan Patel.



My interpretation :
1>Tomcat server is able to find jdk 1.5 installation--fine
2>eclipse IDE is configured properly to take the jdk path...


I'm getting the error
Oct 24, 2008 11:01:42 AM org.apache.jk.common.MsgAjp processHeader
SEVERE: BAD packet signature 18245

which is related to something else....what could it be???



--
Deepak lal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassNotFoundException -->FilterDispatcher