Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven Project Build Error

 
Faisal Fuad
Ranch Hand
Posts: 85
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic