SSM框架中Mybatis 异常报错:The content of elements must consist of well-formed character data or markup

今天在调试项目过程当中,由于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 元素必须遵循以下命名规则:

1.名称可以含字母、数字以及其他的字符 
2.名称不能以数字或者标点符号开始
3.名称不能以字符 “xml”(或者 XML、Xml)开始
4.名称不能包含空格


但是我的各种写法都是符合xml格式要求的呢?!到底是在哪有问题呢?

后来,既然是mapper的问题,那么是不是就是关于Mybatis的语法当中,我疏漏了什么。

继续查找关于Mybatis的语法,果然,找到了这么一条准则!

Mybatis配置文件中,是不能有小于号的出现!!!!

于是,那就试试下,然后奇迹出现啦!!!

将上述出现小于号的地方修改成了大于号,tomcat正常启动,项目正常运行!!

可喜可贺可喜可贺!

开发经验算是涨了一点Σ(⊙▽⊙"a!!!!


博主原创博文,未经同意请勿转载,出处https://blog.csdn.net/mukvintt/article/details/80826505!


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值