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

Bean discovery in modularized application #11552

Open
karbi opened this issue Jan 29, 2025 · 2 comments
Open

Bean discovery in modularized application #11552

karbi opened this issue Jan 29, 2025 · 2 comments
Assignees
Labels
status: awaiting validation Waiting to be validated as a real issue status: example attached

Comments

@karbi
Copy link

karbi commented Jan 29, 2025

Expected Behavior

Annotated beans should be discovered in modularized project, if module exports packages to io.micronaut.core.

I know that micronaut could have some issued with JPMS (as mentioned in #6395) but we was able to use it without issues as dependency injection framework for Vertx based application using version 3.x.

Actual Behaviour

Beans are not discovered despite been visible by io.micronaut.core module.

This feature worked correctly in micronaut 3.x.

There were some performance improvements for micronaut 4.0.x in commit #8586 that uses MethodLookup for class loading. Unfortunately MethodLookup.publicLookup() was used that requires package to be accessible from unnamed module.

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

4.x

@graemerocher
Copy link
Contributor

perhaps if you attach an example we can have a look

@karbi
Copy link
Author

karbi commented Jan 29, 2025

I had modified example micronaut application - https://github.com/karbi/micronaut-example
Please see module-info.java.
Exporting example.micronaut to io.micronaut.context doesn't work as HelloController cannot be found.
If it's exported without restriction - HelloController is discovered.

@graemerocher graemerocher added status: example attached status: awaiting validation Waiting to be validated as a real issue labels Jan 29, 2025
@graemerocher graemerocher self-assigned this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting validation Waiting to be validated as a real issue status: example attached
Projects
None yet
Development

No branches or pull requests

2 participants