I am trying to run unit tests on my (hibernate) DAOs, but my tiles configurer keeps getting in the way.
The error I'm getting is
1) warning(junit.framework.TestSuite$1)junit.framewor k.AssertionFailedError: Exception in constructor: testSaveUser (org.springframework.beans.factory.BeanCreationExc eption: Error creating bean with name 'tilesConfigurer' defined in class path resource [WEB-INF/spring-config.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: WebApplicationObjectSupport instance [org.springframework.web.servlet.view.tiles.TilesCo nfigurer@eac5a] does not run in a WebApplicationContext but in: org.springframework.context.support.ClassPathXmlAp plicationContext: displayName=[org.springframework.context.support.ClassPathXmlAp plicationContext;hashCode=15717714]; startup date=[Tue Nov 30 12:33:41 CST 2004]; root of ApplicationContext hierarchy
java.lang.IllegalStateException: WebApplicationObjectSupport instance [org.springframework.web.servlet.view.tiles.TilesCo nfigurer@eac5a] does not run in a WebApplicationContext but in: org.springframework.context.support.ClassPathXmlAp plicationContext: displayName=[org.springframework.context.support.ClassPathXmlAp plicationContext;hashCode=15717714]; startup date=[Tue Nov 30 12:33:41 CST 2004]; root of ApplicationContext hierarchy
at org.springframework.web.context.support.WebApplica tionObjectSupport.getWebApplicationContext(WebAppl icationObjectSupport.java:42)
...
What I figure is happening is the TilesConfigurer bean doesn't like being started without a tomcat (or other web container) instance. Can I get around this without having two different spring xml files? The app. runs fine if I start it as a webapp in tomcat.
Thanks,
James


Reply With Quote
)