CLONE - No Dialect mapping for JDBC type: 1188753216 in Wildfly (AttributeConverter and Byte)

Description

I use AttributeConverter(

) to convert enum value(

). It run perfect normal when use "Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME)"(

) to initialize the JPA runtime. But when I deploy it into WildFly as a EJB(

), the JPA runtime initialization failed with the following exception:

Caused by: javax.persistence.PersistenceException: [PersistenceUnit: SensorNetwork] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:953)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:883)
at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167)
... 7 more
Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 1899073220
at org.hibernate.dialect.TypeNames.get(TypeNames.java:70)
at org.hibernate.dialect.TypeNames.get(TypeNames.java:101)
at org.hibernate.dialect.Dialect.getTypeName(Dialect.java:342)
at org.hibernate.spatial.dialect.mysql.MySQL56SpatialDialect.getTypeName(MySQL56SpatialDialect.java:75)
at org.hibernate.mapping.Column.getSqlType(Column.java:231)
at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateColumnType(AbstractSchemaValidator.java:156)
at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:143)
at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:42)
at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:89)
at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:68)
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:184)
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:65)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:476)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:422)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:880)

In the Full log of Wildfly:

, i notice the following infomation:

2017-11-22 15:02:25,396 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] (ServerService Thread Pool – 13) Starting fillSimpleValue for connectionState
2017-11-22 15:02:25,396 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] (ServerService Thread Pool – 13) Applying JPA AttributeConverter [org.hibernate.boot.internal.AttributeConverterDescriptorImpl@1e0c7d11] to [com.tekview.transview.sensornetwork.model.Lamppost:connectionState]
2017-11-22 15:02:25,396 DEBUG [org.hibernate.type.descriptor.sql.JdbcTypeJavaClassMappings] (ServerService Thread Pool – 13) JDBC type code mapping not known for class [java.lang.Short]; using custom code [1899073220]
2017-11-22 15:02:25,396 DEBUG [org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter] (ServerService Thread Pool – 13) Created AttributeConverterTypeAdapter -> converted::com.tekview.transview.sensornetwork.persist.converter.ConnectionStateConverter

When I refactor my code ConnectionStateConverter with the new one:
public class ConnectionStateConverter implements AttributeConverter<ConnectionState, Integer>, everything goes ok.

Why?

Attachments

6
  • 21 Mar 2019, 09:16 AM
  • 21 Mar 2019, 09:16 AM
  • 21 Mar 2019, 09:16 AM
  • 21 Mar 2019, 09:16 AM
  • 21 Mar 2019, 09:16 AM
  • 21 Mar 2019, 09:16 AM

Activity

Show:

Gavin King November 22, 2024 at 8:39 PM

Seems to have been fixed.

Gregoire Job March 21, 2019 at 9:19 AM

I clone the ticket https://hibernate.atlassian.net/browse/HHH-12115#icft=HHH-12115 because when we use a AttributeConverter where database type is a Byte we have exactly the same problem.
Please, could you add Byte class as a possible type.

Regards

Out of Date

Details

Assignee

Reporter

Worked in

Affects versions

Priority

Created March 21, 2019 at 9:16 AM
Updated December 3, 2024 at 9:20 AM
Resolved November 22, 2024 at 8:39 PM