Hello,
in my maven build I want to integrate an test testing my application context. The problem is that in the application context is a tilesConfigurer defined, which throws an NullPointerException, when I start the application context outside an servletContainer.
Code:@Test public void testKontaktContext() throws Exception { FileSystemXmlApplicationContext ctx = new FileSystemXmlApplicationContext("file:src/main/webapp/WEB-INF/kontakt-servlet.xml"); ctx.close(); }I found the following thread (http://forum.springsource.org/showthread.php?t=80543) but the solution there (comment out the tilesConfigurer) dows not work for me as the test should run witihn every maven build.Code:Caused by: java.lang.NullPointerException at org.apache.tiles.web.util.ServletContextAdapter.<init>(ServletContextAdapter.java:66) at org.springframework.web.servlet.view.tiles2.TilesConfigurer.afterPropertiesSet(TilesConfigurer.java:202) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398) ... 36 more
Is there any way to fix this?


Reply With Quote