UnsatisfiedDependencyException: Error creating bean with name ‘*******‘:
程序员文章站
2022-07-14 21:13:11
...
关于父子工程中controller、service、web层全员报 error creating been with name ‘****’ 错误
说明:
图例1中提示beans注入错误,可以基本将错误定位于dao层;
其中sqlSessionFactoryBean直接将错误具体化到applicationContext配置文件中;
其中图例2
(Cannot convert value of type ‘java.lang.String’ to required type ‘javax.sql.DataSource’ for property ‘dataSource’)
基本将错误指明了:“ 不能将java.lang.String类型的数据转换为需要的java.sql.DataSource”;打开application如图例3发现本应该执行数据源的ref被错误的写成了value导致错误产生
问题-解决
<property name="dataSource" ref="dataSource"/> <!-- 正确的应该是ref--> <!-- <property name="configLocation" value="classpath:mybatis-config.xml.bat"></property>--> <!--错误的写成了value导致错误产生-->
图例1:
图例2:
图例2:
推荐阅读
-
Error creating bean with name 'entityManagerFactory' defined in class path resource解决方案
-
Error creating bean with name ‘eduChapterController‘: Unsatisfied dependency expressed through field
-
UnsatisfiedDependencyException: Error creating bean with name ‘xxxx‘:
-
springMVC常见错误-解决org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.spring
-
Error creating bean with name
-
Error creating bean with name 'eurekaAutoServiceRegistration'
-
Error creating bean with name报错
-
Error creating bean with name dfdatasource
-
Error creating bean with name ‘sqlSessionFactory‘
-
BeanCreationException: Error creating bean with name ‘requestMappingHandlerAdapter‘