Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-643

Ambiguous dependencies for type BoundRequestContext when weld context controller under WELD, Jersey, and Tomcat

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Not A Problem
    • 0.7
    • None
    • CdiControl
    • None
    • Apache Jersey 2.9, WELD 2.1.2,

    Description

      My server is tomcat 7x, WELD 2.1.2 for CDI, To support CDI injection for Jersey Resource class, I added jersey-gf-cdi. Once jersey-gf-cdi is added, I can not use weld context controller anymore.

      I got this error

      org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type BoundRequestContext with qualifiers @Default
        at injection point [BackedAnnotatedField] @Inject private org.apache.deltaspike.cdise.weld.ContextController.requestContext
        at org.apache.deltaspike.cdise.weld.ContextController.requestContext(ContextController.java:0)
        Possible dependencies: 
        - WELD%AbstractSyntheticBean%flat%BoundRequestContext,
        - org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider$Hk2Bean@1af9196
      
      	at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
      	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:291)
      	at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
      	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:165)
      	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:529)
      	at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
      	at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
      

      I have a very simple maven project to reproduce this: https://github.com/jasonzhang2022/cidctrl

      This error also occurs for Deltaspike 05, and 0.6.

      Thanks

      Attachments

        Activity

          People

            Unassigned Unassigned
            jasonzhang2002@gmail.com jason zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: