cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r900875 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
Date Tue, 19 Jan 2010 18:14:06 GMT
Author: dkulp
Date: Tue Jan 19 18:14:05 2010
New Revision: 900875

URL: http://svn.apache.org/viewvc?rev=900875&view=rev
Log:
[CXF-2620] Add some guards to prevent NPE with certain use cases and
Spring 3.

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java?rev=900875&r1=900874&r2=900875&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
Tue Jan 19 18:14:05 2010
@@ -118,7 +118,12 @@
             ctx = bus.getExtension(BusApplicationContext.class);
         } else {
             LOG.info("LOAD_BUS_WITH_APPLICATION_CONTEXT");
-            bus = new SpringBusFactory(ctx).createBus();
+            inRefresh = true;
+            try {
+                bus = new SpringBusFactory(ctx).createBus();
+            } finally {
+                inRefresh = false;
+            }
         }        
         
         ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
@@ -175,7 +180,7 @@
     }
 
     public void onApplicationEvent(ApplicationEvent event) {
-        if (!inRefresh && event instanceof ContextRefreshedEvent) {
+        if (!inRefresh && event instanceof ContextRefreshedEvent && getServletConfig()
!= null) {
             //need to re-do the bus/controller stuff
             try {
                 inRefresh = true;



Mime
View raw message