springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.support.ScheduledMethodRunnable#0': Cannot resolve reference to bean 'sysTask' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysTask': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ecp.crm.service.SaleTrackingService com.ecp.system.task.SysTask.saleTrackingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'saleTrackingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ecp.crm.dao.SaleTrackingDao com.ecp.crm.service.impl.SaleTrackingServiceImpl.fDao; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'saleTrackingDao' defined in file [D:\�����ļ�\soyogit\epm\trunk\target\epm-1.0.0\WEB-INF\classes\com\ecp\crm\dao\SaleTrackingDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sqlSessionFactory' defined in URL [file:/D:/�����ļ�/soyogit/epm/trunk/target/epm-1.0.0/WEB-INF/classes/spring.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/D:/�����ļ�/soyogit/epm/trunk/target/epm-1.0.0/WEB-INF/lib/ecp-platform-extend-1.9.4.jar!/com/ecp/attachment/dao/mysql/AttachmentAssociateMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: XML fragments parsed from previous mappers already contains value for com.ecp.attachment.dao.AttachmentAssociateMapper.table-name; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [file:/D:/�����ļ�/soyogit/epm/trunk/target/epm-1.0.0/WEB-INF/classes/spring.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/D:/�����ļ�/soyogit/epm/trunk/target/epm-1.0.0/WEB-INF/lib/ecp-platform-extend-1.9.4.jar!/com/ecp/attachment/dao/mysql/AttachmentAssociateMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: XML fragments parsed from previous mappers already contains value for com.ecp.attachment.dao.AttachmentAssociateMapper.table-name
时间: 2024-04-22 15:25:35 浏览: 216
测试spring中的org.springframework.beans.factory.InitializingBean
这个错误是一个典型的Spring框架的Bean创建异常。它表明在创建名为'sysTask'的bean时遇到了问题。
具体来说,错误消息中提到了无法解析对bean 'sysTask'的引用。在设置构造函数参数时出现了问题。进一步查看发现,'sysTask'这个bean的注入依赖失败了,其中有一个字段saleTrackingService无法自动装配。
继续追踪,发现'saleTrackingServiceImpl'这个bean的注入依赖也失败了,其中有一个字段fDao无法自动装配。
最后,发现'saleTrackingDao'这个bean的创建也失败了,通过查看错误消息中的提示,可以看出是由于解析映射资源时出现了问题。具体原因是在解析Mapper XML时出现了错误,可能是由于前面解析过的XML片段中已经包含了相同的值导致的。
基于以上分析,建议检查以下几个方面:
1. 确保相关的bean定义和配置正确,特别是与'sysTask'、'saleTrackingService'、'saleTrackingServiceImpl'和'saleTrackingDao'相关的bean。
2. 检查注入依赖的字段是否正确命名,并且在相应的bean中进行了正确的声明和配置。
3. 检查Mapper XML文件是否正确,并且没有重复定义相同的值。
通过仔细检查和排查,应该能够解决这个Bean创建异常。如果问题仍然存在,建议提供更多的代码和配置信息,以便更好地帮助你解决问题。
阅读全文