CNF org.springframework.web.servlet.DispatcherServlet

时间:2016-07-28 16:16:53

标签: java spring maven spring-mvc

我已添加org.springframework.spring-webmvc-4.3.1.RELEASE并尝试使用3.2.4.RELEASE,即使我收到此错误。

POM

<build>
    <plugins>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>1.4.1.RELEASE</version>
    </dependency>       <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
</dependencies>

错误

SEVERE: Servlet /SpringMVCTutorial threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

任何一个帮助

修改 我在部署程序集中添加了Maven Dependency,我现在收到此错误

错误

SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://maven.apache.org/POM/4.0.0]
Offending resource: ServletContext resource [/WEB-INF/SpringMVC-servlet.xml]

Project Structure

1 个答案:

答案 0 :(得分:0)

如果您的IDE是eclipse,请尝试以下操作。 Source

您需要在部署程序集中添加“Maven依赖关系”

<强> 1。右键单击您的项目并选择属性。 2.单击Deployment Assembly。 第3。点击添加 4.单击“Java Build Path Entries” 的 5。选择Maven Dependencies“ 6.单击“完成”。 的 7。重新构建并再次部署

相关问题