wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Project Build Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven Project Build Error" Watch "Maven Project Build Error" New topic
Author

Maven Project Build Error

Faisal Fuad
Ranch Hand

Joined: Jul 05, 2011
Posts: 79

Hi, I was trying to run one sample example on Maven Spring framework based on Mkyong.com. But having this following 3 errors:

1) Type: Maven Configuration Problem: An error occurred while filtering resources
2) Type: Spring Beans Problem: Configuration problem: spring-security-web classes are not available. You need these to use <filter-chain-map>
Offending resource: file [C:/******/******/Desktop/Spring Examples/SpringMVC/src/main/webapp/WEB-INF/spring-security.xml]
3) Type: Spring Beans Problem: spring-security-web classes are not available. You need these to use <filter-chain-map>

Please help me to find my mistake(s). Thanks a lot

a) pom.xml is as follows:

b) mvc-dispatcher-servlet.xml is as follows:

c) spring-security.xml is as follows:

NOTE: Here I am getting the Error sign (Red Cross)
I did check my local repository (C:\******\*******\.m2\repository\org\springframework\security) and there I found everything nice and set. Then where is the problem

1) spring-security-config-3.0.5.RELEASE.jar (C:\******\*******\.m2\repository\org\springframework\security\spring-security-config\3.0.5.RELEASE)
2) spring-security-core-3.0.5.RELEASE.jar (C:\*******\*******\.m2\repository\org\springframework\security\spring-security-core\3.0.5.RELEASE)
3) spring-security-web-3.0.5.RELEASE.jar (C:\*******\*******\.m2\repository\org\springframework\security\spring-security-web\3.0.5.RELEASE)

NOTE: All the necessary POM files are there as well
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Are these compiler errors or maven errors or what? It might be best if you posted the the exact output from maven (paraphrasing error messages is usually counter-productive).


JBoss In Action
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

Probably best to go onto command line, navigate to the root directory of your project (where pom.xml resides) and type:

mvn clean install

What output do you get from this?
Faisal Fuad
Ranch Hand

Joined: Jul 05, 2011
Posts: 79

Peter: Those are Spring Beans Problems. And now I am seeing big red cross in my Project Explorer on top of "spring-security.xml" (which is under src/webapp/WEB-INF). {Is there any way I can share Image in this forum?} By the way, the descriptions of all those problems I am seeing under "Problems" tab in Eclipse where it says:
======
Errors (2 items)
Configuration problem: spring-security-web classes are not available. You need these to use <filter-chain-map>
Offending resource: file [C:/Users/qshoywe/Desktop/Spring Examples/SpringMVC/src/main/webapp/WEB-INF/spring-security.xml]
and
spring-security-web classes are not available. You need these to use <filter-chain-map>

Resource: spring-security.xml
Path: SpringMVC/src/main/webapp/WEB-INF
Location: Line 8
Type: Spring Beans Problem
======

James: I did follow your instruction and interesting thing is although in eclipse still having those above errors but this time I did copy the Maven created WAR file (previously also that was created) and deploied it in Tomcat (Couldn't do in WebSphere). And this time the sample was running nicely on browser.

By the way, after running "mvn clean install", I was seeing as follows:

=====

=====

>> Big question is why those red cross signs are still appearing in my eclipse project explorer? Do you think I am missing any Config issue or Jar or something which can suppress those errors?

Thanks a lot as always
Faisal Fuad
Ranch Hand

Joined: Jul 05, 2011
Posts: 79

Now I can deploy that WAR in WebSphere. My eclipse is working like a Ghost. It has it's own mood than I do.....ah!
Still seeing those Errors though
Faisal Fuad
Ranch Hand

Joined: Jul 05, 2011
Posts: 79

Hi...it is done Problem was "missing JARs"! True. I got nice hints from this following URL:
http://stackoverflow.com/questions/7402144/configuration-problem-spring-security-web-classes-are-not-available-you-need-t

As soon as I added following 3 JARs in the ClassPath (besides other Maven Dependencies), everything was fine, running without any Errors.

a) commons-logging-1.0.4.jar
b) javax.servlet-api-3.0.1.jar
c) jstl-1.2.jar

Thanks a lot
 
jQuery in Action, 2nd edition
 
subject: Maven Project Build Error
 
Similar Threads
Could not resolve dependencies for maven project
Missing CXF plugins??
Spring 3.0.2 and Active MQ 5.4.1 Issues
Spring Major version '3' expected
Error slf4j-api, I can't exclude slf4j-api for Jboss