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

Micronaut app not working with Java 9 modules #9281

Closed
anandjaisy opened this issue May 21, 2023 · 2 comments
Closed

Micronaut app not working with Java 9 modules #9281

anandjaisy opened this issue May 21, 2023 · 2 comments
Labels
closed: duplicate This issue or pull request already exists

Comments

@anandjaisy
Copy link

anandjaisy commented May 21, 2023

Expected Behavior

Just added the module-info.java file to the Micronaut application, created with the latest version, and getting an exception

The application should work with Java 9 module system.

Actual Behaviour

module-info.java

module api.main {
    requires io.micronaut.context;
    requires io.swagger.v3.oas.annotations;
    requires io.micronaut.http;
}
Exception in thread "main" io.micronaut.core.io.service.SoftServiceLoader$ServiceLoadingException: Failed to load a service: superclass access check failed: class fete.bird.$ApiController$Definition$Reference (in module api.main) cannot access class io.micronaut.context.AbstractInitializableBeanDefinitionReference (in unnamed module @0x4ab001b4) because module api.main does not read unnamed module @0x4ab001b4
	at io.micronaut.core.io.service.ServiceScanner$ServiceInstanceLoader.collect(ServiceScanner.java:302)
	at io.micronaut.core.io.service.ServiceScanner$MicronautMetaServicesLoader.collect(ServiceScanner.java:229)
	at io.micronaut.core.io.service.ServiceScanner$DefaultServiceCollector.collect(ServiceScanner.java:192)
	at io.micronaut.core.io.service.SoftServiceLoader.collectDynamicServices(SoftServiceLoader.java:198)
	at io.micronaut.core.io.service.SoftServiceLoader.collectAll(SoftServiceLoader.java:174)
	at io.micronaut.context.DefaultBeanContext.resolveBeanDefinitionReferences(DefaultBeanContext.java:1753)
	at io.micronaut.context.DefaultApplicationContext.isBootstrapPropertySourceLocatorPresent(DefaultApplicationContext.java:157)
	at io.micronaut.context.DefaultApplicationContext.isBootstrapEnabled(DefaultApplicationContext.java:153)
	at io.micronaut.context.DefaultApplicationContext.createEnvironment(DefaultApplicationContext.java:138)
	at io.micronaut.context.DefaultApplicationContext.getEnvironment(DefaultApplicationContext.java:185)
	at io.micronaut.context.DefaultApplicationContextBuilder.build(DefaultApplicationContextBuilder.java:309)
	at [email protected]/io.micronaut.runtime.Micronaut.start(Micronaut.java:71)
	at [email protected]/io.micronaut.runtime.Micronaut.run(Micronaut.java:323)
	at [email protected]/io.micronaut.runtime.Micronaut.run(Micronaut.java:309)
	at api.main/fete.bird.Application.main(Application.java:16)

Steps To Reproduce

  1. Create a brand new micronaut application using latest version.
  2. Add module-info.java file to the application
  3. Try to run the application and watch the error
  4. OR clone the sample application from the Git Repo and run the application

Environment Information

  • Mac OS
  • Open JDK 17 oracle

Example Application

https://github.com/anandjaisy/Micronaut-module

Version

5.9.2

@msgilligan
Copy link
Contributor

See #6395

@yawkat
Copy link
Member

yawkat commented Jul 17, 2023

Closing as duplicate.

@yawkat yawkat closed this as not planned Won't fix, can't repro, duplicate, stale Jul 17, 2023
@yawkat yawkat added the closed: duplicate This issue or pull request already exists label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants