翔哥,ShopDaoTest测试出错,之前AreaDaoTest测试成功,现在测试也报同样错误
来源:4-1 Dao层之新增店铺
慕虎5186380
2021-01-17
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\eclipse\eclipse-workspace\o2o\target\classes\mapper\ShopDao.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Parsing error was found in mapping #{area,areaId}. Check syntax #{property|(expression), var1=value1, var2=value2, …}
4回答
-
翔仔
2021-01-18
同学好,抱歉这两天实在太忙了,周末也加班到深夜。。我看异常就是xml配置错误导致解析有问题?同学可以把最终源码粘贴过来,然后对着自己的改一下,我估计肯定还是哪里写错了,至于为什么删除重建就能成功,这个可以尝试清除一下Tomcat缓存
00 -
慕虎5186380
提问者
2021-01-17
翔哥,那个shopDao. xml文件每次重新运行都会报它的错误,删掉这个生成文件,就可以运行成功,这是啥原因呀
00 -
慕虎5186380
提问者
2021-01-17
问题已解决
00 -
慕虎5186380
提问者
2021-01-17
重启了一下ecplise提示这个错误了:Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\eclipse\eclipse-workspace\o2o\target\classes\mapper\ShopDao.out.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 文件提前结束。
00
相似问题