[jboss-jira] [JBoss JIRA] (AS7-3225) ModuleGroupSingletonProvider throws NullPoinerException instead of clear exception message because of Hashtable usage

Geoffrey De Smet (Created) (JIRA) jira-events at lists.jboss.org
Mon Jan 9 08:58:09 EST 2012


ModuleGroupSingletonProvider throws NullPoinerException instead of clear exception message because of Hashtable usage
---------------------------------------------------------------------------------------------------------------------

                 Key: AS7-3225
                 URL: https://issues.jboss.org/browse/AS7-3225
             Project: Application Server 7
          Issue Type: Bug
          Components: CDI / Weld
            Reporter: Geoffrey De Smet
            Assignee: Stuart Douglas
            Priority: Minor


Here's a stacktrace we get:
{code}
14:45:47,087 INFO  [stdout] (http--127.0.0.1-8080-2) java.lang.NullPointerException
14:45:47,087 INFO  [stdout] (http--127.0.0.1-8080-2) 	at java.util.Hashtable.get(Hashtable.java:334)
14:45:47,087 INFO  [stdout] (http--127.0.0.1-8080-2) 	at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:71)
14:45:47,088 INFO  [stdout] (http--127.0.0.1-8080-2) 	at org.jboss.weld.Container.instance(Container.java:58)
14:45:47,088 INFO  [stdout] (http--127.0.0.1-8080-2) 	at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:72)
14:45:47,088 INFO  [stdout] (http--127.0.0.1-8080-2) 	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:124)
14:45:47,088 INFO  [stdout] (http--127.0.0.1-8080-2) 	at org.drools.guvnor.server.RepositoryAssetOperations$Proxy$_$$_WeldClientProxy.findAssetPage(RepositoryAssetOperations$Proxy$_$$_WeldClientProxy.java)
{code}

The code uses a java.util.Hashtable, which isn't null-safe (while a HashMap is)

Replacing this code in ModuleGroupSingletonProvider.java:
{code}
private final Map<ClassLoader, T> store = new Hashtable<ClassLoader, T>();
{code}
by this, will probably fix it
{code}
private final Map<ClassLoader, T> store = Collections.synchronizedMap(new HashMap<ClassLoader, T>());
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list