1 Reply Latest reply on Mar 29, 2012 10:24 PM by Fab Mars

    WELD-001318 AmbiguousResolutionException with Converter having subclass

    Fab Mars Novice

      I'm using GF 3.1.2 with JDK 1.6.0b29 + SeamFaces 3.1.0 + RichFaces 4.2.0

       

      On some page I have <rich:inputNumberSpinner label="Count" value="#{orderLine.quantity}" converter="IntegerOrNullConverter".../>

      The converter to use is explicit. But I also extended that converter class twice for other purposes.

      When accessing the page I get a WELD-001318 ambiguous dependency. Stacktrace below.

       

      SeamApplicationWrapper#createConverter ends up calling BeanManagerUtils#isDependentScoped which tries to CDI-resolve the the converter type. Naturally weld finds the 3 converters (the one I explicitly asked for for and the 2 subclasses) and it complains. I strongly believe calling BM#resolve here is wrong.

       

       

       

      GRAVE: org.jboss.weld.exceptions.AmbiguousResolutionException: WELD-001318 Cannot resolve an ambiguous dependency between [Managed Bean [class org.mars.toolkit.jsf.converter.MonthConverter] with qualifiers [@Any @Default], Managed Bean [class org.mars.toolkit.jsf.converter.IntegerOrNullConverter] with qualifiers [@Any @Default], Managed Bean [class org.mars.toolkit.jsf.converter.YearConverter] with qualifiers [@Any @Default]]

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

          at org.jboss.seam.faces.util.BeanManagerUtils.isDependentScoped(BeanManagerUtils.java:74)

          at org.jboss.seam.faces.environment.SeamApplicationWrapper.attemptExtension(SeamApplicationWrapper.java:81)

          at org.jboss.seam.faces.environment.SeamApplicationWrapper.createConverter(SeamApplicationWrapper.java:60)

          at org.jboss.seam.faces.environment.SeamApplicationWrapper$Proxy$_$$_WeldClientProxy.createConverter(SeamApplicationWrapper$Proxy$_$$_WeldClientProxy.java)

          at com.sun.faces.facelets.tag.jsf.ValueHolderRule$LiteralConverterMetadata.applyMetadata(ValueHolderRule.java:85)

          at com.sun.faces.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:81)

          at javax.faces.view.facelets.MetaTagHandler.setAttributes(MetaTagHandler.java:129)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.setAttributes(DelegatingMetaTagHandler.java:102)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.setAttributes(BehaviorsAddingComponentHandlerWrapper.java:113)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.doNewComponentActions(ComponentTagHandlerDelegateImpl.java:409)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:159)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)

          at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)

          at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)

          at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)

          at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)

          at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)

          at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:107)

          at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)

          at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)

          at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)

          at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:112)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)

          at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)

          at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)

          at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)

          at com.sun.faces.