djencks 2004/01/21 11:43:04
Modified: modules/kernel/src/java/org/apache/geronimo/gbean/jmx
SingleProxy.java
Log:
Provide useful info on exceptions. Dain, please review attemptFullStart
Revision Changes Path
1.6 +10 -3
incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/SingleProxy.java
Index: SingleProxy.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/SingleProxy.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SingleProxy.java 19 Jan 2004 06:33:24 -0000 1.5
+++ SingleProxy.java 21 Jan 2004 19:43:04 -0000 1.6
@@ -70,6 +70,7 @@
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.Factory;
import net.sf.cglib.proxy.SimpleCallbacks;
+import net.sf.cglib.core.CodeGenerationException;
/**
*
@@ -133,7 +134,13 @@
});
enhancer.setCallbacks(new SimpleCallbacks());
enhancer.setClassLoader(type.getClassLoader());
- Factory factory = enhancer.create();
+ Factory factory = null;
+ try {
+ factory = enhancer.create();
+ } catch (CodeGenerationException e) {
+ log.info("Most likely you are enhancing a class rather than an
interface and it lacks a default constructor" + e.getMessage());
+ throw e;
+ }
methodInterceptor = new ProxyMethodInterceptor(factory.getClass());
proxy = factory.newInstance(methodInterceptor);
}
@@ -213,7 +220,7 @@
waitingForMe = false;
gmbean.attemptFullStart();
} catch (Exception e) {
- log.warn("Exception occured while attempting to fully start:
objetName=" + gmbean.getObjectName());
+ log.warn("Exception occured while attempting to fully start:
objectName=" + gmbean.getObjectName(), e);
}
}