snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Resteasy Reactive detects beanparam as cdi bean. #253

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug I have a simple quarkus app, in which I use BeanParam for my Get resources. Apperantly, quarkus detects the as Beanparam annotated classes as cdi beans, see warning below. This is not correct, since my HelloParams POJO does not have a scope set.

If I add Unremovable to the HelloParams class, the warning does not happen.

Expected behavior This warning should not happen if the as beanparam annotated parameter does not have a scope set, i.e. is not a cdi bean.

Actual behavior

__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2021-01-30 09:34:11,489 WARN  [io.qua.arc.impl] (Quarkus Main Thread) 
================================================================================
CDI: programmatic lookup problem detected
-----------------------------------------
At least one bean matched the required type and qualifiers but was marked as unused and removed during build
Removed beans:
        - CLASS bean org.acme.HelloParams [types=[class org.acme.HelloParams], qualifiers=[@javax.enterprise.inject.Default(), @javax.enterprise.inject.Any()]]
Required type: class org.acme.HelloParams
Required qualifiers: [@javax.enterprise.inject.Default()]
Solutions:
        - Application developers can eliminate false positives via the @Unremovable annotation
        - Extensions can eliminate false positives via build items, e.g. using the UnremovableBeanBuildItem
        - See also https://quarkus.io/guides/cdi-reference#remove_unused_beans
================================================================================

2021-01-30 09:34:11,650 INFO  [io.quarkus] (Quarkus Main Thread) rr-beanparam-unremovable 1.0.0-SNAPSHOT on JVM (powered by Quarkus 1.11.1.Final) started in 0.773s. Listening on: http://localhost:8080
2021-01-30 09:34:11,650 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-01-30 09:34:11,650 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy-reactive]
^C2021-01-30 09:34:48,368 INFO  [io.quarkus] (Shutdown thread) rr-beanparam-unremovable stopped in 0.003s

To Reproduce

Steps to reproduce the behavior:

  1. Download the reproducer: rr-beanparam-unremovable.zip
  2. mvn quarkus:dev
  3. The warning from above happens, but a call to http://localhost:8080/hello-resteasy-reactive?name=test correctly shows the queryparam.
  4. Add @Unremovable to HelloParams. The warning does not happen now.

Environment (please complete the following information):


https://github.com/quarkusio/quarkus/issues/14715


$upstream:14715$