User: juhalindfors
Date: 02/03/20 09:01:46
Modified: src/main/org/jboss/mx/server/registry Tag: BranchMX_1_0
BasicMBeanRegistry.java
Log:
slightly more descriptive exception messages for MBeanRegistrationException
also log the *wrapped* exception, it's usually the more interesting one
Revision Changes Path
No revision
No revision
1.9.2.3 +19 -9
jmx/src/main/org/jboss/mx/server/registry/BasicMBeanRegistry.java
Index: BasicMBeanRegistry.java
===================================================================
RCS file:
/cvsroot/jboss/jmx/src/main/org/jboss/mx/server/registry/BasicMBeanRegistry.java,v
retrieving revision 1.9.2.2
retrieving revision 1.9.2.3
diff -u -r1.9.2.2 -r1.9.2.3
--- BasicMBeanRegistry.java 16 Mar 2002 12:38:51 -0000 1.9.2.2
+++ BasicMBeanRegistry.java 20 Mar 2002 17:01:46 -0000 1.9.2.3
@@ -55,7 +55,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>.
* @author <a href="mailto:[EMAIL PROTECTED]">Trevor Squires</a>.
* @author <a href="mailto:[EMAIL PROTECTED]">Adrian Brock</a>.
- * @version $Revision: 1.9.2.2 $
+ * @version $Revision: 1.9.2.3 $
*/
public class BasicMBeanRegistry
implements MBeanRegistry, BasicMBeanRegistryMBean
@@ -218,19 +218,22 @@
// if the MBean throws MBeanRegistrationException, don't rewrap it
if (e instanceof MBeanRegistrationException)
{
- e.fillInStackTrace();
throw e;
}
- throw new MBeanRegistrationException(e, "preRegister() failed: " +
e.toString());
+ throw new MBeanRegistrationException(e,
+ "preRegister() failed " +
+ "[ObjectName='" + name +
+ "', Class=" + object.getClass().getName() +
+ " (" + object + ")]"
+ );
}
catch (Throwable t)
{
// we can't wrap errors with MBeanRegistrationException
- log.debug("preRegister() failed: ", t);
+ log.warn("preRegister() failed for " + name + ": ", t);
- t.fillInStackTrace();
throw t;
}
}
@@ -273,7 +276,6 @@
if (object instanceof ClassLoader)
loaderRepository.removeClassLoader((ClassLoader)object);
- t.fillInStackTrace();
throw t;
}
}
@@ -282,7 +284,6 @@
// Problem, remove the mbean from the registry
remove(regName);
- t.fillInStackTrace();
throw t;
}
}
@@ -296,7 +297,6 @@
// Something is broken
log.error("Unexpected Exception:", t);
- t.fillInStackTrace();
throw t;
}
}
@@ -310,8 +310,18 @@
{
// The MBean cancelled the registration
registrationDone = false;
+
+ // FIXME: the logs below should probably be of type WARN as an exception
+ // from within the bean's preRegister() is most likely unintentional
+ // and indicates a coding error or unsatisfied dependency, etc --
+ // debug for now since we're dumping everything on the console....
(jpl)
+ log.debug("preRegister() failed " +
+ "[ObjectName='" + name +
+ "', Class=" + object.getClass().getName() +
+ " (" + object + ")]"
+ );
+ log.debug("Target Exception: ", e.getTargetException());
- e.fillInStackTrace();
throw e;
}
catch (RuntimeOperationsException e)
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development