Status 500 - Servlet.init() for servlet springMVC threw exception的错误原因
2017-08-17 22:22
573 查看
在学spring mvc时加入
后报Status 500 - Servlet.init() for servlet springMVC threw exception错误,而且
会标红报错,
经过研究后我发现原因是:一开始spring的配置文件是idea帮忙创建,没有配好xsd文件
正确配好后为:
然后错误就解决了。
一般来说,出现这个错误是因为你的配置文件出现错误,要仔细检查配置文件还有没有其他错误。
<mvc:annotation-driven/> <!-- 使用默认的Servlet来响应静态文件 --> <mvc:default-servlet-handler/>
后报Status 500 - Servlet.init() for servlet springMVC threw exception错误,而且
<mvc:default-servlet-handler/>
会标红报错,
经过研究后我发现原因是:一开始spring的配置文件是idea帮忙创建,没有配好xsd文件
正确配好后为:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"> </beans>上面的4.2是我的spring版本,我用的是4.2.0版本。
然后错误就解决了。
一般来说,出现这个错误是因为你的配置文件出现错误,要仔细检查配置文件还有没有其他错误。
相关文章推荐
- 出现 HTTP Status 500 - Servlet.init() for servlet springmvc threw exception 异常的原因及解决方法
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- SpringMVC-HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- SpringMVC异常:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- HTTP Status 500 - Servlet.init() for servlet springMVC threw exception
- HTTP Status 500 - Servlet.init() for servlet springMVC threw exception
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- Spring MVC 使用问题与解决--HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception
- HTTP Status 500 - Servlet.init() for servlet springmvc threw exception解决方法
- 出现 HTTP Status 500 - Servlet.init() for servlet springmvc threw exception 异常
- Maven ssm框架配置报错HTTP Status 500 - Servlet.init() for servlet spring threw exception
- HTTP Status 500 - Servlet.init() for servlet SpringMVC threw exception, 元素 'beans' 必须不含字符 [子级], 因为该类
- 项目中访问controller报错:HTTP Status 500 - Servlet.init() for servlet spring threw exception
- 500 - Servlet.init() for servlet springMVC threw exception