关于myecliplse经常弹出【An error has occurred. See error log for more details. java.lang.NullPointer】的解决方法

本文介绍了一个关于MyEclipse频繁出现错误提示的问题及解决方案。作者发现项目的web.xml文件中xmlns:web属性重复定义导致IDE不断弹出错误提示,尝试了多种方法最终通过修正XML文件解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

项目基于: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
   	"/>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值