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

Issue when enabling eager initialization and using hibernate-reactive #3134

Open
lengors opened this issue Sep 18, 2024 · 0 comments
Open

Issue when enabling eager initialization and using hibernate-reactive #3134

lengors opened this issue Sep 18, 2024 · 0 comments

Comments

@lengors
Copy link

lengors commented Sep 18, 2024

Expected Behavior

The application should boot successfully (just like when it has eager initialization of singletons disabled).

Actual Behaviour

When the eager initialization of singletons is enabled, the following error can be seen:

15:19:48.141 [main] ERROR io.micronaut.runtime.Micronaut - Error starting Micronaut server: Bean definition [io.micronaut.reactor.http.client.sse.ReactorSseClientFactory] could not be loaded: Failed to initialize the bean [class io.micronaut.reactor.http.client.sse.ReactorSseClientFactory]: io/micronaut/http/client/sse/SseClientRegistry
io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [io.micronaut.reactor.http.client.sse.ReactorSseClientFactory] could not be loaded: Failed to initialize the bean [class io.micronaut.reactor.http.client.sse.ReactorSseClientFactory]: io/micronaut/http/client/sse/SseClientRegistry
        at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1983)
        at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:307)
        at io.micronaut.context.DefaultBeanContext.configureAndStartContext(DefaultBeanContext.java:3314)
        at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:345)
        at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:215)
        at io.micronaut.runtime.Micronaut.start(Micronaut.java:75)
        at io.github.lengors.Application.main(Application.java:12)
Caused by: io.micronaut.context.exceptions.BeanInstantiationException: Failed to initialize the bean [class io.micronaut.reactor.http.client.sse.ReactorSseClientFactory]: io/micronaut/http/client/sse/SseClientRegistry
        at io.micronaut.context.AbstractInitializableBeanDefinitionAndReference.load(AbstractInitializableBeanDefinitionAndReference.java:131)
        at io.micronaut.context.DefaultBeanContext.loadEagerBeans(DefaultBeanContext.java:2669)
        at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1981)
        ... 6 common frames omitted
Caused by: java.lang.NoClassDefFoundError: io/micronaut/http/client/sse/SseClientRegistry
        at io.micronaut.reactor.http.client.sse.$ReactorSseClientFactory$Definition.<clinit>(Unknown Source)
        at java.base/jdk.internal.misc.Unsafe.allocateInstance(Native Method)
        at java.base/java.lang.invoke.DirectMethodHandle.allocateInstance(DirectMethodHandle.java:501)
        at io.micronaut.core.io.service.SoftServiceLoader.lambda$collectDynamicServices$2(SoftServiceLoader.java:189)
        at io.micronaut.core.io.service.ServiceScanner$ServiceInstanceLoader.compute(ServiceScanner.java:402)
        at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
Caused by: java.lang.ClassNotFoundException: io.micronaut.http.client.sse.SseClientRegistry
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        ... 11 common frames omitted

Steps To Reproduce

Simply clone the linked example and run:

./mvnw clean mn:run

Environment Information

  • Operating System: Windows 11
  • JDK: 21

Example Application

https://github.com/lengors/micronaut-hibernate-reactive-bug-demo

Version

4.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant