Spring MVC - HTTP Status 500 - Servlet.init() for servlet loginDispacher threw exception

后端 未结 3 696
情书的邮戳
情书的邮戳 2021-01-14 02:12

I have made a simple program but getting following error. I am using Eclipse Kelper and Tomcat 7.0. Tried a lot of things, but nothing is working for me :(

相关标签:
3条回答
  • 2021-01-14 02:22

    Try to change your spring framework version in pom.xml to 4.1.5 Just add this before your dependencies

    <properties>
        <spring.version>4.1.5.RELEASE</spring.version>
    </properties>
    
    0 讨论(0)
  • 2021-01-14 02:43
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">  
    

    Both web.xml and applicationContext.xml xsd should be the same. Please change once.

    0 讨论(0)
  • 2021-01-14 02:44

    Add this code in your web.xml

    <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/loginDispacher-servlet.xml</param-value>
     </init-param>
    

    And this ligne code in your loginDispacher-servlet.

    <context:annotation-config />
    

    In the following share examples with spring mvc : link

    0 讨论(0)
提交回复
热议问题