Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1271799 - [GSS] (6.4.z) HHH-5255, HHH-7573 - ClassCastException on lazy properties when merging or flushing with PreUpdate callback
Summary: [GSS] (6.4.z) HHH-5255, HHH-7573 - ClassCastException on lazy properties when...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Hibernate
Version: 6.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: EAP 6.4.5
Assignee: Gail Badner
QA Contact: hsvabek
URL:
Whiteboard:
Depends On:
Blocks: 1235745 1259122
TreeView+ depends on / blocked
 
Reported: 2015-10-14 18:37 UTC by Stephen Fikes
Modified: 2019-09-12 09:06 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Attempts to merge (into an empty session) an entity with a lazily fetched @Lob property fail with "java.lang.ClassCastException: org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer$1 cannot be cast to [B"
Clone Of:
: 1273573 (view as bug list)
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description Stephen Fikes 2015-10-14 18:37:54 UTC
Description of problem:
java.lang.ClassCastException: org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer$1 cannot be cast to [B
	at org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor.areEqual(PrimitiveByteArrayTypeDescriptor.java:42)
	at org.hibernate.type.AbstractStandardBasicType.isEqual(AbstractStandardBasicType.java:209)
	at org.hibernate.type.AbstractStandardBasicType.getReplacement(AbstractStandardBasicType.java:102)
	at org.hibernate.type.AbstractStandardBasicType.replace(AbstractStandardBasicType.java:353)
	at org.hibernate.type.TypeHelper.replace(TypeHelper.java:177)
	at org.hibernate.event.internal.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:401)
	at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:338)
	at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:180)
	at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:86)
	at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:833)
	at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:817)
	at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:821)
	at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:889)
	at org.jboss.as.jpa.container.AbstractEntityManager.merge(AbstractEntityManager.java:548)


Version-Release number of selected component (if applicable):


How reproducible:
Consistently

Steps to Reproduce:
1. Load an entity that has
    @Lob
    @Column....
    @Basic(fetch = FetchType.LAZY)
2. Clear the session cache
3. Merge the entity

Actual results:
java.lang.ClassCastException: org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer$1 cannot be cast to [B

Expected results:
Merge should work

Additional info:
https://hibernate.atlassian.net/browse/HHH-5255

Comment 8 hsvabek 2015-11-06 11:01:00 UTC
Verified with EAP 6.4.5.CP.CR1.

Comment 9 Petr Penicka 2017-01-17 11:46:42 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 10 Petr Penicka 2017-01-17 11:46:43 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.


Note You need to log in before you can comment on or make changes to this bug.