主题:SQLManager 无法自动注入的问题

grofis 2019年10月22日 40

你好,问下 SQLManager 在Service中无法注入,信息如下:

内网通截图20191022191249.png


Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.enersun.web.front.controller.SqlTemplateDao cn.com.enersun.web.front.controller.person.PersonDataController.sqlTemplateDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlTemplateDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.beetl.sql.core.SQLManager cn.com.enersun.web.front.controller.SqlTemplateDao.sqlManager; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.beetl.sql.core.SQLManager] 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)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:571) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ... 60 moreCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlTemplateDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.beetl.sql.core.SQLManager cn.com.enersun.web.front.controller.SqlTemplateDao.sqlManager; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.beetl.sql.core.SQLManager] 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)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:543) ... 62 moreCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.beetl.sql.core.SQLManager cn.com.enersun.web.front.controller.SqlTemplateDao.sqlManager; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.beetl.sql.core.SQLManager] 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)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:571) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ... 73 moreCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.beetl.sql.core.SQLManager] 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)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:543) ... 75 more

闲大赋 2019年10月24日

文档有如何集成框架得,按照文档来,如果还不行,那看看错误提示前面的错误提示,估计是更底层得数据库连接出问题了

  • grofis :大神,提个小小的建议。论坛有没查看自己发的帖子的功能, 刚看完回复,想要看回答发现网页关了。顺手点乐上次进入的给我的回复菜单,一看是空的。死活没找到自己已经发过的帖子,还好浏览器有历史记录。(2019年10月27日)
  • grofis :按照文档的方式来创建的,和jpa的方式并用。jpa可以连接,beetl连接就出现问题了。oracle数据库(2019年10月27日)
  • grofis :ConnectionSource source = ConnectionSourceHelper.getSimple(driver, url, userName, password); DBStyle(2019年10月27日)
闲大赋 2019年10月27日

官网文档有springboot 集成,你先看springboot集成