Hello Konstantin,

The first point you mentioned, I have the <provided> tag. Anyways,I updated
the Tomcat from 6 to 7 and the error went away. But I have another error
now. Its regarding slf4j. Here goes my POM file. I am sorry, I am new to
Maven, having a hard time.

POM file :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>
    <groupId>MavenWeb</groupId>
    <artifactId>MavenWeb</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <description></description>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat6-maven-plugin</artifactId>
                <version>2.0</version>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <repository>
            <id>java.net.m2repo</id>
            <name>java.net Maven 2 Repository</name>
            <url>http://download.java.net/maven/2/</url>
            <layout>default</layout>
        </repository>
    </repositories>
    <properties>
        <spring.version>4.0.1.RELEASE</spring.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>3.1rc2</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.5.5-Final</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-jpa</artifactId>
            <version>4.0.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>4.0.6.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>

        <!-- @Inject -->
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>

        <!-- Servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.0.6.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.6.Final</version>
        </dependency>
        <dependency>
            <groupId>hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.4.0.GA</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>20030825.184428</version>
        </dependency>
        <dependency>
            <groupId>springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>1.2.6</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.8.2</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.7</version>

        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.7.7</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.7</version>

        </dependency>
        <dependency>
            <groupId>tomcat</groupId>
            <artifactId>commons-logging</artifactId>
            <version>4.0.6</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>4.0.6.RELEASE</version>
        </dependency>
    </dependencies>
</project>


On Wed, Sep 3, 2014 at 10:44 AM, Konstantin Kolinko <knst.koli...@gmail.com>
wrote:

> 2014-09-03 11:48 GMT+04:00 Kernel freak <kernelfr...@gmail.com>:
> > 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: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to