Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 76663 invoked from network); 19 May 2008 21:13:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 May 2008 21:13:34 -0000 Received: (qmail 54436 invoked by uid 500); 19 May 2008 21:13:35 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 54392 invoked by uid 500); 19 May 2008 21:13:35 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 54382 invoked by uid 99); 19 May 2008 21:13:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 May 2008 14:13:35 -0700 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 May 2008 21:12:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 44288238899B; Mon, 19 May 2008 14:13:10 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r657982 - in /cxf/branches/2.0.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/transport/ rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ systests/src/test/java/org/apache/cxf/systest/http/ Date: Mon, 19 May 2008 21:13:09 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080519211310.44288238899B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Mon May 19 14:13:09 2008 New Revision: 657982 URL: http://svn.apache.org/viewvc?rev=657982&view=rev Log: Merged revisions 657978 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r657978 | dkulp | 2008-05-19 17:07:54 -0400 (Mon, 19 May 2008) | 2 lines [CXF-1589] Fix problems of calling Endpoint.publish with a busy port not always throwing an exception back ........ Modified: cxf/branches/2.0.x-fixes/ (props changed) cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java Propchange: cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java?rev=657982&r1=657981&r2=657982&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java Mon May 19 14:13:09 2008 @@ -44,7 +44,12 @@ if (observer != null) { getLogger().fine("registering incoming observer: " + observer); if (old == null) { - activate(); + try { + activate(); + } catch (RuntimeException ex) { + incomingObserver = null; + throw ex; + } } } else { if (old != null) { Modified: cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=657982&r1=657981&r2=657982&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java (original) +++ cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java Mon May 19 14:13:09 2008 @@ -309,6 +309,7 @@ } catch (Exception ex) { //ignore - probably wasn't fully started anyway } + server = null; throw new Fault(new Message("START_UP_SERVER_FAILED_MSG", LOG, e.getMessage()), e); } } Modified: cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java?rev=657982&r1=657981&r2=657982&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java (original) +++ cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java Mon May 19 14:13:09 2008 @@ -21,8 +21,8 @@ import java.io.IOException; import java.security.GeneralSecurityException; import java.util.ArrayList; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import javax.annotation.PostConstruct; import javax.annotation.Resource; @@ -39,7 +39,7 @@ implements DestinationFactory { private Map destinations = - new HashMap(); + new ConcurrentHashMap(); public JettyHTTPTransportFactory() { super(); @@ -98,7 +98,7 @@ throws IOException { String addr = endpointInfo.getAddress(); - JettyHTTPDestination destination = destinations.get(addr); + JettyHTTPDestination destination = addr == null ? null : destinations.get(addr); if (destination == null) { destination = createDestination(endpointInfo); } @@ -110,8 +110,8 @@ EndpointInfo endpointInfo ) throws IOException { - JettyHTTPDestination destination = - destinations.get(endpointInfo.getAddress()); + String addr = endpointInfo.getAddress(); + JettyHTTPDestination destination = addr == null ? null : destinations.get(addr); if (destination == null) { destination = new JettyHTTPDestination(getBus(), this, endpointInfo); Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java?rev=657982&r1=657981&r2=657982&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java (original) +++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java Mon May 19 14:13:09 2008 @@ -22,6 +22,8 @@ import java.lang.reflect.UndeclaredThrowableException; import javax.xml.ws.BindingProvider; +import javax.xml.ws.Endpoint; +import javax.xml.ws.WebServiceException; import org.apache.cxf.greeter_control.Greeter; import org.apache.cxf.greeter_control.GreeterService; @@ -94,4 +96,24 @@ } } + @Test + public void testPublishOnBusyPort() { + GreeterSessionImpl implementor = new GreeterSessionImpl(); + String address = "http://localhost:9020/SoapContext/GreeterPort"; + try { + Endpoint.publish(address, implementor); + fail("Should have failed to publish as the port is busy"); + } catch (WebServiceException ex) { + //ignore + } + try { + //CXF-1589 + Endpoint.publish(address, implementor); + fail("Should have failed to publish as the port is busy"); + } catch (WebServiceException ex) { + //ignore + } + + } + }