Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-3225

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 7.1.0.Final
    • None
    • CDI / Weld
    • None

    Description

      Here's a stacktrace we get:

      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)
      

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

      Replacing this code in ModuleGroupSingletonProvider.java:

      private final Map<ClassLoader, T> store = new Hashtable<ClassLoader, T>();
      

      by this, will probably fix it

      private final Map<ClassLoader, T> store = Collections.synchronizedMap(new HashMap<ClassLoader, T>());
      

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: