[jboss-jira] [JBoss JIRA] Closed: (JBJMX-110) Logger bug in org.jboss.mx.server.MBeanServerlImpl

Adrian Brock (JIRA) jira-events at lists.jboss.org
Mon Aug 25 11:41:46 EDT 2008


     [ https://jira.jboss.org/jira/browse/JBJMX-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Brock closed JBJMX-110.
------------------------------

    Resolution: Rejected


handleInstantiateExceptions() doesn't necessarily always throw an exception,
although in practice it tries to deal with all known possiblities.

But there is no else{} block in that method.

The logging is there to trap cases where we might have missed a case,
not to log the thrown exception. The "log and throw" anti-pattern generally
just leads to noisy logs as the execption gets logged multiple times.

That's why the log message says **unhandled exception**

> Logger bug in org.jboss.mx.server.MBeanServerlImpl
> --------------------------------------------------
>
>                 Key: JBJMX-110
>                 URL: https://jira.jboss.org/jira/browse/JBJMX-110
>             Project: JBoss JMX
>          Issue Type: Bug
>    Affects Versions: JBossAS-5.0 Alpha, JBossAS-4.0.0
>         Environment: Jboss 5.0.0.CR1
>            Reporter: v a
>            Priority: Minor
>
> org.jboss.mx.server.MBeanServerlImpl:
> In the function protected Object instantiate(String className, ClassLoader cl, Object[] params, String[] signature) in catch section (line 1246). The order of logging and calling handleInstantiateExceptions is incorrect:
> catch (Throwable t)
> {
>     handleInstantiateExceptions(t, className);
>     log.error("Unhandled exception instantiating class: " + className, t);
>     return null;
> }
> handleInstantiateExceptions always throws an exception therefore log.error will be never called.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list