Envers failure when run under SecurityManager
Description
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.
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: