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?

Environment

java.version: 1.8.0_73
java.vm.vendor: Oracle Corporation
java.vm.version: 25.73-b02
os.name: Windows 8
os.version: 6.2
wildfly.version: 11.0.0.Final
hibernate.version: 5.1.10.Final
mysql.version: 5.6.25-log
mysql.connector.java.version 5.1.44

Status

Assignee

Unassigned

Reporter

Gregoire Job

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.1.10
5.2.12

Affects versions

Priority

Major
Configure