activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John McLeroy (JIRA)" <>
Subject [jira] Created: (AMQ-1229) Thread.currentThread().getContextClassLoader() null in FactoryFinder.newInstance
Date Mon, 16 Apr 2007 18:02:34 GMT
Thread.currentThread().getContextClassLoader() null in FactoryFinder.newInstance

                 Key: AMQ-1229
             Project: ActiveMQ
          Issue Type: Bug
          Components: Transport
            Reporter: John McLeroy

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.

View raw message