Bug 1175272

Summary: CDI fails when both remote and embedded uber-jar are present
Product: [JBoss] JBoss Data Grid 6 Reporter: Martin Gencur <mgencur>
Component: Build, InfinispanAssignee: Tristan Tarrant <ttarrant>
Status: CLOSED UPSTREAM QA Contact: Martin Gencur <mgencur>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: afield, chuffman, jdg-bugs, tsykora, ttarrant, vjuranek
Target Milestone: ER2   
Target Release: 6.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
In Red Hat JBoss Data Grid, when both <parameter>infinispan-remote</parameter> and <parameter>infinispan-embedded</parameter> dependencies are on the classpath, the Infinispan CDI extension does not work as expected. This is due to bundling the Infinispan CDI extension in both jar files. As a result, CDI fails with ambiguous dependencies exception. This is resolved as of Red Hat JBoss Data Grid 6.6.0. The content of infinispan-embedded and infinispan-remote were restructured so that only one of the jar files is needed for any use case. There is no need to use them together anymore.
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:43:46 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:
Bug Depends On: 1278424    
Bug Blocks:    

Description Martin Gencur 2014-12-17 12:14:11 UTC
See https://issues.jboss.org/browse/ISPN-5092

Comment 2 Sebastian Łaskawiec 2015-01-16 13:08:32 UTC
Unfortunately bad news on this one - in short it can't be done.

I consulted this with Martin Kouba and Jozef Hartinger. They pointed out that CDI Spec states [1]: "If a bean class is deployed in two different bean archives, non-portable behavior results. Portable applications must deploy each bean class in no more than one bean archive." 

I believe we have at least 2 choices what to do next:
1. Document it as unsupported configuration (my recommendation).
2. Pull the CDI extension out of embedded/remote Uber Jars. This will allow our client to use them both of them and add CDI extension manually.

[1] http://docs.jboss.org/cdi/spec/1.0/html_single/#beanarchive

Comment 3 JBoss JIRA Server 2015-04-09 13:59:01 UTC
Sebastian Łaskawiec <slaskawi> updated the status of jira ISPN-5092 to Closed

Comment 4 Tomas Sykora 2015-04-10 14:15:35 UTC
Looks like worth commenting here. IIRC we need both uber-jars at class path in remote cache store scenario.

Comment 7 Sebastian Łaskawiec 2015-11-04 09:16:31 UTC
Unfortunately this issue can not be fully fixed without breaking backward compatibility. An ideal solution would require moving classes from org.infinispan.cdi package into org.infinispan.cdi.common/remote/embedded. 

Having this in mind we can not fix it entirely in JDG 6.x series (minor releases). However we can do it in JDG7.

Comment 8 Sebastian Łaskawiec 2015-11-05 13:59:54 UTC
Unfortunately there is an issue with JCache Annotation extension (mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1278424) and we can not verify this issue in this milestone.

Comment 9 Martin Gencur 2015-11-05 14:01:40 UTC
Cannot be verified without https://bugzilla.redhat.com/show_bug.cgi?id=1278424 being fixed.

Comment 11 Martin Gencur 2015-11-19 09:51:42 UTC
Looks good in ER2.

Comment 15 Red Hat Bugzilla 2025-02-10 03:43:46 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.