[seam-commits] Seam SVN: r8874 - branches/Seam_2_0/src/main/org/jboss/seam/core.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Sep 2 00:53:18 EDT 2008


Author: matt.drees
Date: 2008-09-02 00:53:18 -0400 (Tue, 02 Sep 2008)
New Revision: 8874

Modified:
   branches/Seam_2_0/src/main/org/jboss/seam/core/BijectionInterceptor.java
Log:
JBSEAM-3362
add context info even if CyclicDependencyException is wrapped by another exception

Modified: branches/Seam_2_0/src/main/org/jboss/seam/core/BijectionInterceptor.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/core/BijectionInterceptor.java	2008-09-02 04:53:02 UTC (rev 8873)
+++ branches/Seam_2_0/src/main/org/jboss/seam/core/BijectionInterceptor.java	2008-09-02 04:53:18 UTC (rev 8874)
@@ -4,11 +4,11 @@
 import java.util.concurrent.locks.ReentrantLock;
 
 import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
 import org.jboss.seam.annotations.intercept.AroundInvoke;
 import org.jboss.seam.annotations.intercept.Interceptor;
 import org.jboss.seam.intercept.AbstractInterceptor;
 import org.jboss.seam.intercept.InvocationContext;
+import org.jboss.seam.util.EJB;
 
 /**
  * Before invoking the component, inject all dependencies. After
@@ -98,10 +98,19 @@
          
          return result;
       }
-      catch (CyclicDependencyException cyclicDependencyException)
+      catch (Exception e)
       {
-         cyclicDependencyException.addInvocation(getComponent().getName(), invocation.getMethod());
-         throw cyclicDependencyException;
+         Exception root = e;
+         while (EJB.getCause(root) != null)
+         {
+            root = EJB.getCause(root);
+         }
+         if (root instanceof CyclicDependencyException)
+         {
+            CyclicDependencyException cyclicDependencyException = (CyclicDependencyException) root;
+            cyclicDependencyException.addInvocation(getComponent().getName(), invocation.getMethod());
+         }
+         throw e;
       }
       finally
       {            




More information about the seam-commits mailing list