I am using DeltaSpike 1.7.1 and CDI 1.0 (Weld 1.1.5) deployed on JBoss 7.1.1. It's a legacy project and I can't change the technologies we're using.
The problem happens only when I deploy multiple WAR files (I am aware that CDI has/had a problem with multiple WAR files inside an EAR, but I didn't find anything about multiple WAR files in a JBOSS instance outside an EAR file.
Note that the problem doesn't happen everytime a project is deployed, it happens, usually, when I ask Jenkins to build and deploy more than one project at once and I get this error message:
WELD-001318 Cannot resolve an ambiguous dependency between [Managed Bean [class org.apache.deltaspike.core.impl.scope.window.DefaultWindowContextQuotaHandler] with qualifiers [@Any @Default], Managed Bean [class org.apache.deltaspike.jsf.impl.scope.window.JsfWindowContextQuotaHandler] with qualifiers [@Any @Default]]
I tried to get rid of DeltaSpike, but the projects rely heavily on the @ViewAccessScoped annotation and it would waste a lot of time to change it all.
Check out this page:
https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7
more specifically, look at this setting in the JBOSS 7 Config:
<subsystem xmlns="urn:jboss:domain:ee:1.0" >
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
</subsystem>
It is likely setting this variable to true will solve your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With