-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
7.4.2.GA, 7.4.10.GA
-
None
-
False
-
None
-
False
-
-
-
-
-
-
Workaround Exists
-
-
-
-
Description
Annotating a Hibernate entity with @Proxy(proxyClass = javax.management.DynamicMBean.class) causes the following Hibernate error when the application is deployed:
16:09:16,212 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 70) MSC000001: Failed to start service jboss.persistenceunit."hibernate-demo.war#primary": org.jboss.msc.service.StartException in service jboss.persistenceunit."hibernate-demo.war#primary": javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory at org.jboss.as.jpa@7.4.10.GA-redhat-00002//org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:198) at org.jboss.as.jpa@7.4.10.GA-redhat-00002//org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:128) at java.base/java.security.AccessController.doPrivileged(Native Method) at org.wildfly.security.elytron-private@1.15.16.Final-redhat-00001//org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:664) at org.jboss.as.jpa@7.4.10.GA-redhat-00002//org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:213) at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990) at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at java.base/java.lang.Thread.run(Thread.java:829) ... Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.System$2.defineClass(System.java:2131) at java.base/java.lang.invoke.MethodHandles$Lookup.defineClass(MethodHandles.java:962) at org.javassist@3.27.0.GA-redhat-00001//javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:295) at org.javassist@3.27.0.GA-redhat-00001//javassist.util.proxy.DefineClassHelper$Java11.defineClass(DefineClassHelper.java:48) at org.javassist@3.27.0.GA-redhat-00001//javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:260) at org.javassist@3.27.0.GA-redhat-00001//javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:154) at org.javassist@3.27.0.GA-redhat-00001//javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:640) at org.javassist@3.27.0.GA-redhat-00001//javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:624) at org.javassist@3.27.0.GA-redhat-00001//javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:560) at org.javassist@3.27.0.GA-redhat-00001//javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:481) at org.hibernate@5.3.28.Final-redhat-00001//org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:75) at org.hibernate@5.3.28.Final-redhat-00001//org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:103) at org.hibernate@5.3.28.Final-redhat-00001//org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:155) at org.hibernate@5.3.28.Final-redhat-00001//org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:51) ... 31 more
Investigation
The same application can be deployed to JBoss EAP 7.4.1 (javassist-3.23.2.GA-redhat-00001) with no error. The issue seems to be caused by changes introduced in EAP 7.4.2 which includes javassist-3.27.0.GA-redhat-00001, the same version in EAP 7.4.10. It's possible it is related to this commit which made changes to support Java 11.
The application deploys OK when specifying a proxy class within the same application (com.sample.ITest), or a class like java.lang.String. Seems to be an issue with the javax.management package.
- links to