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
{{ message }}
Repository navigation
Make Spring ContextTest annotation support WebApplicationContext [SPR-4759] #9436
@ContextConfiguration(locations = {
"classpath:/applicationContext-jmx.xml",
"/WEB-INF/applicationContext*.xml",
"/WEB-INF/dispatcher-servlet.xml"
}, inheritLocations = true)
public abstract class BaseWebControllerTestCase extends BaseTestCase{...}
public class UserFormControllerTest extends BaseWebControllerTestCase{ @Autowired
private UserFormController c = null;
@Test
...
}
java.lang.IllegalStateException: WebApplicationObjectSupport instance [xxx.UserFormController@123961b] does not run in a WebApplicationContext but in: org.springframework.context.support.GenericApplicationContext@1fc2fb: display name [org.springframework.context.support.GenericApplicationContext@1fc2fb]; startup date [Mon Apr 28 15:35:37 BST 2008]; root of context hierarchy
at org.springframework.web.context.support.WebApplicationObjectSupport.getWebApplicationContext(WebApplicationObjectSupport.java:101)
at org.springframework.web.context.support.WebApplicationObjectSupport.getServletContext(WebApplicationObjectSupport.java:115)
...
Activity
spring-projects-issues commentedon Oct 30, 2008
Juergen Hoeller commented
See #9917.