开发者

"call 'refresh'" error resulting from Grails WAR hot-deploy

When my Grails WAR is hot-deployed to Tomcat and I refresh the page, I get this error:

1 Feb, 2010 7:00:51 PM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet view-servlet threw exception java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:15

This error does not persist when Tomcat is resta开发者_如何学Pythonrted.


ApplicationContext ctx = new ClassPathXmlApplicationContext();

Spring try to lookup the applicationContext.xml from the CLASSPATH, if the xml file can't be found, "BeanFactory not initialized or already closed" error will be thrown out. That is why you restart the tomcat it works just fine. However I don't know the real cause why the applicationContext.xml is not in the classpath during hot-deploy.

If you are running only one Grails application in your tomcat, you can try to put the applicationContext.xml in Tomcat classpath and try hot-deploy again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜