cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r646515 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/
Date Wed, 09 Apr 2008 20:13:23 GMT
Author: dkulp
Date: Wed Apr  9 13:13:17 2008
New Revision: 646515

URL: http://svn.apache.org/viewvc?rev=646515&view=rev
Log:
Propogate errors trying to start the jetty engine up to the user.

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?rev=646515&r1=646514&r2=646515&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
Wed Apr  9 13:13:17 2008
@@ -240,17 +240,23 @@
     protected void doPublish(String addr) {
         checkPublishPermission();
         
-        ServerImpl serv = getServer(addr);
-        if (addr != null) {            
-            EndpointInfo endpointInfo = serv.getEndpoint().getEndpointInfo();
-            endpointInfo.setAddress(addr);
-            if (publishedEndpointUrl != null) {
-                // TODO is there a good place to put this key-string as a constant?
-                endpointInfo.setProperty("publishedEndpointUrl", publishedEndpointUrl);
+        try {
+            ServerImpl serv = getServer(addr);
+            if (addr != null) {            
+                EndpointInfo endpointInfo = serv.getEndpoint().getEndpointInfo();
+                endpointInfo.setAddress(addr);
+                if (publishedEndpointUrl != null) {
+                    // TODO is there a good place to put this key-string as a constant?
+                    endpointInfo.setProperty("publishedEndpointUrl", publishedEndpointUrl);
+                }
+                this.address = addr;
             }
-            this.address = addr;
+            serv.start();
+        } catch (WebServiceException ex) {
+            throw ex;
+        } catch (Exception ex) {
+            throw new WebServiceException(ex);
         }
-        serv.start();
     }
     
     public ServerImpl getServer() {

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java?rev=646515&r1=646514&r2=646515&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
Wed Apr  9 13:13:17 2008
@@ -31,7 +31,9 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
+import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -139,14 +141,14 @@
      */
     protected void activate() {
         LOG.log(Level.FINE, "Activating receipt of incoming messages");
+        URL url = null;
         try {
-            URL url = new URL(endpointInfo.getAddress());
-            engine.addServant(url, 
-                    new JettyHTTPHandler(this, contextMatchOnExact()));
-            
+            url = new URL(endpointInfo.getAddress());
         } catch (Exception e) {
-            LOG.log(Level.WARNING, "URL creation failed: ", e);
+            throw new Fault(new Message("START_UP_SERVER_FAILED_MSG", LOG, e.getMessage()),
e);
         }
+        engine.addServant(url, 
+                          new JettyHTTPHandler(this, contextMatchOnExact()));
     }
 
     /**

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=646515&r1=646514&r2=646515&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Wed Apr  9 13:13:17 2008
@@ -32,8 +32,10 @@
 import javax.servlet.ServletContext;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.transport.HttpUriMapper;
 import org.apache.cxf.transport.https_jetty.JettySslConnectorFactory;
 import org.mortbay.jetty.AbstractConnector;
@@ -305,8 +307,9 @@
                     server.stop();
                     server.destroy();
                 } catch (Exception ex) {
-                    LOG.log(Level.SEVERE, "START_UP_SERVER_FAILED_MSG", new Object[] {e.getMessage()});
-                }    
+                    //ignore - probably wasn't fully started anyway
+                }
+                throw new Fault(new Message("START_UP_SERVER_FAILED_MSG", LOG, e.getMessage()),
e);
             }
         }        
         

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java?rev=646515&r1=646514&r2=646515&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java
Wed Apr  9 13:13:17 2008
@@ -41,7 +41,7 @@
         JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
         sf.getFeatures().add(new WSAddressingFeature());
         sf.setServiceBean(new GreeterImpl());
-        sf.setAddress("http://localhost/test");
+        sf.setAddress("http://localhost:9000/test");
         sf.setStart(false);
         sf.setBus(getBus());
         
@@ -55,7 +55,7 @@
     @Test
     public void testClientProxyFactory() {
         JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean(); 
-        cf.setAddress("http://localhost/test");
+        cf.setAddress("http://localhost:9000/test");
         cf.getFeatures().add(new WSAddressingFeature());
         cf.setServiceClass(Greeter.class);
         Greeter greeter = (Greeter) cf.create();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java?rev=646515&r1=646514&r2=646515&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java
Wed Apr  9 13:13:17 2008
@@ -51,7 +51,7 @@
      
         assert bus != null;
         sf.setServiceBean(new GreeterImpl());
-        sf.setAddress("http://localhost/test");
+        sf.setAddress("http://localhost:9000/test");
         sf.setStart(false);
         
         Configurer c = getBus().getExtension(Configurer.class);
@@ -67,7 +67,7 @@
     public void testClientProxyFactory() {
       
         JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean(); 
-        cf.setAddress("http://localhost/test");        
+        cf.setAddress("http://localhost:9000/test");        
         cf.setServiceClass(Greeter.class);
         cf.setBus(getBus());
         Configurer c = getBus().getExtension(Configurer.class);



Mime
View raw message