您的位置:首页 > 运维架构 > Tomcat

Tomcat启动报错,不能正常解析配置文件 Could not load META-INF/services/javax.xml.parsers.SAXParserFactory XML文件解析失败

2016-09-09 16:09 986 查看
运行环境:Ubantu 14. Tomcat7  

声明:此服务器为公司测试服务器,因为经常需要改动一些固件,或者升级固件,经常会做格式化磁盘;所以无论是什么环境,一定需要先备份,保证数据安全!!!本文只做参考

项目在本地运行没有问题,但是发布到服务器就一直报错,不能启动项目;下面是报错





The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

查看报错,还以为是jdbc驱动的问题,换了换驱动的jar包还是报错,继续查看

INFO: Illegal access: this web application instance has been stopped already.  Could not load org.xml.sax.helpers.XMLReaderFactory.  The eventual following stack trace is caused by an error thrown for debugging purposes as well a to attempt to terminate
the thread which caused the illegal access, and has no functional impact.

下面有两句信息

at com.rhxy.service.ReportMAC.getSystemInfo(ReportMAC.java:84)

        at com.rhxy.service.ReportMAC.run(ReportMAC.java:36)

这个是一个二级域名检测的线程,下面是相关的代码:





在使用SAXreader读取配置文件的时候出现异常,文件是存在服务器上的,也没有说是FileNotFoundException。那就应该是不能正常解析该配置文件

最后的解决方法是,做好相关文件的备份工作,尝试删除该文件,重启后还是不能启动项目,然后进行格式化磁盘(一定要做好备份) ;重启服务器,运行tomcat 错误解决(公司服务器,系统是运行在一个固态盘上面的,因为昨晚同事换了一个系统盘,可能因为更换系统盘导致系统读取磁盘出错,以至于不能正常解析配置文件);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息