Error creating bean with name 'borrowController': Unsatisfied dependency expressed through field 'borrowService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'borrowServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'medicMapper' defined in file [E:\spring\aaazuoye\springboot-book02-01\target\classes\com\wfit\boot\mapper\MedicMapper.class]: Cannot resolve reference to bean 'sqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.io.IOException: Failed to parse mapping resource: 'file [E:\spring\aaazuoye\springboot-book02-01\target\classes\mapper\BookMapper.xml]'
时间: 2024-04-01 07:37:34 浏览: 123
根据您提供的错误信息,看起来是在创建名为 "borrowController" 的 bean 时出现了错误,因为无法满足它的依赖项 "borrowService"。进一步的错误消息表明,"borrowServiceImpl" 的依赖项 "medicMapper" 无法解析对 "sqlSessionTemplate" 的引用。
这可能是由于您的应用程序缺少所需的依赖项或配置文件,或者您的依赖项和配置文件存在问题。您可以检查您的代码和配置文件,确保它们正确地设置了所有必需的依赖项,并且没有任何拼写错误或语法错误。
您还可以尝试清除并重新构建您的应用程序,以确保所有依赖项都正确地安装和配置。如果问题仍然存在,请检查您的 MyBatis 配置文件和映射文件,确保它们正确地配置了所有数据库连接和查询。您还可以尝试查看其他错误消息或日志,以获取更多有关问题的信息。
相关问题
2023-06-08 16:13:00.035 ERROR [ aivoice-virtualnumber ] 1 --- [ main] o.s.boot.SpringApplication : Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'callVirtualService': Unsatisfied dependency expressed through field 'aiBoiceService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aiBoiceService': Unsatisfied dependency expressed through field 'aiTalkRecordsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aiTalkRecordsService': Unsatisfied dependency expressed through field 'aiErrRecordsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aiErrRecordsService': Unsatisfied dependency expressed through field 'aiWrongPoolService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aiWrongPoolService': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'intervaTime.hour' in value "${intervaTime.hour}"
这似乎是一个应用程序启动失败的错误。根据错误信息,看起来是在创建名为 'callVirtualService' 的bean时遇到了问题,因为它的依赖项 'aiBoiceService' 无法满足。进一步检查错误信息,发现 'aiBoiceService' 的依赖项 'aiTalkRecordsService' 也无法满足,以此类推。最终,这个错误似乎与一个名为 'aiWrongPoolService' 的bean有关,因为它的某些自动装配依赖项失败了,其中包括一个名为 'intervaTime.hour' 的占位符无法解析。这可能是因为在配置文件中缺少该属性的值导致的。
阅读全文