geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r560100 - in /geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo: gbean/GBeanInfo.java kernel/basic/ProxyMethodInterceptor.java kernel/repository/Artifact.java
Date Fri, 27 Jul 2007 05:00:39 GMT
Author: djencks
Date: Thu Jul 26 22:00:38 2007
New Revision: 560100

URL: http://svn.apache.org/viewvc?view=rev&rev=560100
Log:
Improved error messages

Modified:
    geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java
    geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
    geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Artifact.java

Modified: geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java?view=diff&rev=560100&r1=560099&r2=560100
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java
Thu Jul 26 22:00:38 2007
@@ -77,7 +77,20 @@
                 throw new InvalidConfigurationException("Class does not have a getGBeanInfo()
method: " + className);
             }
         } catch (NoClassDefFoundError e) {
-            throw new InvalidConfigurationException("Could not find getGBeanInfo method on
" + className, e);
+            String message = e.getMessage();
+            StringBuffer buf = new StringBuffer("Could not load gbean class ").append(className).append("
due to NoClassDefFoundError\n");
+            if (message != null) {
+                message = message.replace('/', '.');
+                buf.append("    problematic class ").append(message);
+                try {
+                    Class hardToLoad = classLoader.loadClass(message);
+                    buf.append(" can be loaded in supplied classloader ").append(classLoader).append("\n");
+                    buf.append("    and is found in ").append(hardToLoad.getClassLoader());
+                } catch (ClassNotFoundException e1) {
+                    buf.append(" cannot be loaded in supplied classloader ").append(classLoader).append("\n");
+                }
+            }
+            throw new InvalidConfigurationException(buf.toString(), e);
         }
         try {
             return (GBeanInfo) method.invoke(null, new Object[]{});

Modified: geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java?view=diff&rev=560100&r1=560099&r2=560100
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
Thu Jul 26 22:00:38 2007
@@ -84,13 +84,13 @@
         int interfaceIndex = proxy.getSuperIndex();
         synchronized (this) {
             if (gbeanInvokers == null) {
-                throw new DeadProxyException("Proxy is no longer valid");
+                throw new DeadProxyException("Proxy is no longer valid to gbean: " + abstractName);
             }
             gbeanInvoker = gbeanInvokers[interfaceIndex];
         }
 
         if (gbeanInvoker == null) {
-            throw new UnsupportedOperationException("No implementation method: objectName="
+ abstractName + ", method=" + method);
+            throw new UnsupportedOperationException("No implementation method: abstractName="
+ abstractName + ", method=" + method);
         }
 
         return gbeanInvoker.invoke(abstractName, args);

Modified: geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Artifact.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Artifact.java?view=diff&rev=560100&r1=560099&r2=560100
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Artifact.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Artifact.java
Thu Jul 26 22:00:38 2007
@@ -36,7 +36,7 @@
     }
 
     public Artifact(String groupId, String artifactId, Version version, String type) {
-        if (artifactId == null) throw new NullPointerException("artifactId is null");
+        if (artifactId == null) throw new NullPointerException("artifactId is null: groupId:
" + groupId + ", version: " + version + ", type: " + type);
         this.groupId = groupId;
         this.artifactId = artifactId;
         this.version = version;



Mime
View raw message