请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

验证DAO出错了,求救!

18:25:27.440 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using ‘class org.apache.ibatis.logging.slf4j.Slf4jImpl’ adapter.
18:25:27.455 [main] DEBUG org.mybatis.spring.mapper.ClassPathMapperScanner - Creating MapperFactoryBean with name ‘areaDao’ and ‘com.tudui.dao.AreaDao’ mapperInterface
18:25:27.573 [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging.
18:25:27.581 [MLog-Init-Reporter] DEBUG com.mchange.v2.log.MLog - Reading VM config for path list /com/mchange/v2/log/default-mchange-log.properties, /mchange-commons.properties, /c3p0.properties, hocon:/reference,/application,/c3p0,/, /mchange-log.properties, /
18:25:27.581 [MLog-Init-Reporter] DEBUG com.mchange.v2.log.MLog - The configuration file for resource identifier ‘/mchange-commons.properties’ could not be found. Skipping.
18:25:27.581 [MLog-Init-Reporter] DEBUG com.mchange.v2.log.MLog - The configuration file for resource identifier ‘/c3p0.properties’ could not be found. Skipping.
18:25:27.582 [MLog-Init-Reporter] DEBUG com.mchange.v2.log.MLog - The configuration file for resource identifier ‘hocon:/reference,/application,/c3p0,/’ could not be found. Skipping.
18:25:27.583 [MLog-Init-Reporter] DEBUG com.mchange.v2.log.MLog - The configuration file for resource identifier ‘/mchange-log.properties’ could not be found. Skipping.
18:25:27.585 [main] DEBUG com.mchange.v2.cfg.MConfig - The configuration file for resource identifier ‘/mchange-commons.properties’ could not be found. Skipping.
18:25:27.586 [main] DEBUG com.mchange.v2.cfg.MConfig - The configuration file for resource identifier ‘/mchange-log.properties’ could not be found. Skipping.
18:25:27.586 [main] DEBUG com.mchange.v2.cfg.MConfig - The configuration file for resource identifier ‘hocon:/reference,/application,/c3p0,/’ could not be found. Skipping.
18:25:27.586 [main] DEBUG com.mchange.v2.cfg.MConfig - The configuration file for resource identifier ‘/c3p0.properties’ could not be found. Skipping.
18:25:27.785 [main] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5.4 [built 23-March-2019 23:00:48 -0700; debug? true; trace: 10]
18:25:27.824 [main] DEBUG com.mchange.v2.c3p0.management.DynamicPooledDataSourceManagerMBean - MBean: com.mchange.v2.c3p0:type=PooledDataSource,identityToken=z8kfsxaf79hefrzlc4pa|618b19ad,name=z8kfsxaf79hefrzlc4pa|618b19ad registered.
18:25:27.868 [main] DEBUG com.mchange.v2.c3p0.management.DynamicPooledDataSourceManagerMBean - MBean: com.mchange.v2.c3p0:type=PooledDataSource,identityToken=z8kfsxaf79hefrzlc4pa|618b19ad,name=z8kfsxaf79hefrzlc4pa|618b19ad unregistered, in order to be reregistered after update.
18:25:27.868 [main] DEBUG com.mchange.v2.c3p0.management.DynamicPooledDataSourceManagerMBean - MBean: com.mchange.v2.c3p0:type=PooledDataSource,identityToken=z8kfsxaf79hefrzlc4pa|618b19ad,name=z8kfsxaf79hefrzlc4pa|618b19ad registered.
18:25:28.275 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed configuration file: 'class path resource [mybatis-config.xml]'
一月 19, 2021 6:25:28 下午 org.springframework.context.support.GenericApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: 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 [/home/tudui/IdeaProjects/com.tudui/target/classes/mapper/AreaDao.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 92; 文档根元素 “mapper” 必须匹配 DOCTYPE 根 “null”。
一月 19, 2021 6:25:28 下午 org.springframework.test.context.TestContextManager prepareTestInstance
严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@77b52d12] to prepare test instance [com.tudui.dao.AreaDaoTest@3c77d488]
java.lang.IllegalStateException: Failed to load ApplicationContext

以上是异常,说是我的sqlSessionFactory有问题,下面我贴上sqlSessionFactory
图片描述

正在回答

1回答

 Failed to parse mapping resource: ‘file [/home/tudui/IdeaProjects/com.tudui/target/classes/mapper/AreaDao.xml]’

这里说的是AreaDao.xml解析异常,证明里面配置有问题

lineNumber: 3; columnNumber: 92

第三行第92列

同学看看哈

https://git.imooc.com/coding-144/coding-144/src/master/mvco2o/src/main/resources/mapper/AreaDao.xml


1 回复 有任何疑惑可以回复我~
  • 提问者 当代时传祥 #1
    感谢翔哥,解决了,又能愉快的继续了
    回复 有任何疑惑可以回复我~ 2021-01-20 08:08:27
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号