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

Hibernate ORM and Search extensions now requires dev build profile #32004

Closed
michalvavrik opened this issue Mar 21, 2023 · 1 comment · Fixed by #32005
Closed

Hibernate ORM and Search extensions now requires dev build profile #32004

michalvavrik opened this issue Mar 21, 2023 · 1 comment · Fixed by #32005
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working
Milestone

Comments

@michalvavrik
Copy link
Member

michalvavrik commented Mar 21, 2023

Describe the bug

I realize that opinions whether this is bug may differs heavily, but I want to create this issue (and PR that proposes fix) as it seems unnecessary. Our CI is failing because of this quarkus-qe/quarkus-test-suite#1124.

#31946 introduced @IfBuildProfile("dev") for HibernateOrmDevJsonRpcService and HibernateSearchElasticsearchDevJsonRpcService. That means that in terms of Hibernate ORM extension, DEV profile is same now as DEV launch mode. Previously it wasn't true.

We curate Quarkus application and launch it in DEV mode without setting "dev" profile.

Expected behavior

There is easy fix possible on both Quarkus side or our side, however I would prefer if Hibernate ORM worked in DEV mode as previously.

Actual behavior

DEV beans are missing

13:23:32,122 INFO  [app] 13:23:30,708 An error occurred during delivery of the @BeforeDestroyed(ApplicationScoped.class) event: jakarta.enterprise.inject.CreationException: Error creating synthetic bean [21527bfe81c05a31d9c61be490c9ebc04e8ab2d8]: jakarta.enterprise.inject.CreationException: Config root [io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfig] with config phase [RUN_TIME] not initialized yet.
13:23:32,122 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfig_21527bfe81c05a31d9c61be490c9ebc04e8ab2d8_Synthetic_Bean.doCreate(Unknown Source)
13:23:32,122 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfig_21527bfe81c05a31d9c61be490c9ebc04e8ab2d8_Synthetic_Bean.create(Unknown Source)
13:23:32,122 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfig_21527bfe81c05a31d9c61be490c9ebc04e8ab2d8_Synthetic_Bean.get(Unknown Source)
13:23:32,122 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfig_21527bfe81c05a31d9c61be490c9ebc04e8ab2d8_Synthetic_Bean.get(Unknown Source)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.CurrentInjectionPointProvider.get(CurrentInjectionPointProvider.java:48)
13:23:32,122 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.JPAConfig_Bean.doCreate(Unknown Source)
13:23:32,122 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.JPAConfig_Bean.create(Unknown Source)
13:23:32,122 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.JPAConfig_Bean.create(Unknown Source)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:113)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:37)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:34)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:34)
13:23:32,122 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.JPAConfig_Observer_destroy_03fb872ecc5e4ea32f039e25a79f3b66499ca7ea.notify(Unknown Source)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:344)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:332)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:262)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.impl.ArcContainerImpl.shutdown(ArcContainerImpl.java:389)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.Arc.shutdown(Arc.java:58)
13:23:32,122 INFO  [app] 	at io.quarkus.arc.runtime.ArcRecorder$1.run(ArcRecorder.java:49)
13:23:32,122 INFO  [app] 	at io.quarkus.runtime.StartupContext.runAllInReverseOrder(StartupContext.java:84)
13:23:32,122 INFO  [app] 	at io.quarkus.runtime.StartupContext.close(StartupContext.java:73)
13:23:32,122 INFO  [app] 	at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
13:23:32,122 INFO  [app] 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
13:23:32,123 INFO  [app] 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
13:23:32,123 INFO  [app] 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
13:23:32,123 INFO  [app] 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
13:23:32,123 INFO  [app] 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
13:23:32,123 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
13:23:32,123 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
13:23:32,123 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
13:23:32,123 INFO  [app] 	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
13:23:32,123 INFO  [app] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:23:32,123 INFO  [app] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
13:23:32,123 INFO  [app] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:23:32,123 INFO  [app] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
13:23:32,123 INFO  [app] 	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:104)
13:23:32,123 INFO  [app] 	at java.base/java.lang.Thread.run(Thread.java:833)
13:23:32,123 INFO  [app] Caused by: jakarta.enterprise.inject.CreationException: Config root [io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfig] with config phase [RUN_TIME] not initialized yet.
13:23:32,123 INFO  [app] 	at io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfig_21527bfe81c05a31d9c61be490c9ebc04e8ab2d8_Synthetic_Bean.createSynthetic(Unknown Source)
13:23:32,123 INFO  [app] 	... 39 more
13:23:32,123 INFO  [app] 13:23:30,709 HHH10005004: Stopping BeanContainer : io.quarkus.hibernate.orm.runtime.cdi.QuarkusArcBeanContainer@3672276e
13:23:32,123 INFO  [app] 13:23:30,709 ArC DI container shut down
13:23:32,123 INFO  [app] 13:23:30,710 Error running Quarkus: java.lang.reflect.InvocationTargetException
13:23:32,123 INFO  [app] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:23:32,123 INFO  [app] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
13:23:32,123 INFO  [app] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:23:32,123 INFO  [app] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
13:23:32,123 INFO  [app] 	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:104)
13:23:32,124 INFO  [app] 	at java.base/java.lang.Thread.run(Thread.java:833)
13:23:32,124 INFO  [app] Caused by: java.lang.ExceptionInInitializerError
13:23:32,124 INFO  [app] 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
13:23:32,124 INFO  [app] 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
13:23:32,124 INFO  [app] 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
13:23:32,124 INFO  [app] 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
13:23:32,124 INFO  [app] 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
13:23:32,124 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
13:23:32,124 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
13:23:32,124 INFO  [app] 	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
13:23:32,124 INFO  [app] 	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
13:23:32,124 INFO  [app] 	... 6 more
13:23:32,124 INFO  [app] Caused by: java.lang.RuntimeException: Failed to start quarkus
13:23:32,124 INFO  [app] 	at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
13:23:32,124 INFO  [app] 	... 15 more
13:23:32,124 INFO  [app] Caused by: jakarta.enterprise.inject.UnsatisfiedResolutionException: No bean found for required type [class io.quarkus.hibernate.orm.runtime.dev.HibernateOrmDevJsonRpcService] and qualifiers [[]]
13:23:32,124 INFO  [app] 	at io.quarkus.arc.impl.InstanceImpl.bean(InstanceImpl.java:286)
13:23:32,124 INFO  [app] 	at io.quarkus.arc.impl.InstanceImpl.getInternal(InstanceImpl.java:307)
13:23:32,124 INFO  [app] 	at io.quarkus.arc.impl.InstanceImpl.get(InstanceImpl.java:188)
13:23:32,124 INFO  [app] 	at io.quarkus.devui.runtime.comms.JsonRpcRouter.populateJsonRPCMethods(JsonRpcRouter.java:59)
13:23:32,124 INFO  [app] 	at io.quarkus.devui.runtime.comms.JsonRpcRouter_ClientProxy.populateJsonRPCMethods(Unknown Source)
13:23:32,124 INFO  [app] 	at io.quarkus.devui.runtime.DevUIRecorder.createJsonRpcRouter(DevUIRecorder.java:39)
13:23:32,125 INFO  [app] 	at io.quarkus.deployment.steps.DevUIProcessor$createJsonRpcRouter558265827.deploy_0(Unknown Source)
13:23:32,125 INFO  [app] 	at io.quarkus.deployment.steps.DevUIProcessor$createJsonRpcRouter558265827.deploy(Unknown Source)
13:23:32,125 INFO  [app] 	... 16 more

How to Reproduce?

Steps to reproduce:

  1. quarkus create app hibernate-reproducer -x hibernate-orm,resteasy-reactive,jdbc-postgresql --stream=3.0
  2. cd hibernate-reproducer/
  3. mvn quarkus:dev -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.platform.group-id=io.quarkus -Dquarkus.profile=stuff

I realize I can do -Dquarkus.profile=stuff,dev and it will work.

Output of uname -a or ver

Linux

Output of java -version

openjdk 17.0.4 2022-07-19

GraalVM version (if different from Java)

OpenJDK Runtime Environment GraalVM CE 23.2

Quarkus version or git rev

999-SNAPSHOT

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

No response

@michalvavrik michalvavrik added the kind/bug Something isn't working label Mar 21, 2023
@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE labels Mar 21, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 21, 2023

/cc @Sanne (hibernate-orm), @gsmet (hibernate-orm), @yrodiere (hibernate-orm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant