新增dao文件后,启动服务报错日志如下,就知道是xml文件中sql写的有问题,这种情况定位到报错的行号,查看是否有不符合规范写法的字符,例如:< 小于,>大于,<=小于等于,>=大于等于,mybatis中需要将这类比较符号转义处理否则会出现以下错误
转义:
[76010][RMI TCP Connection(3)-127.0.0.1][WARN ]o.s.b.f.s.DefaultListableBeanFactory 1524 - Bean creation exception on non-lazy FactoryBean type check:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'indicatorIndexDao' defined in file [E:\xxxxxt\trust\target\trust\WEB-INF\classes\com\thinkgem\jeesite\modules\indicator\dao\IndicatorIndexDao.class]:
Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sqlSessionFactory' defined in file [E:\xxxxxt\trust\target\trust\WEB-INF\classes\spring-context.xml]:
Invocation of init method failed; nested exception is org.springframework.core.NestedIOException:
Failed to parse mapping resource:
'file [E:\xxxxxt\trust\target\trust\WEB-INF\classes\mappings\modules\trust\AgainRunBlackDao.xml]'; nested exception is org.apache.ibatis.builder.BuilderException:
Error creating document instance. Cause:
org.xml.sax.SAXParseException; lineNumber: 100; columnNumber: 150; The content of elements must consist of well-formed character data or markup.
........