Hi,
is there anybody who can help on my SO question about Hibernate 4: http://stackoverflow.com/questions/20474302/migrate-abstractlobtype-to-hibernate-4-and-spring-3-2
I am trying to migrate from Hibernate 3 to 4. I am using InputStream in my entity class, but I am having trouble getting it working. It seems that in theory, it should be enough to use type="materialized_blob" and set the 'hibernate.jdbc.use_streams_for_binary=true' setting (I have set this in a hibernate.properties file on my classpath and I see ' HHH000407: Using java.io streams to persist binary types' in my logging).
What could be wrong that I get this exception:
Code:
[WARNING] [talledLocalContainer] java.lang.IllegalArgumentException: Can not set java.io.InputStream field com.traficon.domain.map.TrafficMapImage.m_image to [B
[WARNING] [talledLocalContainer] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
[WARNING] [talledLocalContainer] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
[WARNING] [talledLocalContainer] at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
[WARNING] [talledLocalContainer] at java.lang.reflect.Field.set(Field.java:741)
[WARNING] [talledLocalContainer] at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:139)
[WARNING] [talledLocalContainer] at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:710)
[WARNING] [talledLocalContainer] at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:379)
[WARNING] [talledLocalContainer] at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:4523)
[WARNING] [talledLocalContainer] at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:186)
[WARNING] [talledLocalContainer] at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:137)
[WARNING] [talledLocalContainer] at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1108)
[WARNING] [talledLocalContainer] at org.hibernate.loader.Loader.processResultSet(Loader.java:964)
[WARNING] [talledLocalContainer] at org.hibernate.loader.Loader.doQuery(Loader.java:911)
[WARNING] [talledLocalContainer] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
[WARNING] [talledLocalContainer] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:312)
[WARNING] [talledLocalContainer] at org.hibernate.loader.Loader.loadEntity(Loader.java:2121)
[WARNING] [talledLocalContainer] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82)
[WARNING] [talledLocalContainer] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72)
[WARNING] [talledLocalContainer] at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3941)
[WARNING] [talledLocalContainer] at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:460)
[WARNING] [talledLocalContainer] at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:429)
[WARNING] [talledLocalContainer] at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:206)
[WARNING] [talledLocalContainer] at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:246)
[WARNING] [talledLocalContainer] at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:150)
[WARNING] [talledLocalContainer] at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1098)
[WARNING] [talledLocalContainer] at org.hibernate.internal.SessionImpl.access$2000(SessionImpl.java:175)
[WARNING] [talledLocalContainer] at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2482)
[WARNING] [talledLocalContainer] at org.hibernate.internal.SessionImpl.get(SessionImpl.java:998)
Any input is highly appreciated!
regards,
Wim