Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Officially support @Startup annotation on CDI beans created through method instead of class #43523

Closed
davidreis97 opened this issue Sep 26, 2024 · 3 comments
Labels
area/arc Issue related to ARC (dependency injection) kind/enhancement New feature or request

Comments

@davidreis97
Copy link

davidreis97 commented Sep 26, 2024

Description

I'm using the following code to create a bean:

@ApplicationScoped
@MyBananaMap
public RMapCache<String, MyBanana> myBananaCache() {
   ...
}

I would like to make this bean be initialized at startup, and after adding the @Startup annotation the method is indeed called at startup as it should, but I still get the following warning:

Ignored an invalid @Startup method declared on <CacheCreationClass>: <CacheCreationClass>.myBananaCache()

If we could move to officially support this usage of the @Startup method without throwing a warning, it would be very useful to us. Willing to contribute if you consider this idea feasible. Thanks!

Implementation ideas

No response

@davidreis97 davidreis97 added the kind/enhancement New feature or request label Sep 26, 2024
@mkouba
Copy link
Contributor

mkouba commented Sep 27, 2024

Thanks for reporting. What version of Quarkus do you use and where comes the warning from (a loggger name would be helpful)?

If we could move to officially support this usage of the @startup method without throwing a warning, it would be very useful to us.

It is officialy supported. This is very likely just an oversight.

Willing to contribute if you consider this idea feasible. Thanks!

💯

@mkouba
Copy link
Contributor

mkouba commented Sep 27, 2024

@davidreis97 I think that the problem should be fixed in #40096 that targets Quarkus 3.9.4.

@mkouba mkouba added the area/arc Issue related to ARC (dependency injection) label Sep 27, 2024
@davidreis97
Copy link
Author

@mkouba Upgrading to the latest version does solve the issue, @Startup works as expected without warning 🙈 My bad, I'll remember to check the Quarkus version the next time and include it in the issue. Thanks for the quick feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants