Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DeltaSpike ambiguous dependency between DefaultWindowContextQuotaHandler and JsfWindowContextQuotaHandler

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.

like image 442
Diego Urenia Avatar asked Aug 23 '16 13:08

Diego Urenia


1 Answers

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.

like image 190
dieterh Avatar answered Oct 13 '22 17:10

dieterh