You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
} 但是启动之后,报错误信息为:
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
jeesite旧版中,如何使用Junit写controller和service的单元测试用例呢?
以下是我写的单元测试例子:
`
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:/applicationContext.xml"})
public class HousingTypeRestTest extends AbstractJUnit4SpringContextTests {
}
对应的controller代码为
@RequestMapping("/rest")
@controller
public class HelloRest {
}
但是启动之后,报错误信息为:
java.lang.IllegalStateException: Failed to load ApplicationContext
...
`
查找了下,发现
web.xml
中配置的servlet
为org.glassfish.jersey.servlet.ServletContainer
,但是官方也是这么配置的,所以咱也不敢乱动。so,请问有解决办法么?
The text was updated successfully, but these errors were encountered: