下面是我平时敲代码时遇到的棘手的错,很多不是语法的错都是配置或者工具不熟练的情况犯的错,特别记录
- IOException parsing XML document from class path resource [applicationContent.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContent.xml] cannot be opened because it does not exist
出现这个错,是因为你的配置文件没有放对位置,没有放到根目录下,在eclispe的话就把配置文件位置放到根目录,是idea的话就放到resourcrs目录; - 通配符的匹配很全面, 但无法找到元素 ‘mvc:annotation-driven’ 的声明…
这个错是因为你的配置文件的命名空间有错或者遗漏,我是在敲mvc配置文件时遇到的,这是我成功改回来的命名空间
<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.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
</bean>
3.springboot报这个错:
原因就是你的主类那个程序没有放在所有组件的包之外,反正把主类的那个文件放在你的文件结构最外面就行