I am writing an application to persist an object to an h2 database for testing. Everything was fine until I got to the section where I needed to convert Joda LocalDate to Java.util.date and attempt to persist to h2. It literally kicks out at return date, in the converter. I isolated this error, and created a small side project as an example of what is occurring, and uploaded to github. Can anyone help me solve this, or confirm it is a Hibernate Bug?
Example Project: https://github.com/CPriester/HibernateException
Joda Converters: https://github.com/CPriester/joda-jpa-converters
Snippet of Stacktrace:
Code:
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: javax.persistence.PersistenceException: org.hibernate.HibernateException: Unknown unwrap conversion requested: java.util.Date to [B
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1761)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1675)
at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:82)
... 30 more
Caused by: org.hibernate.HibernateException: Unknown unwrap conversion requested: java.util.Date to [B
at org.hibernate.type.descriptor.java.AbstractTypeDescriptor.unknownUnwrap(AbstractTypeDescriptor.java:103)
at org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor.unwrap(JdbcTimestampTypeDescriptor.java:152)
at org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor.unwrap(JdbcTimestampTypeDescriptor.java:41)
at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$1.doBind(VarbinaryTypeDescriptor.java:62)
at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:93)
at org.hibernate.type.descriptor.converter.AttributeConverterSqlTypeDescriptorAdapter$1.doBind(AttributeConverterSqlTypeDescriptorAdapter.java:101)
at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:93)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:281)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:276)
Many thanks,
Courtney