I had a problem similar to this (java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener), the difference in my case is that the common fix (addi
This kind of problem is solved by:
m2e
and m2e-wtp
plugins. This is done by going to "Help > Install New Software...", setting this URL for m2e
and this URL for m2e-wtp
and then installing every proposed software (don't forget to reboot Eclipse after that).war
through the "Add and Remove..." screen.I recommend you do all these steps on a fresh Eclipse install to avoid general caching issues.
As a side note, there are several problems with your POM as-is:
javax.servlet:javax.servlet-api
dependency needs to have the provided
scope since this dependency is always provided by the web-server at run-time.javax.servlet:jstl
dependency probably doesn't need to have the compile
scope and runtime
will suffice.spring-aop
, spring-beans
, spring-context
, spring-expression
, spring-tx
and spring-web
.test
scope (testng
, mockito-all
...)true
is unnecessary in your maven-compiler-plugin
declaration as this is the default.Final POM would be:
4.0.0
ctc.web.proyect
front.web
war
0.2.5
front.web
UTF-8
3.1.0
1.2
4.1.5.RELEASE
2.1.4.RELEASE
2.5.3
5.1.30
0.9.1.2
1.1.1
1.7.7
6.8.8
3.3.2
1.9.5
2.2.2
18.0
1.4.1
1.4.7
1.8.6
5.3.0
javax.servlet
jstl
${javax.servlet.jstl}
runtime
javax.servlet
javax.servlet-api
${javax.servlet.version}
provided
org.springframework
spring-core
${org.springframework.version}
commons-logging
commons-logging
org.springframework
spring-context-support
${org.springframework.version}
org.thymeleaf
thymeleaf-spring4
${thymeleaf.version}
org.springframework
spring-jdbc
${org.springframework.version}
org.springframework
spring-oxm
${org.springframework.version}
org.springframework
spring-webmvc
${org.springframework.version}
org.springframework
spring-test
${org.springframework.version}
test
com.fasterxml.jackson.core
jackson-databind
${jackson.version}
mysql
mysql-connector-java
${mysql.version}
ch.qos.logback
logback-classic
${logback.version}
org.slf4j
jcl-over-slf4j
${slf4j.version}
org.slf4j
slf4j-api
${slf4j.version}
org.slf4j
slf4j-log4j12
${slf4j.version}
c3p0
c3p0
${c3p0.version}
org.apache.commons
commons-lang3
${commons-lang3.version}
commons-validator
commons-validator
${commons-validator.version}
commons-logging
commons-logging
com.google.guava
guava
${guava.version}
org.testng
testng
${testng.version}
test
org.mockito
mockito-all
${mockito.version}
test
cglib
cglib
${cglib.version}
javax.mail
mail
${javax.mail.version}
org.aspectj
aspectjrt
${org.aspectj.version}
org.aspectj
aspectjweaver
${org.aspectj.version}
org.apache.lucene
lucene-analyzers-common
${apache.lucene.version}
org.apache.lucene
lucene-queryparser
${apache.lucene.version}
com.google.api-client
google-api-client
1.20.0
commons-logging
commons-logging
ROOT
org.apache.maven.plugins
maven-compiler-plugin
2.3.2
1.8
The other consideration you might want to fix is that your groupId
and artifactId
do not follow Maven conventions: prefer using -
as separator instead of .
.