" When I am using Hibernate 5 with the DB2 column definition XML and I try to persist a entity class into the database I get the following error:
javax \r\n\r\n\r\n{noformat}\r\njavax .ejb.EJBTransactionRolledbackException: nested exception is: javax.ejb.EJBException: CWNEN0030E: The server was unable to obtain an object instance for the java:comp/env/XXX/em reference. The exception message was: javax.persistence.PersistenceException: [PersistenceUnit: XXX] Unable to build Hibernate SessionFactory; nested exception is: java.lang.RuntimeException: javax.persistence.PersistenceException: [PersistenceUnit: XXX] Unable to build Hibernate SessionFactory at \r\n\tat com.ibm.ejs.container.BusinessExceptionMappingStrategy.mapCSIException(BusinessExceptionMappingStrategy.java:152) at \r\n\tat com.ibm.ejs.container.BusinessExceptionMappingStrategy.mapCSITransactionRolledBackException(BusinessExceptionMappingStrategy.java:613) at \r\n\tat com.ibm.ejs.container.EJSDeployedSupport.mapCSITransactionRolledBackException(EJSDeployedSupport.java:602) at \r\n\tat com.ibm.ejs.container.EJSContainer.postInvokeRolledbackException(EJSContainer.java:4382) at \r\n\tat com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4073) at \r\n\tat sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source) at \r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at \r\n\tat java.lang.reflect.Method.invoke(Method.java:508) at \r\n\tat com.ibm.ejs.container.TimedObjectWrapper.invokeCallback(TimedObjectWrapper.java:103) at \r\n\tat com.ibm.ejs.container.TimerNpRunnable.doWork(TimerNpRunnable.java:184) at \r\n\tat com.ibm.ejs.container.TimerNpRunnable.run(TimerNpRunnable.java:91) at \r\n\tat com.ibm.ejs.container.TimerNpAlarmListener.fired(TimerNpAlarmListener.java:102) at \r\n\tat com.ibm.ws.asynchbeans.AlarmImpl.callListenerMethod(AlarmImpl.java:402) at \r\n\tat com.ibm.ws.asynchbeans.timer.GenericTimer.run(GenericTimer.java:229) at \r\n\tat com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:277) at \r\n\tat java.security.AccessController.doPrivileged(AccessController.java:664) at \r\n\tat javax.security.auth.Subject.doAs(Subject.java:488) at \r\n\tat com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:133) at \r\n\tat com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:91) at \r\n\tat com.ibm.ws.asynchbeans.J2EEContext$DoAsProxy.run(J2EEContext.java:348) at \r\n\tat java.security.AccessController.doPrivileged(AccessController.java:694) at \r\n\tat com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1042) at \r\n\tat com.ibm.ws.asynchbeans.AlarmImpl.runListenerAsCJWork(AlarmImpl.java:234) at \r\n\tat com.ibm.ws.asynchbeans.am._Alarm.fireAlarm(_Alarm.java:340) at \r\n\tat com.ibm.ws.asynchbeans.am._Alarm.run(_Alarm.java:237) at \r\n\tat com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909) Caused \r\nCaused by: javax.ejb.EJBException: CWNEN0030E: The server was unable to obtain an object instance for the java:comp/env/XXX/em reference. The exception message was: javax.persistence.PersistenceException: [PersistenceUnit: XXX] Unable to build Hibernate SessionFactory; nested exception is: java.lang.RuntimeException: javax.persistence.PersistenceException: [PersistenceUnit: XXX] Unable to build Hibernate SessionFactory at \r\n\tat com.ibm.ejs.container.util.ExceptionUtil.EJBException(ExceptionUtil.java:503) at \r\n\tat com.ibm.ejs.container.ManagedBeanOBase.injectInstance(ManagedBeanOBase.java:154) at \r\n\tat com.ibm.ejs.container.StatelessBeanO.injectInstance(StatelessBeanO.java:295) at \r\n\tat com.ibm.ejs.container.StatelessBeanO.initialize(StatelessBeanO.java:169) at \r\n\tat com.ibm.ejs.container.BeanOFactory.create(BeanOFactory.java:105) at \r\n\tat com.ibm.ejs.container.EJSHome.createBeanO(EJSHome.java:976) at \r\n\tat com.ibm.ejs.container.EJSHome.createBeanO(EJSHome.java:1078) at \r\n\tat com.ibm.ejs.container.activator.UncachedActivationStrategy.atActivate(UncachedActivationStrategy.java:63) at \r\n\tat com.ibm.ejs.container.activator.Activator.preInvokeActivateBean(Activator.java:264) at \r\n\tat com.ibm.ejs.container.EJSContainer.preInvokeActivate(EJSContainer.java:3239) at \r\n\tat com.ibm.ejs.container.EJSContainer.EjbPreInvoke(EJSContainer.java:2576) \r\n\t ... 23 common frames omitted Caused \r\nCaused by: java.lang.RuntimeException: javax.persistence.PersistenceException: [PersistenceUnit: XXX] Unable to build Hibernate SessionFactory at \r\n\tat com.ibm.ws.jpa.management.JPAPUnitInfo.getEntityManagerFactory(JPAPUnitInfo.java:1028) at \r\n\tat com.ibm.ws.jpa.management.JPAPUnitInfo.getEntityManagerPool(JPAPUnitInfo.java:1253) at \r\n\tat com.ibm.ws.jpa.management.JPATxEntityManager.<init>(JPATxEntityManager.java:188) at \r\n\tat com.ibm.ws.jpa.container.v21.JPATxEntityManagerV21.<init>(JPATxEntityManagerV21.java:69) at \r\n\tat com.ibm.ws.jpa.runtime.JPA21Runtime.createJPATxEntityManager(JPA21Runtime.java:133) at \r\n\tat com.ibm.ws.jpa.management.AbstractJPAComponent.getEntityManager(AbstractJPAComponent.java:299) at \r\n\tat com.ibm.ws.util.JPAJndiLookupObjectFactory.getObjectInstance(JPAJndiLookupObjectFactory.java:177) at \r\n\tat com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObjectInstance(InjectionBinding.java:1556) at \r\n\tat com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1433) at \r\n\tat com.ibm.wsspi.injectionengine.InjectionBinding.getInjectableObject(InjectionBinding.java:1373) at \r\n\tat com.ibm.wsspi.injectionengine.InjectionTarget.inject(InjectionTarget.java:108) at \r\n\tat com.ibm.ws.injectionengine.AbstractInjectionEngine.inject(AbstractInjectionEngine.java:852) at \r\n\tat com.ibm.ejs.container.ManagedBeanOBase.injectInstance(ManagedBeanOBase.java:148) \r\n\t ... 32 common frames omitted Caused \r\nCaused by: javax.persistence.PersistenceException: [PersistenceUnit: XXX] Unable to build Hibernate SessionFactory at \r\n\tat org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1016) at \r\n\tat org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:942) at \r\n\tat org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:149) at \r\n\tat com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory(JPAPUnitInfo.java:1161) at \r\n\tat com.ibm.ws.jpa.management.JPAPUnitInfo.initialize(JPAPUnitInfo.java:984) at \r\n\tat com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:240) at \r\n\tat com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:115) at \r\n\tat com.ibm.ws.jpa.management.JPAApplInfo.addPersistenceUnits(JPAApplInfo.java:147) at \r\n\tat com.ibm.ws.jpa.management.SharedJPAComponentImpl.startingModule(SharedJPAComponentImpl.java:322) at \r\n\tat com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:786) at \r\n\tat com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedApplication(JPAComponentImpl.java:636) at \r\n\tat com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:551) at \r\n\tat com.ibm.ws.runtime.component.ApplicationMgrImpl$ComparableDeployedObjectListener.stateChanged(ApplicationMgrImpl.java:2650) at \r\n\tat com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1177) at \r\n\tat com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1497) at \r\n\tat com.ibm.ws.runtime.component.DeployedApplicationImpl.setState(DeployedApplicationImpl.java:310) at \r\n\tat com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:1087) at \r\n\tat com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:799) at \r\n\tat com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1449) at \r\n\tat com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2309) at \r\n\tat com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436) at \r\n\tat com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123) at \r\n\tat com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379) at \r\n\tat com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:127) at \r\n\tat com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:654) at \r\n\tat com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5556) at \r\n\tat com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5682) at \r\n\tat com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255) at \r\n\tat com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:668) at \r\n\tat com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:612) at \r\n\tat com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1339) at \r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at \r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90) at \r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at \r\n\tat java.lang.reflect.Method.invoke(Method.java:508) at \r\n\tat sun.reflect.misc.Trampoline.invoke(MethodUtil.java:83) at \r\n\tat sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source) at \r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at \r\n\tat java.lang.reflect.Method.invoke(Method.java:508) at \r\n\tat sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:287) at \r\n\tat javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1263) at \r\n\tat java.security.AccessController.doPrivileged(AccessController.java:664) at \r\n\tat java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:91) at \r\n\tat javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1257) at \r\n\tat javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1096) at \r\n\tat com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:831) at \r\n\tat com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:813) at \r\n\tat com.ibm.ws390.management.connector.corba.CorbaConnectorImpl.invoke(CorbaConnectorImpl.java:1073) at \r\n\tat com.ibm.ws390.management.connector.corba._CorbaConnectorImplBase._invoke(_CorbaConnectorImplBase.java:416) at \r\n\tat com.ibm.ws390.orb.CommonBridge.invoke(CommonBridge.java:1898) at \r\n\tat com.ibm.ws390.orb.CommonBridge.getAndProcessWork(CommonBridge.java:725) at \r\n\tat com.ibm.ws390.orb.CommonBridge.runApplicationThread(CommonBridge.java:614) at \r\n\tat com.ibm.ws.util.ThreadPool$ZOSWorker.run(ThreadPool.java:2144) Caused \r\nCaused by: org.hibernate.MappingException: Could not determine type for: org.hibernate.dialect.DB2390Dialect, at table: XXX, for columns: [org.hibernate.mapping.Column(XML)] at \r\n\tat org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:486) at \r\n\tat org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:453) at \r\n\tat org.hibernate.mapping.Property.isValid(Property.java:226) at \r\n\tat org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:624) at \r\n\tat org.hibernate.mapping.RootClass.validate(RootClass.java:267) at \r\n\tat org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:347) at \r\n\tat org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:466) at \r\n\tat org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) \r\n\t ... 51 common frames omitted \r\n{noformat}\r\n\r\n" |
|