Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2478

jBPM4 and Spring: unintended wiring PropertiesFactoryBean to RepositoryCacheImpl.deployments field

XMLWordPrintable

      If you define a spring bean (<bean name="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean" ) this bean will be an instance of java.util.Hashtable (java.util.Properties) at runtime.

      During jBPM initialization various ObjectDescriptiors create instances they describe. So do the descriptor of org.jbpm.pvm.internal.repository.RepositoryCacheImpl.
      After creation the auto-wire mechanism tries to set-up the fields. In case of RepositoryCacheImpl there is just one field: Map<String, Object> deployments.

      The "configProperties" bean will be found in the SpringContext since java.util.Hashtable implements java.util.Map and the field "RepositoryCacheImpl.deployments" will be set because there is just one object of the requested type (java.util.Map). The isAutoWireEnabled attribute is set to "true" (hardcoded) at RepositoryCacheBinding.

      This behavior causes a NullPointerException when deleting a deployment

      RepositoryCacheImpl.java line 45
      deployments.put(deploymentId, null);

      That statement works on java.util.HashMap (created when instantiate RepositoryCacheImpl) but not on java.util.Hashtable.

      That behaviour might influence several other components.

              rebody HuiSheng Xu (Inactive)
              feichtegegr Michael Feichtegger (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: