2 Replies Latest reply on Sep 1, 2016 2:04 PM by Fabricio Noda

    DeltaSpike ambiguous dependency between DefaultWindowContextQuotaHandler and JsfWindowContextQuotaHandler

    Fabricio Noda Newbie

      Hi, please, anyone knows about this issue?

      "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."

      http://stackoverflow.com/questions/39102278/deltaspike-ambiguous-dependency-between-defaultwindowcontextquotahandler-and-jsf

      Thanks!

        • 1. Re: DeltaSpike ambiguous dependency between DefaultWindowContextQuotaHandler and JsfWindowContextQuotaHandler
          Tomas Remes Expert

          Hi,

          Well to be honest I am not really sure about some suitable advice. Weld 1.1.5.Final is 4 years old and I think you should be able to update it in your JBoss 7.1.1 app server. I briefly looked at those ambiguous classes and JsfWindowContextQuotaHandler specializes the DefaultWindowContextQuotaHandler. This could be some bug because AFAIK there were several updates wrt specialization in newer versions of Weld - e.g. [WELD-1149] Fix specialization - JBoss Issue Tracker. Anyway the full stacktrace could be helpful as well as to try to isolate the problem so that it's 100% reproducible.

          • 2. Re: DeltaSpike ambiguous dependency between DefaultWindowContextQuotaHandler and JsfWindowContextQuotaHandler
            Fabricio Noda Newbie

            Thanks for answering!


            Follows the stacktrace below:


            ERROR (interrompido.jsp\:109) - Unexpected error: org.jboss.weld.exceptions.AmbiguousResolutionException: 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]]

                    at org.jboss.weld.manager.BeanManagerImpl.resolve(BeanManagerImpl.java:1013)

                    at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:116)

                    at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:703)

                    at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:712)

                    at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:161)

                    at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)

                    at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:157)

                    at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:131)

                    at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:153)

                    at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:290)

                    at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)

                    at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)

                    at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)

                    at org.apache.deltaspike.core.impl.scope.window.WindowBeanHolder$Proxy$_$$_WeldClientProxy.getContextualStorage(WindowBeanHolder$Proxy$_$$_WeldClientProxy.java)

                    at org.apache.deltaspike.core.impl.scope.window.WindowContextImpl.getContextualStorage(WindowContextImpl.java:119)

                    at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:78)

                    at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:73)

                    at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)

                    at org.apache.deltaspike.core.impl.scope.viewaccess.ViewAccessViewHistory$Proxy$_$$_WeldClientProxy.getLastView(ViewAccessViewHistory$Proxy$_$$_WeldClientProxy.java)

                    at org.apache.deltaspike.core.impl.scope.viewaccess.ViewAccessContext.close(ViewAccessContext.java:131)

                    at org.apache.deltaspike.core.impl.scope.viewaccess.ViewAccessContext.onProcessingViewFinished(ViewAccessContext.java:119)

                    at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.render(DeltaSpikeLifecycleWrapper.java:118)

                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

                    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

                    at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

                    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:200)

                    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

                    at br.jus.tjmg.view.filter.IECompatibilityFilter.doFilter(IECompatibilityFilter.java:29)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

                    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489)

                    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

                    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                    at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:416)

                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

                    at java.lang.Thread.run(Thread.java:745)