项目基于:spring Boot 2.0.1 RELEASE
由于我们的项目不需要web.xml,所以它是空的,为了不再提示黄线,我们加上了
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="schedule-console" version="3.1"/>
然鹅,第二天上班的时候打开项目,myecliplse疯狂的提示
An error has occurred. See error log for more details. java.lang.NullPointer
改个代码要弹出十次八次的那种
去翻了好多资料,
有清理缓存的 Myeclipse.exe -clean 对缓存进行清理
有删除文件的
https://scanneran.iteye.com/blog/2206388
https://blog.youkuaiyun.com/u011885027/article/details/72903136
https://blog.youkuaiyun.com/W_Batman/article/details/78943209
https://bbs.youkuaiyun.com/topics/390908904
挨个试了一下,发现都不好使,
后来发现是web.xml的问题,因为xmlns:web写重了,,,
更改前
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="schedule-console" version="3.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:web="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:web="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd
http://xmlns.jcp.org/xml/ns/javaee
"/>
更改后
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="schedule-console" version="3.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:web="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd
http://xmlns.jcp.org/xml/ns/javaee
"/>