geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r991395 - /geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java
Date Tue, 31 Aug 2010 23:26:36 GMT
Author: djencks
Date: Tue Aug 31 23:26:36 2010
New Revision: 991395

URL: http://svn.apache.org/viewvc?rev=991395&view=rev
Log:
convert xbean creation exceptions to something Holder clients already understand

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java?rev=991395&r1=991394&r2=991395&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java
Tue Aug 31 23:26:36 2010
@@ -33,6 +33,7 @@ import java.util.Set;
 import javax.naming.Context;
 import javax.naming.NamingException;
 
+import org.apache.xbean.recipe.ConstructionException;
 import org.apache.xbean.recipe.ObjectRecipe;
 import org.apache.xbean.recipe.Option;
 import org.slf4j.Logger;
@@ -171,7 +172,12 @@ public class Holder implements Serializa
         if (!problems.isEmpty()) {
             throw new InstantiationException("Some objects to be injected were not found
in jndi: " + problems);
         }
-        Object result = objectRecipe.create(classLoader);
+        Object result;
+        try {
+            result = objectRecipe.create(classLoader);
+        } catch (ConstructionException e) {
+            throw (InstantiationException)new InstantiationException("Could not construct
object").initCause(e);
+        }
         if (getPostConstruct() != null) {
             try {
                 apply(result, null, postConstruct);



Mime
View raw message