[jboss-cvs] JBossAS SVN: r60130 - in trunk/ejb3/src/main/org/jboss/injection: lang/reflect and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 31 03:35:56 EST 2007


Author: wolfc
Date: 2007-01-31 03:35:56 -0500 (Wed, 31 Jan 2007)
New Revision: 60130

Modified:
   trunk/ejb3/src/main/org/jboss/injection/JndiPropertyInjector.java
   trunk/ejb3/src/main/org/jboss/injection/lang/reflect/AbstractAccessibleObjectBeanProperty.java
Log:
better message on injection failure

Modified: trunk/ejb3/src/main/org/jboss/injection/JndiPropertyInjector.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/JndiPropertyInjector.java	2007-01-31 04:26:04 UTC (rev 60129)
+++ trunk/ejb3/src/main/org/jboss/injection/JndiPropertyInjector.java	2007-01-31 08:35:56 UTC (rev 60130)
@@ -70,7 +70,10 @@
       }
       catch (NamingException e)
       {
-         throw new RuntimeException("Unable to inject jndi dependency: " + jndiName + " into property " + property, e);
+         Throwable cause = e;
+         while(cause.getCause() != null)
+            cause = cause.getCause();
+         throw new RuntimeException("Unable to inject jndi dependency: " + jndiName + " into property " + property + ": " + cause.getMessage(), e);
       }
       return dependency;
    }

Modified: trunk/ejb3/src/main/org/jboss/injection/lang/reflect/AbstractAccessibleObjectBeanProperty.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/lang/reflect/AbstractAccessibleObjectBeanProperty.java	2007-01-31 04:26:04 UTC (rev 60129)
+++ trunk/ejb3/src/main/org/jboss/injection/lang/reflect/AbstractAccessibleObjectBeanProperty.java	2007-01-31 08:35:56 UTC (rev 60130)
@@ -44,4 +44,10 @@
    {
       return obj;
    }
+   
+   
+   public String toString()
+   {
+      return getDeclaringClass().getName() + "." + getName();
+   }
 }




More information about the jboss-cvs-commits mailing list