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
Attachments: FactoryFinder.java
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.