Hibernate Types not working anymore with Version 2.2.0 Final
See original GitHub issueDescribe the bug
I am using Vlad Mihalceas Hibernate Types library to utilize the json capabilities of SQLServer. I have created a small example with which you can reproduce the issue.
My setup works fine with 2.1.4 and below version of Quarkus. As soon as I upgrade to Quarkus 2.2.x I encounter the following error during startup:
2021-11-01 13:48:59,865 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.lang.NullPointerException
at java.base/java.util.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1111)
at java.base/java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1102)
at io.quarkus.hibernate.orm.runtime.schema.SchemaManagementIntegrator.disintegrate(SchemaManagementIntegrator.java:50)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:410)
at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:71)
at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:67)
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:149)
at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:58)
at java.base/java.lang.Thread.run(Thread.java:829)
Upgrading to Version 2.3.1 and higher results in the following error:
2021-11-01 13:52:39,136 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
at org.hibernate.dialect.TypeNames.get(TypeNames.java:71)
at org.hibernate.dialect.TypeNames.get(TypeNames.java:103)
at org.hibernate.dialect.Dialect.getTypeName(Dialect.java:404)
at org.hibernate.mapping.Column.getSqlType(Column.java:238)
at org.hibernate.tool.schema.internal.StandardTableExporter.getSqlCreateStrings(StandardTableExporter.java:96)
at org.hibernate.tool.schema.internal.StandardTableExporter.getSqlCreateStrings(StandardTableExporter.java:30)
at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:316)
at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:167)
at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:136)
at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:122)
at org.hibernate.tool.hbm2ddl.SchemaExport.doExecution(SchemaExport.java:314)
at io.quarkus.hibernate.orm.runtime.devconsole.HibernateOrmDevConsoleInfoSupplier.generateDDL(HibernateOrmDevConsoleInfoSupplier.java:77)
at io.quarkus.hibernate.orm.runtime.devconsole.HibernateOrmDevConsoleInfoSupplier.pushPersistenceUnit(HibernateOrmDevConsoleInfoSupplier.java:35)
at io.quarkus.hibernate.orm.runtime.devconsole.HibernateOrmDevConsoleIntegrator.integrate(HibernateOrmDevConsoleIntegrator.java:15)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:292)
at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:74)
at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:67)
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:149)
at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:58)
at java.base/java.lang.Thread.run(Thread.java:829)
2021-11-01 13:52:39,138 INFO [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
Press [space] to restart, [e] to edit command line args (currently ''), [r] to resume testing, [o] Toggle test output, [h] for more options>
I have posted this on stack overflow as well: Article
I have created the custom dialect as per this article: HibernateJsonMapping
But this does not seem to work. I created a small project with which you can reproduce the issue: Reproduce me
If you change the version in the pom file to 2.1.4 you will see that the project starts and also loads the hibernate types propertly. As soon as you change the version to one of the problematic ones one or the other exception is raised.
Thanks already for your help!
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of uname -a
or ver
Microsoft Windows [Version 10.0.19043.1288]
Output of java -version
openjdk version “11.0.12” 2021-07-20
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.8.3
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Well, good news: #21122 actually fixes the problem completely in your reproducer. The stack trace with the
ConcurrentHashMap
doesn’t appear anymoreWill close as soon as #21122 gets merged.