-
Bug
-
Resolution: Done
-
Major
-
jBPM 3.2.0
-
None
A Java class deployed with a process archive may need access to a class path resource deployed in the same process archive.
A common example is an ActionHandler implementation that calls a remote EJB and needs a jndi.properties file containin remote appserver location. In order to load that it calls :
this.getClass().getClassLoader().getResourceAsStream("jndi.properties")
This call generates a java.lang.NullPointerException which I think justifies the classification of this issue as a bug.
Looking inside the ProcessClassLoader class, I see that in order to load a class, a "classes/" prefix. Indeed, the "par" format wants that all compiled classes be locates underneath the "classes/" directory. The JBPM_BYTEARRAY.NAME_ field in the database table confirms this : the NAME_ of the jndi.properties resource is : "classes/jndi.properties".
Still the ProcessClassLoader.getResourceAsStream method does not use the classes prefix.
The fix look thus simple, i.e. adding that prefix.
Second problem : if the resource is not found, a delegation should be made to the parent classloader.