项目报错org.springframework.web.context.ContextLoader]Context initialization failed
毛小意同学 2019-05-24 06:46:10 项目报错。在eclips上可以运行,在idea上不能运行。
18:28:13.948 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Property 'configLocation' not specified, using default MyBatis Configuration
18:28:13.954 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\TradeLogMapper.xml]'
18:28:13.959 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UencMapper.xml]'
18:28:13.964 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UencTradingMapper.xml]'
18:28:13.968 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UserMapper.xml]'
18:28:13.972 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\ValueMapper.xml]'
18:28:13.978 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Property 'configLocation' not specified, using default MyBatis Configuration
18:28:13.983 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\TradeLogMapper.xml]'
18:28:13.988 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UencMapper.xml]'
18:28:13.993 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UencTradingMapper.xml]'
18:28:13.997 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UserMapper.xml]'
18:28:14.000 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\ValueMapper.xml]'
[ERROR] [2019-05-24 18:28:14][org.springframework.web.context.ContextLoader]Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'checkServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.weimi.wuenc.dao.ValueDao com.weimi.wuenc.service.impl.CheckServiceImpl.valueDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.weimi.wuenc.dao.ValueDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tradeLogDao' defined in file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\TradeLogDao.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 class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/E:/开发工具/tomcat/apache-tomcat-8.5.33/webapps/ROOT/WEB-INF/lib/wm-wallet-1.0-SNAPSHOT.jar!/com/weimi/wuenc/dao/TradeLogMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.weimi.wuenc.dao.TradeLogDao.insertLog
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uencDao' defined in file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UencDao.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 class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/E:/开发工具/tomcat/apache-tomcat-8.5.33/webapps/ROOT/WEB-INF/lib/wm-wallet-1.0-SNAPSHOT.jar!/com/weimi/wuenc/dao/TradeLogMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.weimi.wuenc.dao.TradeLogDao.insertLog
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uencTradingDao' defined in file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UencTradingDao.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 class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/E:/开发工具/tomcat/apache-tomcat-8.5.33/webapps/ROOT/WEB-INF/lib/wm-wallet-1.0-SNAPSHOT.jar!/com/weimi/wuenc/dao/TradeLogMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.weimi.wuenc.dao.TradeLogDao.insertLog
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\UserDao.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 class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/E:/开发工具/tomcat/apache-tomcat-8.5.33/webapps/ROOT/WEB-INF/lib/wm-wallet-1.0-SNAPSHOT.jar!/com/weimi/wuenc/dao/TradeLogMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.weimi.wuenc.dao.TradeLogDao.insertLog
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'valueDao' defined in file [E:\开发工具\tomcat\apache-tomcat-8.5.33\webapps\ROOT\WEB-INF\classes\com\weimi\wuenc\dao\ValueDao.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 class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/E:/开发工具/tomcat/apache-tomcat-8.5.33/webapps/ROOT/WEB-INF/lib/wm-wallet-1.0-SNAPSHOT.jar!/com/weimi/wuenc/dao/TradeLogMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.weimi.wuenc.dao.TradeLogDao.insertLog
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh