Error creating bean with name ‘userServiceImpl’: Injection of resource dependencies failed
程序员文章站
2024-02-21 23:29:10
...
Cannot resolve reference to bean ‘sqlSessionFactory’ while setting…
如果你也是原项目是用eclipse开发的,你用idea进行开发。出现这个问题的话应该能解决。
我的service一直注入不了,结果是因为原项目是用eclipse开发的,我用idea进行开发。我使用maven作为项目管理平台,原本编辑器应该将项目中资源管理的权限全交个maven,但是使用eclipse开发时eclipse会插手,主动将src/java下的xml等资源文件拷贝到target下,由于eclipse多管了这么一宗闲事,所以当时的开发人员根本没注意pom中没有配置资源拷贝。
解决方法:在pom中设置资源拷贝即可!!!!!!!!
<build>
<resources>
<!--编译后对xml进行资源拷贝-->
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
推荐阅读
-
Error creating bean with name ‘userServiceImpl’: Injection of resource dependencies failed
-
Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/spring/applicationContext.xml]: Invocation of init me
-
Error creating bean with name 'entityManagerFactory' defined in class path resource解决方案
-
Spring Boot 报错:Error creating bean with name 'entityManagerFactory' defined in class path resource
-
Error creating bean with name 'entityManagerFactory' defined in class path resource解决方案
-
Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/spring/applicationContext.xml]: Invocation of init me
-
Spring Cloud中遇到的Error creating bean with name 'hystrixCommandAspect' defined in class path resource
-
error creating bean with name sqlSessionFactory defined in class path resource spring/spring-mvc
-
Error creating bean with name 'entityManagerFactory' defined in class path resource解决方案
-
遇到Error creating bean with name 'flywayInitializer' defined in class path resource解决办法