[ https://issues.apache.org/jira/browse/CXF-3428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013909#comment-13013909 ]
Anders Båtstrand commented on CXF-3428: --------------------------------------- I tested with the SNAPSHOT, and it is working. Verified {color:green}*OK*{color}. Thank you for replying and fixing the bug so fast! > Context closed twice with Spring setup > -------------------------------------- > > Key: CXF-3428 > URL: https://issues.apache.org/jira/browse/CXF-3428 > Project: CXF > Issue Type: Bug > Affects Versions: 2.3.2, 2.3.3 > Environment: Windows 7, both Java 5 and 6, and both Jetty 7.3 and > Tomcat 7. > Reporter: Anders Båtstrand > Assignee: Willem Jiang > Labels: context, spring > Fix For: 2.3.4 > > Attachments: context-bug.zip > > > See the enclosed project (very minimal). > I have a cxf.cml and an applicationContext.xml, and loads both using > ContextLoaderListener in my web.xml. I have also a CXFServlet. Starting this > with Jetty, I get the following exception when I stop the server: > {code} > 28.mar.2011 23:43:15 > org.springframework.context.support.AbstractApplicationContext doClose > WARNING: Exception thrown from ApplicationListener handling ContextClosedEvent > 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:171) > at > org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1079) > at > org.apache.cxf.bus.spring.BusApplicationListener.onApplicationEvent(BusApplicationListener.java:66) > at > org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97) > at > org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303) > at > org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1007) > at > org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:970) > at > org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:378) > at > org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:78) > at > org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:683) > at > org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:143) > at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:458) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:80) > at > org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:247) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:80) > at > org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:108) > at org.eclipse.jetty.server.Server.doStop(Server.java:319) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:80) > at Main.main(Main.java:19) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > {code} > To replicate, simply run the Main method in the attached project. Then switch > the CXF version in the pom.xml, and see it works with version 2.3.1. I > therefore thinks this is related to CXF-3213. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira