You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/27 07:56:02 UTC

[GitHub] [camel-quarkus] JiriOndrusek opened a new issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

JiriOndrusek opened a new issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519


   Some extension are leveraging extensions, which contains producers for some beans. E.g. `google-storage` (possibly `minio`)
   Google-storage extension contains `StorageProducer`, which creates `Storage`. Camel component autowires `Storage` into its configuration. 
   If user tries to leverage this producer with a route using it. It doesn't work and following warning is shown:
   
   ```
   ================================================================================
   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:
           - PRODUCER_METHOD bean io.quarkiverse.googlecloudservices.storage.runtime.StorageProducer#storage() [types=[com.google.cloud.Service<com.google.cloud.storage.StorageOptions>, interface com.google.cloud.storage.Storage], qualifiers=[@javax.enterprise.inject.Default()]]                                                                                                                                                                                                        
   Required type: interface com.google.cloud.storage.Storage
   Required qualifiers: []
   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
   ================================================================================
   ```
   
   Problem is caused by the fact, that quartkus does not know about autowired bean and therefore marks producer as unused and removes it.
   
   If I inject bean into my code,  quarkus reconizes it, bean is created and autowired into component.
   
   ```
   @Inject
       Storage storage;
   ```
   
   It would be nice if autowired beans from camel compoinents are recognized by quarkus. This would make configuration of some clients/components much easier for users.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek edited a comment on issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

Posted by GitBox <gi...@apache.org>.
JiriOndrusek edited a comment on issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519#issuecomment-827402924


   Yes that should work (make bean unremovable), I'll report if for quarkiverse.google-storage
   Just thinking whether it would be possible to "say to quarkus" that some beans are used, therefore there is no need to remove them as unused.
   
   I didn't find https://github.com/apache/camel-quarkus/issues/1387, which makes this issue duplicate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519#issuecomment-874619564


   Duplicate of #1387.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519#issuecomment-827401300


   Related https://github.com/apache/camel-quarkus/issues/1387. We can probably make the bean unremovable in our own extension or ask the quarkiverse project to do it for us.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton closed issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

Posted by GitBox <gi...@apache.org>.
jamesnetherton closed issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519#issuecomment-827402924


   Yes that should work (make bean unremovable), I'll report if for quarkiverse.google-storage
   Just thinking whether it would be possible to "say to quarkus" that some beans are used, therefore there is no need to remove them as unused.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519#issuecomment-874619564


   Duplicate of #1387.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton closed issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

Posted by GitBox <gi...@apache.org>.
jamesnetherton closed issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek edited a comment on issue #2519: Autowiring of beans can cause warning and problem "bean was marked as unused and removed during build"

Posted by GitBox <gi...@apache.org>.
JiriOndrusek edited a comment on issue #2519:
URL: https://github.com/apache/camel-quarkus/issues/2519#issuecomment-827402924


   Yes that should work (make bean unremovable), **EDIT** I'll make bean unremovable in our extension
   Just thinking whether it would be possible to "say to quarkus" that some beans are used, therefore there is no need to remove them as unused.
   
   I didn't find https://github.com/apache/camel-quarkus/issues/1387, which makes this issue duplicate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org