cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1097175 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs: JAXRSInvoker.java Messages.properties
Date Wed, 27 Apr 2011 16:50:25 GMT
Author: sergeyb
Date: Wed Apr 27 16:50:24 2011
New Revision: 1097175

URL: http://svn.apache.org/viewvc?rev=1097175&view=rev
Log:
[JAX-RS] Logging a message which may help with resolving AOP-related invocation failures

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/Messages.properties

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java?rev=1097175&r1=1097174&r2=1097175&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java Wed Apr
27 16:50:24 2011
@@ -65,6 +65,8 @@ public class JAXRSInvoker extends Abstra
     private static final String REQUEST_SCOPE = "request";    
     private static final String LAST_SERVICE_OBJECT = "org.apache.cxf.service.object.last";
     private static final String REQUEST_WAS_SUSPENDED = "org.apache.cxf.service.request.suspended";
+    private static final String PROXY_INVOCATION_ERROR_FRAGMENT 
+        = "object is not an instance of declaring class"; 
     
     public JAXRSInvoker() {
     }
@@ -142,8 +144,9 @@ public class JAXRSInvoker extends Abstra
         }
         
 
-        Method methodToInvoke = InjectionUtils.checkProxy(
-            cri.getMethodDispatcher().getMethod(ori), resourceObject);
+        Method methodToInvoke = cri.getMethodDispatcher().getMethod(ori);
+        //InjectionUtils.checkProxy(
+        //    cri.getMethodDispatcher().getMethod(ori), resourceObject);
         
         List<Object> params = null;
         if (request instanceof List) {
@@ -161,6 +164,16 @@ public class JAXRSInvoker extends Abstra
             }
             result = invoke(exchange, resourceObject, methodToInvoke, params);
         } catch (Fault ex) {
+            String errorMessage = ex.getCause().getMessage();
+            if (errorMessage != null 
+                && errorMessage.contains(PROXY_INVOCATION_ERROR_FRAGMENT)) {
+                org.apache.cxf.common.i18n.Message errorM =
+                    new org.apache.cxf.common.i18n.Message("PROXY_INVOCATION_FAILURE",
+                                                           BUNDLE,
+                                                           methodToInvoke,
+                                                           cri.getServiceClass().getName());
+                LOG.severe(errorM.toString());
+            }
             Response excResponse = JAXRSUtils.convertFaultToResponse(ex.getCause(), 
                                                                      exchange.getInMessage());
             if (excResponse == null) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/Messages.properties?rev=1097175&r1=1097174&r2=1097175&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/Messages.properties (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/Messages.properties Wed
Apr 27 16:50:24 2011
@@ -21,4 +21,5 @@
 NO_RESOURCES_AVAILABLE=No resource classes found
 NO_SUBRESOURCE_FOUND=No subresource locator found for path {0}
 NULL_SUBRESOURCE=Null subresource locator is returned for path {0}
+PROXY_INVOCATION_FAILURE=Resource method "{0}" available at {1} can not be called on proxy.
Moving resource methods to interface and having {1} implement it may help.
 



Mime
View raw message