[ 
https://issues.apache.org/jira/browse/DELTASPIKE-643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek resolved DELTASPIKE-643.
-----------------------------------------

    Resolution: Not a Problem

jersey adds 4 bound-contexts (for the request-, session-, conversation- and 
application-context) in CdiComponentProvider#afterDiscoveryObserver as beans.

that's
#1 not portable at all
#2 highly questionable (adding beans to the cdi-container which are shipped by 
the cdi-container already).

> Ambiguous dependencies for type BoundRequestContext when weld context 
> controller  under WELD, Jersey, and Tomcat
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: DELTASPIKE-643
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-643
>             Project: DeltaSpike
>          Issue Type: Bug
>          Components: CdiControl
>    Affects Versions: 0.7
>         Environment: Apache Jersey 2.9, WELD  2.1.2, 
>            Reporter: jason zhang
>            Priority: Critical
>
> 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
> {code}
> 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)
> {code}
> 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



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to