mybatis里Mapper.xml文件里sql语句<和>

mybatis里Mapper.xml文件里sql语句写<或者>都会报错

报错
Error creating bean with name ‘carContronller’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.tellhow.Carsystem.service.CarService com.tellhow.Carsystem.controller.CarContronller.carService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘carService’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.tellhow.Carsystem.mapper.CarMapper com.tellhow.Carsystem.service.CarService.carMapper; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘carMapper’ defined in file [D:\java项目.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Carsystem\WEB-INF\classes\com\tellhow\Carsystem\mapper\CarMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’: : Error creating bean with name ‘sqlSessionFactoryBean’ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\java项目.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Carsystem\WEB-INF\classes\com\tellhow\Carsystem\config\CarMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 14; columnNumber: 36; 元素内容必须由格式正确的字符数据或标记组成。; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactoryBean’ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\java项目.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Carsystem\WEB-INF\classes\com\tellhow\Carsystem\config\CarMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 14; columnNumber: 36; 元素内容必须由格式正确的字符数据或标记组成。

在这里插入图片描述
mybatis里的xml文件SQL语句报错
原因 :
<(小于号)和<> 一样,所以需要用转义符<(small it)
取代 >(大于号)同样如此,需要用转义符&gt;(big it)取代

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值