Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1037445

Summary: Escalation does not work because userinfo.properties cannot be loaded
Product: [Retired] JBoss BPMS Platform 6 Reporter: Radovan Synek <rsynek>
Component: Business CentralAssignee: Roger Martínez <romartin>
Status: CLOSED CURRENTRELEASE QA Contact: Radovan Synek <rsynek>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: kverlaen
Target Milestone: ER6Keywords: Regression
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:07:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
server log excerpt none

Description Radovan Synek 2013-12-03 07:47:54 UTC
Created attachment 831934 [details]
server log excerpt

Description of problem:
When escalation occurs on a human task, userinfo.properties should be loaded. This does not happen - the classpath resource seems to be null, probably because of the modularization in ER5 (jbpm-human-task-core-6.0.0-redhat-6.jar, which wants to load this property file, is now an EAP module, but the property file is placed inside business-central.war). This escalation feature worked in ER4, now the attempt to load userinfo.properties ends up with an error stacktrace - see the attached server log.

Version-Release number of selected component (if applicable):
BPMS-6.0.0.ER5

Comment 1 Roger Martínez 2013-12-09 22:40:54 UTC
Hi,

The properties file named userinfo.properties that was loaded in classes:
- org.jbpm.services.task.identity.DefaultUserInfo
- org.jbpm.services.task.identity.PropertyUserInfoImpl

used this code to obtain the properties file:

"this.getClass().getResourceAsStream("/userinfo.properties")"

As you can see, the classloader to obtain the resource is the one from class DefaultUserInfo or PropertyUserInfoImpl, and when deploying using the EAP static modules distributions these classes are located into org.jbpm static module. By the other hand, the properties is located in the webapp, so org.jbpm module classloader does not have visibility to this resource.

The fix is performed by obtaining the resource from the current thread classloader, so the webapp one. The fixing code is:

"Thread.currentThread().getContextClassLoader().getResourceAsStream("/userinfo.properties")"

Once fixed, the exception "java.lang.IllegalStateException: Problem loading userinfo properties" is not thrown.

Currently I have another exception (nullpointer) when trying to send the notification email, but it's due to missconfiguration in JNDI mail sessions. Please, confirm with a valid mail session and users well configured that this nullpointer is not happening.

Thanks

Commits
=======

- master -> https://github.com/droolsjbpm/jbpm/commit/7de5a3757797442178f6cc5d260797eb6d5740b6

- 6.0.x -> https://github.com/droolsjbpm/jbpm/commit/66bf06dcddaec1df4a503d7725cefef24170149b

Comment 2 Radovan Synek 2013-12-11 15:02:16 UTC
Roger,

I was able to build the community version and it works for me (with configured mail session and userinfo.properties), no NPE.

Comment 3 Roger Martínez 2013-12-11 16:13:26 UTC
Radovan,

Great! I was quite sure it was my local enviroment configuration..

Thanks!

Comment 4 Radovan Synek 2014-01-08 09:23:29 UTC
Verified on BPMS-6.0.0.ER7