項目基於: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.csdn.net/u011885027/article/details/72903136
https://blog.csdn.net/W_Batman/article/details/78943209
https://bbs.csdn.net/topics/390908904
挨個試了一下,發現都不好使,
後來發現是web.xml的問題,因爲xmlns寫重了,,,
<?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
"/>