ClassCastException for an audited ordered collection

Description

After updating Hibernate and Envers from version 4.3.11 to 5.3.6 the application fails to start due to a ClassCastException: org.hibernate.mapping.Bag cannot be cast to org.hibernate.mapping.IndexedCollection

After some debugging I found out that this happens on an entity with a @OneToMany collection which is ordered using @OrderBy.

Environment

None

Activity

Show:
Chris Cranford
October 4, 2018, 3:53 PM

, I've opened a PR with the changes I believe solve your issue. if you want, you're welcomed to build the PR with your code and see whether it works. The PR is based on master (5.4), so I'm not sure how that may impact compatibility with your existing code base.

Christian Plätzinger
October 6, 2018, 6:34 AM

Thanks @Chris Cranford, I'll give a try and let you know as soon as possible. It will probably take a week.

Christian Plätzinger
December 4, 2018, 4:28 AM

Any chance to get the fix for 5.3.x?

Guillaume Smet
December 4, 2018, 10:15 AM

we will only backport critical bugfixes to 5.3.

But... the good news is that 5.4 is really the direct continuation of 5.3 with only bugfixes (except if you use EntityGraphs where there are a few improvements) so upgrading to 5.4 should be easy.

I plan to release 5.4.0 next week, you can already check CR2 works for you.

Christian Plätzinger
December 4, 2018, 12:08 PM

Thanks, I'll try 5.4.x.

Assignee

Chris Cranford

Reporter

Christian Plätzinger

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.3.11
5.2.11

Components

Affects versions

Priority

Major
Configure