You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2008/08/01 17:11:41 UTC

svn commit: r681716 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/service/invoker/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ frontend/simple/src/main/java/org/apache/cxf/frontend/

Author: dkulp
Date: Fri Aug  1 08:11:39 2008
New Revision: 681716

URL: http://svn.apache.org/viewvc?rev=681716&view=rev
Log:
Make sure an invoker gets set.  
Propogate some error messages up so it's possible to diagnose why creation of the service object failed.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/PerRequestFactory.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/PerRequestFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/PerRequestFactory.java?rev=681716&r1=681715&r2=681716&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/PerRequestFactory.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/PerRequestFactory.java Fri Aug  1 08:11:39 2008
@@ -62,9 +62,9 @@
             }
             return o;
         } catch (InstantiationException e) {
-            throw new Fault(new Message("COULD_NOT_INSTANTIATE", BUNDLE));
+            throw new Fault(new Message("COULD_NOT_INSTANTIATE", BUNDLE), e);
         } catch (IllegalAccessException e) {
-            throw new Fault(new Message("ILLEGAL_ACCESS", BUNDLE));
+            throw new Fault(new Message("ILLEGAL_ACCESS", BUNDLE), e);
         }
     }
 

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java?rev=681716&r1=681715&r2=681716&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java Fri Aug  1 08:11:39 2008
@@ -45,6 +45,7 @@
 import org.apache.cxf.resource.ResourceManager;
 import org.apache.cxf.resource.ResourceResolver;
 import org.apache.cxf.service.invoker.Invoker;
+import org.apache.cxf.service.invoker.SingletonFactory;
 import org.apache.cxf.service.model.BindingInfo;
 
 /**
@@ -103,6 +104,9 @@
     
     @Override
     protected Invoker createInvoker() {
+        if (getServiceBean() == null) {
+            return new JAXWSMethodInvoker(new SingletonFactory(getServiceClass()));
+        }
         return new JAXWSMethodInvoker(getServiceBean());
     }
 

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=681716&r1=681715&r2=681716&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 Fri Aug  1 08:11:39 2008
@@ -46,7 +46,9 @@
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.invoker.BeanInvoker;
+import org.apache.cxf.service.invoker.FactoryInvoker;
 import org.apache.cxf.service.invoker.Invoker;
+import org.apache.cxf.service.invoker.SingletonFactory;
 
 
 /**
@@ -117,12 +119,12 @@
                                     getDestinationFactory(),
                                     getBindingFactory());
 
-            if (invoker == null) {
-                if (serviceBean != null) {
+            if (ep.getService().getInvoker() == null) {
+                if (invoker == null) {
                     ep.getService().setInvoker(createInvoker());
+                } else {
+                    ep.getService().setInvoker(invoker);
                 }
-            } else {
-                ep.getService().setInvoker(invoker);
             }
 
             if (start) {
@@ -210,6 +212,9 @@
 
 
     protected Invoker createInvoker() {
+        if (getServiceBean() == null) {
+            return new FactoryInvoker(new SingletonFactory(getServiceClass()));
+        }
         return new BeanInvoker(getServiceBean());
     }