5 Replies Latest reply: Apr 27, 2012 10:09 AM by Adam Warski RSS

Type not supported: org.hibernate.type.DateType

mmulligan03 Newbie

I have been using the Envers for a few months now with now issues. Until I created an entity that has a date in it's primary key.  I started to get this error when I start my application.

 

javax.persistence.PersistenceException: PersistenceUnit: dmb Unable to build EntityManagerFactory

    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:678)

    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:133)

    at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)

    at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)

    at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)

    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:243)

    at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)

    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:111)

    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)

    at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)

    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)

    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)

    at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)

    at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)

    at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)

    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)

    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)

    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)

    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)

    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)

    at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:125)

    at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:52)

    at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

    at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)

    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)

    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)

    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)

    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1193)

    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1225)

    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)

    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)

    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)

    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)

    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)

    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)

    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)

    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)

    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:409)

    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

Caused by: org.hibernate.HibernateException: could not init listeners

    at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)

    at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1351)

    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1340)

    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)

    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:670)

    ... 57 more

Caused by: org.hibernate.MappingException: Type not supported: org.hibernate.type.DateType

    at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addIdProperties(IdMetadataGenerator.java:71)

    at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addId(IdMetadataGenerator.java:107)

    at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:380)

    at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:102)

    at org.hibernate.envers.configuration.AuditConfiguration.(AuditConfiguration.java:86)

    at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)

    at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:315)

    at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)

    at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)

    at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)

    ... 61 more

 

 

 

The entity in question is not being audited and does not have the @Audited annotation.  It is simply in the same persistence as the rest of my entities. 

 

Can someone shed some light on how to fix this issue. I was able to get around it for the time being by creating a second persistence unit that explicitly specifies all the entities that I am auditing but this is not ideal since it seams to be causing other issues in the application.