Spring学习笔记(十九):关于tomcat运行一直出错的问题

当时出现了一个错误:
提示无法解析数据库的xml文件,还有说Runnable等问题,具体代码如下:

org.springframework.core.NestedIOException: Failed to parse mapping resource: 'E:\STS_WorkSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\v11j\WEB-INF\classes\mappings\modules\device\DeviceClothesTemplateDao.xml'; nested exception is java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [META-INF/services/javax.xml.xpath.XPathFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    at org.mybatis.spring.SqlSessionFactoryBean.refresh(SqlSessionFactoryBean.java:599)
    at org.apache.ibatis.thread.Runnable.refresh(Runnable.java:140)
    at org.apache.ibatis.thread.Runnable$1.run(Runnable.java:95)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [META-INF/services/javax.xml.xpath.XPathFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1353)
    at org.apache.catalina.loader.WebappClassLoaderBase.findResources(WebappClassLoaderBase.java:976)
    at java.lang.ClassLoader.getResources(Unknown Source)
    at java.util.ServiceLoader$LazyIterator.hasNextService(Unknown Source)
    at java.util.ServiceLoader$LazyIterator.hasNext(Unknown Source)
    at java.util.ServiceLoader$1.hasNext(Unknown Source)
    at javax.xml.xpath.XPathFactoryFinder$2.run(Unknown Source)
    at javax.xml.xpath.XPathFactoryFinder$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.xml.xpath.XPathFactoryFinder.findServiceProvider(Unknown Source)
    at javax.xml.xpath.XPathFactoryFinder._newFactory(Unknown Source)
    at javax.xml.xpath.XPathFactoryFinder.newFactory(Unknown Source)
    at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)
    at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)
    at org.apache.ibatis.parsing.XPathParser.commonConstructor(XPathParser.java:264)
    at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:124)
    at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:86)
    at org.mybatis.spring.SqlSessionFactoryBean.refresh(SqlSessionFactoryBean.java:594)
    ... 3 more

以前本地调试时,如果服务器已启动,然后修改代码再保存,有时候就会出现这个错误,但是重启后就好了;结果这次放到服务器后,不管重启多少次,都不管用;然后把tomcat的缓存清下就好了;
原因是缓存问题。
解决办法:
首先关闭tomcat服务进程
killall -9 java 比较彻底的结束进程
查看下进程是否结束完全
ps -aux |grep java
然后进入 安装目录/tomcat/work目录下,删除该目录下所有
执行命令:
rm -rf Catalina/
rm -rf Catalinai/
rm -rf Catalinaii/

确认是删除命令:ls,如果work目录下没有Catalina文件夹,这表示删除成功

再进入 安装目录/tomcat/bin目录下执行命令:./startup.sh,启动tomcat

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值