question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hibernate Types not working anymore with Version 2.2.0 Final

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yrodierecommented, Nov 2, 2021

Well, good news: #21122 actually fixes the problem completely in your reproducer. The stack trace with the ConcurrentHashMap doesn’t appear anymore

Will close as soon as #21122 gets merged.

0reactions
guoxunbocommented, Nov 6, 2022
org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
Read more comments on GitHub >

github_iconTop Results From Across the Web

java - How do I cure the cause of Hibernate exception ...
It turns out that this exception is due to a bug in Hibernate. One of my teammates found a related bug report, Re-assembling...
Read more >
Hibernate Types 52 - com.vladmihalcea - Maven Repository
Hibernate Types 52. Hibernate ORM 5.2, 5.3, and 5.4 extra Types ... Version, Vulnerabilities, Repository, Usages, Date ...
Read more >
Spring Boot, Maven and Eclipse Errors and TroubleShooting ...
Hal Browser and Spring Boot Actuator are not working! Configure 2.3.1. ... RELEASE and change Hibernate version 5.0.4.Final to 5.0.2.Final.
Read more >
About MariaDB Connector/J
MariaDB Connector/J is a Type 4 JDBC driver. ... since MariaDB Connector/J 1.2.0 and not supported anymore since 3.0 version ... Default: false....
Read more >
[HHH-13866] OneToOne-association produces error on 5.4.0+ ...
Final ] at org.hibernate.type.OneToOneType. ... RELEASE.jar:2.2.0. ... If I use a H2 database the error does not occur. Configuration:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found