Author: cschneider
Date: Thu Jan 15 16:02:22 2015
New Revision: 1652150

URL: http://svn.apache.org/r1652150
Log:
ARIES-1271 Make sure the original exception is thrown

Modified:
    
aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/EntityManagerProxyFactory.java
    
aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/QuiesceEMFHandler.java

Modified: 
aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/EntityManagerProxyFactory.java
URL: 
http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/EntityManagerProxyFactory.java?rev=1652150&r1=1652149&r2=1652150&view=diff
==============================================================================
--- 
aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/EntityManagerProxyFactory.java
 (original)
+++ 
aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/EntityManagerProxyFactory.java
 Thu Jan 15 16:02:22 2015
@@ -1,6 +1,7 @@
 package org.apache.aries.jpa.container.quiesce.impl;
 
 import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 
@@ -35,7 +36,9 @@ class EntityManagerProxyFactory {
               new 
PersistenceException(NLS.MESSAGES.getMessage("wrong.JPA.version", new Object[]{
                   method.getName(), delegate
               }), e);
-            }
+            } catch (InvocationTargetException e) {
+                throw e.getCause();
+            } 
             
             // This will only ever be called once, the second time there
             // will be an IllegalStateException from the line above

Modified: 
aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/QuiesceEMFHandler.java
URL: 
http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/QuiesceEMFHandler.java?rev=1652150&r1=1652149&r2=1652150&view=diff
==============================================================================
--- 
aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/QuiesceEMFHandler.java
 (original)
+++ 
aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/quiesce/impl/QuiesceEMFHandler.java
 Thu Jan 15 16:02:22 2015
@@ -1,6 +1,7 @@
 package org.apache.aries.jpa.container.quiesce.impl;
 
 import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
@@ -59,7 +60,9 @@ class QuiesceEMFHandler implements Invoc
           new 
PersistenceException(NLS.MESSAGES.getMessage("wrong.JPA.version", new Object[]{
               method.getName(), delegate
           }), e);
-        }
+        } catch (InvocationTargetException e) {
+            throw e.getCause();
+        } 
 
         // This will only ever be called once, the second time there
         // will be an IllegalStateException from the line above


Reply via email to