cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Borgland <jens.borgl...@gmail.com>
Subject Refreshing the Spring context leads to NPE
Date Wed, 08 Feb 2012 16:58:27 GMT
Hi,

I have a web application that uses Spring and CXF (currently 2.4.2),
and runs on Tomcat.

The application (not just CXF) is initialized using the
org.springframework.web.context.ContextLoaderListener.

Starting and shutting the application down works like a charm but if I
try to refresh the Spring application context, using
((ConfigurableApplicationContext)applicationContext).refresh(); I run
into problems. The application context first destroys all its beans
(including CXFBusImpl, or rather its subclass SpringBus). SpringBus
however calls close() on its application context - leading to a
NullPointerException when the application context shortly after tries
to close its bean factory:

java.lang.NullPointerException
    at org.springframework.context.support.AbstractRefreshableApplicationContext.closeBeanFactory(AbstractRefreshableApplicationContext.java:152)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:124)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)

What can I do to avoid this? I don't really understand why CXFBusImpl
should close the context in the first place?

Best regards,
Jens

Mime
View raw message