今天在调试项目过程当中,由于Mybatis中的mapper.xml所涉及的语句当中,出现了异常报错。然后导致了tomcat就是起不来了。
像是在eclipse呈现的报错界面如下:
INFO: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. 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:1372)
at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1042)
at com.mysql.jdbc.AbandonedConnectionCleanupThread.checkContextClassLoaders(AbandonedConnectionCleanupThread.java:90)
at com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
按照以往的想法,如果看见了这种问题,肯定就是哪个校验文件没有通过,以及jar包没有导入缺失,或者是pom.xml文件出现了错误不能导入本应该是手动下载的jar包依赖。
而这次这里出现了问题就是个人在调试了mapper.xml文件之后,启动tomcat,就出现了这个问题,而果然的,在eclipse界面也出现了了该mapper.xml文件报错。
在一个<select></select>中有这样的报错情况。
这个地方出错之后,就有点很奇怪了,到底是什么格式,出了问题?
明明在mysql数据库中也是能完美运行的啊!
嗯~百思不得其解。不过既然报错已经给出了,那么找找看别人的解决方法。
报错提示是:
The content of elements must consist of well-formed character data or markup
文档和解答提示当中,给出了这样的解释:
XML 元素必须遵循以下命名规则:
但是我的各种写法都是符合xml格式要求的呢?!到底是在哪有问题呢?
后来,既然是mapper的问题,那么是不是就是关于Mybatis的语法当中,我疏漏了什么。
继续查找关于Mybatis的语法,果然,找到了这么一条准则!
Mybatis配置文件中,是不能有小于号的出现!!!!
于是,那就试试下,然后奇迹出现啦!!!
将上述出现小于号的地方修改成了大于号,tomcat正常启动,项目正常运行!!
可喜可贺可喜可贺!
开发经验算是涨了一点Σ(⊙▽⊙"a!!!!
博主原创博文,未经同意请勿转载,出处https://blog.csdn.net/mukvintt/article/details/80826505!