IllegalAccessException on Embeddable ID after serializing Getter in cache key

Description

In our production environment we periodically(and often) have some exceptions like:

stack example1

stack2

stack3

It happens only on distributed env with cluster-wide load. It happens not only private field/class keys, but on package-private class too. We use OldCacheKeyImplementation due to HHH-10287.

Now we fix`em through public modifiers addition, but it seems that this is bug in hibernate-core – earlier hibernate never paid attention on access modifiers of mapped field or class.

May be this bug not catched because OldCacheKeyImplementation used rarely.

We already jumped onto WF 10.1.0.Final/hibernate 5.0.10, but not yet on production. It seems that this not fixed on this environment too

Looks like fix is simple – add field.setAccessible call to GetterFieldImpl#get:

possible fix

but may be I don`t understand something? GetterMethodImpl#get have no setAccessible call, but it works (no any IllegalAccessException with GetterMethodImpl in stack). OldCacheKeyImplementation and infinispan in stack also confusing me.

Environment

wildfly 10.0.0.Final
hibernate 5.0.7.Final
infinispan 8.1.0.Final
OldCacheKeyImplementation used (see HHH-10287)
@Embeddable component key used
distributed entity cache: invalidation-cache
distributed timestamps cache: replicated-cache

Status

Assignee

Gail Badner

Reporter

kostd

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure