junit单元测试一直跑不起来

Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name...

java.lang.IllegalStateException: Failed to load ApplicationContext


Spring.profiles多环境配置


后来仔细分析:虽然web.xml里配置了,但是 测试类并没有获取到web.xml.

解决方法如下:

   1.Spring.profiles多环境配置



2.

Spring.profiles多环境配置



以上两种方法都可以。

相关文章: