You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2018/08/14 11:32:30 UTC

[cxf] 04/04: ProviderFactory.createProviderFromConstructor should include exception cause

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 0cb9f4189d87b3afc3643612d7480ef5d1dbff74
Author: Rabea Gransberger <rg...@users.noreply.github.com>
AuthorDate: Fri Aug 10 12:13:43 2018 +0200

    ProviderFactory.createProviderFromConstructor should include exception cause
    
    If newInstance fails because the called constructor of a custom Application implementation throws an exception, the root cause is not included which would reduce the search time for the actual cause.
    
    (cherry picked from commit ab452c0eee1fd560bdc91324c4dfe838f1088877)
---
 .../src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
index 03b6a5e..1455d78 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
@@ -1183,7 +1183,7 @@ public abstract class ProviderFactory {
             instance = c.newInstance(cArgs);
         } catch (Throwable ex) {
             throw new RuntimeException("Resource or provider class " + c.getDeclaringClass().getName()
-                                       + " can not be instantiated");
+                                       + " can not be instantiated", ex);
         }
         Map<Class<?>, ThreadLocalProxy<?>> proxies =
             new LinkedHashMap<Class<?>, ThreadLocalProxy<?>>();