-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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-reactive NullpointException in case Quarkus log in set to debug #16712
Comments
/cc @DavideD, @Sanne, @gavinking |
Which version of quarkus are you using? |
It seems the issue is related to a |
Maybe when you set the log to debug level, you are trying to print an association that's not initialized yet? For example:
Where You can find more details about this in the Hibernate Reactive documentation: 1.2.11. Fetching lazy associations |
Anyway, I need more information about this to be able to help you. |
Mmmh... maybe not... it seems that the issue happens when the persister is created |
Never mind, I think I've found the problem: https://github.com/hibernate/hibernate-reactive/blob/main/hibernate-reactive-core/src/main/java/org/hibernate/reactive/persister/collection/impl/ReactiveOneToManyPersister.java#L52 The log is called in the superclass before the variable I will create an issue on Hibernate Reactive for this. |
I've created this issue in Hibernate Reactive: hibernate/hibernate-reactive#726 |
used 1.13.1 |
The entity I created is as follows
|
Thank you @KIMHYEONGJUN! I've already found the problem and I'm now thinking about how to solve it. |
Describe the bug
hibernate-reactive NullpointException
When I set the log level to debug and run it, a nullpointexception occurs and the application does not work properly.
Configuration
Screenshots
16:35:55 ERROR [io.qu.ru.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.lang.NullPointerException
at org.hibernate.reactive.persister.collection.impl.ReactiveOneToManyPersister.getSQLInsertRowString(ReactiveOneToManyPersister.java:144)
at org.hibernate.persister.collection.AbstractCollectionPersister.logStaticSQL(AbstractCollectionPersister.java:693)
at org.hibernate.persister.collection.AbstractCollectionPersister.(AbstractCollectionPersister.java:529)
at org.hibernate.persister.collection.OneToManyPersister.(OneToManyPersister.java:69)
at org.hibernate.reactive.persister.collection.impl.ReactiveOneToManyPersister.(ReactiveOneToManyPersister.java:52)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.hibernate.persister.internal.PersisterFactoryImpl.createCollectionPersister(PersisterFactoryImpl.java:152)
at org.hibernate.persister.internal.PersisterFactoryImpl.createCollectionPersister(PersisterFactoryImpl.java:140)
at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:225)
at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:303)
at org.hibernate.reactive.session.impl.ReactiveSessionFactoryImpl.(ReactiveSessionFactoryImpl.java:33)
at io.quarkus.hibernate.reactive.runtime.boot.FastBootReactiveEntityManagerFactoryBuilder.build(FastBootReactiveEntityManagerFactoryBuilder.java:34)
at io.quarkus.hibernate.reactive.runtime.FastBootHibernateReactivePersistenceProvider.createEntityManagerFactory(FastBootHibernateReactivePersistenceProvider.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:118)
at io.quarkus.hibernate.orm.runtime.JPAConfig.startAll(JPAConfig.java:42)
at io.quarkus.hibernate.orm.runtime.JPAConfig_Subclass.startAll$$superaccessor4(JPAConfig_Subclass.zig:650)
at io.quarkus.hibernate.orm.runtime.JPAConfig_Subclass$$function$$4.apply(JPAConfig_Subclass$$function$$4.zig:29)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
at io.quarkus.hibernate.orm.runtime.JPAConfig_Subclass.startAll(JPAConfig_Subclass.zig:608)
at io.quarkus.hibernate.orm.runtime.HibernateOrmRecorder.startAllPersistenceUnits(HibernateOrmRecorder.java:88)
at io.quarkus.deployment.steps.HibernateOrmProcessor$startPersistenceUnits951856026.deploy_0(HibernateOrmProcessor$startPersistenceUnits951856026.zig:74)
at io.quarkus.deployment.steps.HibernateOrmProcessor$startPersistenceUnits951856026.deploy(HibernateOrmProcessor$startPersistenceUnits951856026.zig:40)
at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:762)
at io.quarkus.runtime.Application.start(Application.java:90)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:100)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.quarkus.runner.bootstrap.StartupActionImpl$3.run(StartupActionImpl.java:134)
at java.base/java.lang.Thread.run(Thread.java:836)
Output of
java -version
jdk 11
Quarkus version or git rev
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3
The text was updated successfully, but these errors were encountered: