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

Richard Zowalla resolved TOMEE-4350.
------------------------------------
    Fix Version/s: 10.0.0-M2
                   9.1.4
       Resolution: Fixed

> mp-jwt: Add qualifier for produced Jsonb
> ----------------------------------------
>
>                 Key: TOMEE-4350
>                 URL: https://issues.apache.org/jira/browse/TOMEE-4350
>             Project: TomEE
>          Issue Type: Improvement
>          Components: TomEE Core Server
>    Affects Versions: 10.0.0-M1, 9.1.3
>            Reporter: Markus Jung
>            Assignee: Markus Jung
>            Priority: Minor
>             Fix For: 10.0.0-M2, 9.1.4
>
>         Attachments: reproducer.zip
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> JsonbProducer currently produces an unqalified Jsonb, making it impossible 
> for the application to define its own producer: 
> [https://github.com/apache/tomee/blob/tomee-project-10.0.0-M1/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/JsonbProducer.java]
>  
> This results in the following deployment error when OWB starts up (reproducer 
> attached):
> {code:java}
> 05-Jun-2024 15:48:31.010 SEVERE [main] 
> org.apache.openejb.cdi.OpenEJBLifecycle.startApplication CDI Beans module 
> deployment failed
>         org.apache.webbeans.exception.WebBeansDeploymentException: 
> jakarta.enterprise.inject.AmbiguousResolutionException: There is more than 
> one Bean with type jakarta.json.bind.Jsonb Qualifiers: 
> [@jakarta.enterprise.inject.Default()]
> for injection into Field Injection Point, field name :  jsonb, Bean Owner : 
> [ExampleBean, WebBeansType:MANAGED, Name:null, API 
> Types:[java.lang.Object,org.example.ExampleBean], 
> Qualifiers:[jakarta.enterprise.inject.Default,jakarta.enter
> prise.inject.Any]]
> found beans:  
> Jsonb, WebBeansType:PRODUCERMETHOD, Name:null, API 
> Types:[java.lang.Object,jakarta.json.bind.Jsonb,java.lang.AutoCloseable], 
> Qualifiers:[jakarta.enterprise.inject.Default,jakarta.enterprise.inject.Any], 
> Producer Method: public jakarta.j
> son.bind.Jsonb org.example.JsonbProducer.createJsonb() from 
> file:/home/markus/tmp/tomee-jsonb-unqalified/target/apache-tomee/webapps/tomee-embedded-mp-1.0-SNAPSHOT/WEB-INF/classes/org/example/JsonbProducer.class
> Jsonb, WebBeansType:PRODUCERMETHOD, Name:null, API 
> Types:[java.lang.Object,jakarta.json.bind.Jsonb,java.lang.AutoCloseable], 
> Qualifiers:[jakarta.enterprise.inject.Default,jakarta.enterprise.inject.Any], 
> Producer Method: public jakarta.j
> son.bind.Jsonb org.apache.tomee.microprofile.jwt.cdi.JsonbProducer.create() 
> from 
> jar:file:/home/markus/tmp/tomee-jsonb-unqalified/target/apache-tomee/lib/mp-jwt-10.0.0-M1.jar!/org/apache/tomee/microprofile/jwt/cdi/JsonbProducer.class
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to