cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amic...@apache.org
Subject svn commit: r1513793 - /cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
Date Wed, 14 Aug 2013 10:03:55 GMT
Author: amichai
Date: Wed Aug 14 10:03:55 2013
New Revision: 1513793

URL: http://svn.apache.org/r1513793
Log:
[CXF-5188] Fix resource leak when server fails to start

Modified:
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java?rev=1513793&r1=1513792&r2=1513793&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
Wed Aug 14 10:03:55 2013
@@ -201,7 +201,12 @@ public class ServerFactoryBean extends A
                                               : getServiceClass());
             
             if (start) {
-                server.start();
+                try {
+                    server.start();
+                } catch (RuntimeException re) {
+                    server.destroy(); // prevent resource leak
+                    throw re;
+                }
             }
             return server;
         } finally {



Mime
View raw message