Given comments on JIRA issue
HHH-4868, there is some more details on this exception.
We have two configurations:
- development machine: PC with Windows XP
- test machine: IBM mainframe with zLinux 2.6.16.60-0.21-default
Both configurations have the same characteristics:
- Hibernate 3.3.1.GA
- Javassist 3.4.GA
- Websphere 7.0.0.3
- JVM J2RE 1.6.0 IBM J9
- DB2 390
The following exception is raised at Hibernate startup for every JPA entity on the test machine (mainframe), BUT NOT on the development machine (PC). Once Hibernate has started up, the application is fully functionnal and we could not find behavioral differences between the development and test machines.
The exception stack trace was:
Code:
1/29/10 15:01:21:239 CET] 00000034 PojoEntityTup W org.hibernate.tuple.entity.PojoEntityTuplizer buildProxyFactory could not create proxy factory for:mycompany.data.common.infosystem.UtApf
org.hibernate.HibernateException: Javassist Enhancement failed: mycompany.data.common.infosystem.UtApf
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:169)
at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:66)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:183)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:158)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:76)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:325)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:457)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:131)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createFactory(Persistence.java:172)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:66)
at mycompany.util.jpa.Connection._getEMF(Connection.java:117)
at mycompany.util.jpa.Connection.getEntityManager(Connection.java:92)
at mycompany.util.jpa.JPAAccessJTAImpl.<init>(JPAAccessJTAImpl.java:63)
at mycompany.util.jpa.JPAAccessFactory.create(JPAAccessFactory.java:64)
at mycompany.controller.bperportal.signon.SignonAction.executeAction(SignonAction.java:157)
at mycompany.controller.common.AbstractAction.executeInitBusiness(AbstractAction.java:150)
at mycompany.controller.common.AbstractAction.execute(AbstractAction.java:114)
at mycompany.controller.common.BPERRequestProcessor.processActionPerform(BPERRequestProcessor.java:108)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at mycompany.controller.common.BPERRequestProcessor.process(BPERRequestProcessor.java:76)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1455)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:793)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:444)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3622)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:927)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1566)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:175)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=mycompany/data/common/infosystem/UtApf_$$_javassist_707, method=<clinit>()V, pc=1346
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:37)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:920)
at java.lang.reflect.Field.getFieldAccessor(Field.java:901)
at java.lang.reflect.Field.set(Field.java:659)
at javassist.util.proxy.ProxyFactory.setField(ProxyFactory.java:348)
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:339)
at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:312)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:271)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:162)
... 51 more
Given that simply upgrading the Javassist library to version 3.11.GA solved the problem, we did not investigated further (reproducibility, test case, ...).