Maven 启动TestSpringMybatis有问题
arafat5549 opened this issue · comments
Tests in error:
testXmlInsert(cn.kiiwii.framework.spring.TestSpring.SpringWithMybatisTest): Error creating bean with name 'cn.kiiwii.framework.spring.TestSpring.SpringWithMybatisTest': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testXmlService' is defined
一直有No bean named 'testXmlService' is defined 不知道为什么!
确保将resources文件夹设置为resources roor(intellij idea ),或者添加到source中(eclipse)
配置文件位置配置好了吗
在eclipse中还有一种表现就是单元测试test报错 java.lang.IllegalStateException: Failed to load ApplicationContext
在pom文件中增加一项
<resource> <directory>src/main/resources</directory> <includes> <include>**/*.*</include> </includes> </resource>