Envers failure when run under SecurityManager

Description

Running one of the (WildFly) Envers unit tests with WildFly running under a security manager with Hibernate ORM 6.0.2.Final gets test failures:

 

The above link shows the entire Exception stacktrace. To workaround the failure, I tried updating the test to disable bytecode enhancement via the following persistence unit settings but none of them seemed to disable bytecode enhancement:

Activity

Show:

James Perkins June 28, 2022 at 6:34 PM

It looks like the issue is that in 5.3 the org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyFactory used final HibernateProxy proxy = (HibernateProxy) proxyClass.newInstance(); and in 6.0 it was switched to final HibernateProxy proxy = (HibernateProxy) proxyClass.getConstructor().newInstance();. This makes sense as Class.newInstance() is deprecated. My assumption is this should be done in a privileged action as not all proxies belong to the same or parent class loader in containers.

Fixed

Details

Assignee

Reporter

Worked in

Components

Fix versions

Affects versions

Priority

Created June 28, 2022 at 5:26 PM
Updated August 3, 2022 at 1:40 PM
Resolved July 21, 2022 at 8:55 AM