Bug 1037445 - Escalation does not work because userinfo.properties cannot be loaded
Summary: Escalation does not work because userinfo.properties cannot be loaded
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER6
: 6.0.0
Assignee: Roger Martínez
QA Contact: Radovan Synek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-03 07:47 UTC by Radovan Synek
Modified: 2014-08-06 20:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:07:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
server log excerpt (155.91 KB, text/x-log)
2013-12-03 07:47 UTC, Radovan Synek
no flags Details

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


Note You need to log in before you can comment on or make changes to this bug.