TheRunning two WildFly tests under Java Security Manager with Hibernate ORM 6.1.3 shows failure:
{{Caused by: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.lang.RuntimePermission" "accessDeclaredMembers")" in code source "(vfs:/content/jpa_entitytest.jar <no signer certificates>)" of "ModuleClassLoader }} {{for Module "deployment.jpa_entitytest.jar" from Service Module Loader") }} {{ at org.wildfly.security.elytron-base@2.0.0.Beta3//org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:309) }} {{ at org.wildfly.security.elytron-base@2.0.0.Beta3//org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:201) }} {{ at java.base/java.lang.Class.checkMemberAccess(Class.java:2847) }} {{ at java.base/java.lang.Class.getDeclaredMethod(Class.java:2471) }} {{ at deployment.jpa_entitytest.jar//org.jboss.as.test.integration.jpa.hibernate.entity.Flight$HibernateProxy$nGaCISjH.<clinit>(Unknown Source)}}
To see [Flight|https://github.com/wildfly/wildfly/blob/9146d41a6f0d35a827e9699885ea0e7604bc1c45/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/entity/Flight.atlassianjava] class constructor as generated bytecode, see [https://gist.netgithub.com/browsescottmarlow/HHH2c602fcfa8512b904c4c0776a88b8152#file-15371gistfile1-txt-L513|https://hibernategist.atlassiangithub.netcom/browsescottmarlow/HHH2c602fcfa8512b904c4c0776a88b8152#file-15371gistfile1-txt-L513|smart-link] change addressed Hibernate ORM Envers test failures when run under a Java Security Manager but two of the tests not addressed by that change can be seen when running with Hibernate ORM 6 (loaded entity proxy class was saved to disk via [https://github.1com/hibernate/hibernate-orm/pull/5308|https://github.3com/hibernate/hibernate-orm/pull/5308|smart-link])
To recreate with WildFly:
h1. Steps to use Scott's branch to reproduce wildfly test failure
git clone [https://github.com/scottmarlow/wildfly|https://github.com/scottmarlow/wildfly|smart-link] cd wildfly git checkout WFLY-16713_Hibernate_ORM6.1.3 ./build.sh clean install -DskipTests=true pushd wildfly/testsuite/integration/basic mvn clean test -Dtest=SessionFactoryTestCase -Dsecurity.manager mvn clean test -Dtest=EntityTestCase -Dsecurity.manager popd
h1. Recreate the failure with a debugger
pushd dist/target/wildfly-27.0.0.Beta1-SNAPSHOT/bin vim standalone.conf find line with #JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n" save your changes to standalone.conf ./standalone.sh -secmgr & popd pushd wildfly/testsuite/integration/basic mvn clean test -Dtest=EntityTestCase -Dsecurity.manager popd |
|