Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1064956 - Timer operation fails in business central due to lack of cdi request scope
Summary: Timer operation fails in business central due to lack of cdi request scope
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER2
: 6.0.1
Assignee: Maciej Swiderski
QA Contact: Radovan Synek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-13 15:53 UTC by Maciej Swiderski
Modified: 2014-08-06 20:02 UTC (History)
2 users (show)

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


Attachments (Terms of Use)
process definition (deleted)
2014-03-07 14:56 UTC, Radovan Synek
no flags Details

Description Maciej Swiderski 2014-02-13 15:53:42 UTC
Description of problem:
any timer related operation fails with:
16:20:39,044 ERROR [org.jbpm.process.instance.timer.TimerManager] (pool-21-thread-2) Error when executing start process bpmsample.multistart timer job: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped
	at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:590) [weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1]
	at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:71) [weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1]
	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104) [weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1]
	at org.jboss.weld.proxies.RequestScopedBackupIdentityProvider$-2010073534$Proxy$_$$_WeldClientProxy.getName(RequestScopedBackupIdentityProvider$-2010073534$Proxy$_$$_WeldClientProxy.java) [weld-core-1.1.13.Final-redhat-1.jar:]
	at org.jbpm.kie.services.impl.audit.ServicesAwareAuditEventBuilder.getIdentityName(ServicesAwareAuditEventBuilder.java:106) [jbpm-kie-services-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
	at org.jbpm.kie.services.impl.audit.ServicesAwareAuditEventBuilder.buildEvent(ServicesAwareAuditEventBuilder.java:49) [jbpm-kie-services-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
	at org.jbpm.process.audit.JPAWorkingMemoryDbLogger.beforeProcessStarted(JPAWorkingMemoryDbLogger.java:129) [jbpm-audit-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]

due to not properly handled cdi request scope beans. for timers there is not request scope so identity of the caller is unknown as as that should be stored in history logs.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
timer operation fails

Expected results:
timer operation should complete successfully and identity of that operation should be unknown.


Additional info:

Comment 1 Maciej Swiderski 2014-02-19 13:00:52 UTC
fixed to catch exceptions in case no request scope is available and return unknown user in such case:

jbpm
master:
https://github.com/droolsjbpm/jbpm/commit/017552e014f305df3d8e1ee9356b8517a7ebca00

6.0.x:
https://github.com/droolsjbpm/jbpm/commit/9885ed0f0c4bebbe4c3d134d8a7e8dedc41830be

Comment 2 Radovan Synek 2014-03-07 14:56:14 UTC
Verified with BPMS-6.0.1.ER2, although I haven't managed to reproduce the issue in Business-Central 6.0.1.ER1 nor 6.0.0.GA. 

After discussing the issue with Maciej, here are possible reproducing steps:
1. Log in to Business Central (default H2 in-memory DB should be sufficient)
2. Deploy a process definition containing a timer and some waiting node (e.g. user task) after it. See the attachment.
3. Start the process, stacktrace as described should appear.

Comment 3 Radovan Synek 2014-03-07 14:56:43 UTC
Created attachment 871914 [details]
process definition


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