2014-09-03 11:48 GMT+04:00 Kernel freak <[email protected]>:
> Hello guys,
>
> I am working on a maven project. I have already asked this question on
> stackoverflow, but many believe it has something to do with Apache tomcat
> giving a problem. Whenever I run the project, it says, project threw a
> load() exception. Below is the link for my project structure, let me know
> if anything else is needed. The image has error log as well.
>
> Stackoverflow link :
> http://stackoverflow.com/questions/25625289/spring-servlet-not-available/25627240#25627240
>
> OS : Ubuntu 13.10
> Eclipse Kepler
> Apache tomcat 6.0
> tomcat-maven plugin added.
>
> Image Link : http://pasteboard.co/2KhtgMb6.png
1. Your exact version of Tomcat 6.0.x = ?
2. Obvious errors:
1)
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4.public_draft</version>
</dependency>
A(. You must use <scope>provided</scope> here. A web application is
not allowed to bundle its own copy of Servlet API. The JAR shall be
provided by Tomcat. Thus the scope.
B). The <version> value is rather wrong. A "public draft" is draft
version of API that one shall not use.
With Tomcat 6 you can use version 2.5,
http://search.maven.org/#artifactdetails|javax.servlet|servlet-api|2.5|jar
or the version provided by Tomcat version that you are using
http://search.maven.org/#artifactdetails|org.apache.tomcat|servlet-api|6.0.41|jar
2) Use the same version for all you Spring dependencies. (You mix
4.0.1.RELEASE with
4.0.3.RELEASE and 4.0.6.RELEASE )
Do you have a similar versions mix with Hibernate? Why some "release
candidate 2" version there?
3. Build a war file and look for what jars are in its WEB-INF/lib directory.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]