activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (AMQ-1229) Thread.currentThread().getContextClassLoader() null in FactoryFinder.newInstance
Date Tue, 12 Jun 2007 13:54:33 GMT

     [ https://issues.apache.org/activemq/browse/AMQ-1229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Strachan resolved AMQ-1229.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0.0

Patch applied, many thanks!

> Thread.currentThread().getContextClassLoader() null in FactoryFinder.newInstance
> --------------------------------------------------------------------------------
>
>                 Key: AMQ-1229
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1229
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Transport
>            Reporter: John McLeroy
>             Fix For: 5.0.0
>
>         Attachments: FactoryFinder.java
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> org.apache.activemq.util.FactoryFinder.doFindFactoryProperies() correctly consults the
current class's loader if Thread.currentThread().getContextClassLoader() is null:
>         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
>         if (classLoader == null) classLoader = getClass().getClassLoader();
> newInstance(), however, generates a null pointer exception if Thread.currentThread().getContextClassLoader()
is null:
>         Class clazz;
>         try {
>             clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
>         } catch (ClassNotFoundException e) {
>             clazz = FactoryFinder.class.getClassLoader().loadClass(className);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message