Bug 1030650

Summary: Split data types in different jars than implementation
Product: [Retired] JBoss BPMS Platform 6 Reporter: Adam Baxter <abaxter>
Component: jBPM CoreAssignee: Maciej Swiderski <mswiders>
Status: CLOSED WONTFIX QA Contact: Jiri Svitak <jsvitak>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.0CC: abaxter, kverlaen, mbaluch, rrajasek, rzhang
Target Milestone: ER1   
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-02-11 15:17:44 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:

Description Adam Baxter 2013-11-14 21:08:02 UTC
Description of problem:
Including datatypes in a project necessitates the inclusion of quite a few implementation details, including CDI. This is problematic when trying to create a client facing application that needs no implementation details. In our case, CDI will deploy on the client application, which is unwanted behavior. 

I would like a set of data type only jars

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

How reproducible:
Extremely

Steps to Reproduce:
1. Include kie-services-client or human-task-core for Jaxb data classes

Actual results:
CDI and other deployments occur

Expected results:
No CDI & other deployments occur

Additional info:

Comment 2 Adam Baxter 2013-11-14 21:11:43 UTC
Stacktrace:

14:43:29,015 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."jbpm-ee-external-test-1.0.0-SNAPSHOT.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."jbpm-ee-external-test-1.0.0-SNAPSHOT.war".WeldStartService: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [EntityManager] with qualifiers [@Default] at injection point [[field] @Inject private org.jbpm.shared.services.impl.JbpmServicesPersistenceManagerImpl.em]
	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
	at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
	at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
	at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	... 3 more

Comment 3 Marco Rietveld 2014-01-07 11:55:53 UTC
Maciej has rewritten the jbpm-human-task-core module so that CDI is no longer used. That commit effectively solves the problem with CDI, although there are now "slim" jars that only contain the data types. 

See this commit (and the subsequent 3 or 4 -- although bewarned, it's a large commit and thus a large page which main strain or freeze your browser): 
https://github.com/droolsjbpm/jbpm/commit/cc430e3c

Comment 4 Adam Baxter 2014-01-20 17:03:32 UTC
After this was fixed, we found some more CDI injection requirements in jbpm-runtime-manager. 

We use RuntimeEnvironmentBuilder and AbstractRuntimeManager classes. jbpm-runtime-manager has a class CDITaskServiceFactory which requires an @Inject on org.kie.api.task.TaskService

11:50:04,375 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."jbpm-ee-services.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."jbpm-ee-services.war".WeldStartService: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [TaskService] with qualifiers [@Default] at injection point [[field] @Inject private org.jbpm.runtime.manager.impl.factory.CDITaskServiceFactory.taskService]
	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
	at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
	at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
	at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	... 3 more

Comment 5 Jiri Svitak 2014-01-20 17:09:48 UTC
Adam, thank you for your check. Returning back.

Comment 6 Maciej Swiderski 2014-02-05 11:09:50 UTC
this requirement for runtime manager has been removed as part of BZ-1056236 (https://bugzilla.redhat.com/show_bug.cgi?id=1056236) so it should not be required any more. In case CDI injection is not available it will fallback to regular task service factory seamlessly.