Solved

ClassNotFoundException  error

Posted on 2014-02-27
11
1,348 Views
Last Modified: 2014-03-02
I am deploying a web application in Eclipse IDE and Jboss 7 . I get this error in server console:

15:32:14,423 WARN  [org.jboss.as.ee] (MSC service thread 1-6) JBAS011006: Not installing optional component org.apache.struts2.dispatcher.FilterDispatcher due to exception: java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher from [Module "deployment.SampleApp.war:main" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
      at org.



relevant web.xml entry:

<filter id="filterdispatcher">
            <filter-name>Struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
                  <init-param>
                        <param-name>packages</param-name>
                        <param-value>images</param-value>
                </init-param>
      </filter>

      <filter-mapping>
            <filter-name>Struts2</filter-name>
            <url-pattern>/*</url-pattern>
      </filter-mapping>




I have already verified that web application's  WEB-INF/lib folder  has struts2-core-2.1.2.jar  ...and there is org.apache.struts2.dispatcher.FilterDispatcher present in this jar .

why this error then and how to fix this error ?
0
Comment
Question by:cofactor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
11 Comments
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 39891443
Please Make sure you have include six jar for basic Struts 2.0 Application.i think xwork-2.1.1.ja is necccssary .i think FilterDispatcher  is deprecated in struts2-core


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

http://stumblingintojava.wordpress.com/2010/09/15/classnotfoundexception-filterdispatcher-struts2-in-eclipse/
0
 

Author Comment

by:cofactor
ID: 39891454
yes..they are already there.


>>>i think xwork-2.1.1.ja is necccssary .

I have xwork-core-2.3.15.1.jar
0
 

Author Comment

by:cofactor
ID: 39891455
>>>>i think FilterDispatcher  is deprecated in struts2-core

This class is present in struts2-core-2.1.2.jar

error says  java.lang.ClassNotFoundException:org.apache.struts2.dispatcher.FilterDispatcher
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:CEHJ
ID: 39891460
http://technojeeves.com/index.php/aliasjava1/7-jarsearch

Point the above at your WEB-INF/lib directory with parameter FilterDispatcher and tell us what you get
0
 

Author Comment

by:cofactor
ID: 39891461
>>>I have xwork-core-2.3.15.1.jar

no, I have xwork-2.1.1.jar   ..typo
0
 

Author Comment

by:cofactor
ID: 39891465
>>>>http://technojeeves.com/index.php/aliasjava1/7-jarsearch

where is  jarsearch.jar  in that link ?  there is no download link to download this utility in that page.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 39891470
Yes, the link is in the page:

http://technojeeves.com/tech/jarsearch.jar

You can download the jar file HERE
0
 

Author Comment

by:cofactor
ID: 39891505
>>>Point the above at your WEB-INF/lib directory with parameter FilterDispatcher and tell us what you get



I found the issue ....I had lib   folder outside  WEB-INF  i.e  SampleApp/lib

now I cut this lib folder and pasted into  SampleApp/WEB-INF/lib ....then eclipse clean build


Now  build error has come up in eclipse ...

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project      SampleApp            Unknown      Java Problem
0
 
LVL 20

Assisted Solution

by:chaitu chaitu
chaitu chaitu earned 150 total points
ID: 39891530
clean the project using eclipse options-Project-Clean Project
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39891595
Cannot find the class file for java.lang.Object.
Make sure you have the jdk set correctly in the build path. Sounds like you might have removed something during your repair
0
 

Author Comment

by:cofactor
ID: 39899468
issue resolved.

it was a  classpath issue.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question