-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Exception on deploy of Entity with @Enumerated field
PostPosted: Wed Nov 26, 2014 6:13 am 
Newbie

Joined: Wed Nov 26, 2014 5:56 am
Posts: 12
Hi all

We are trying to setup Glassfish 4.1 and Hibernate/Hibernate OGM 4.1.0.Beta8 as the JPA provider with MongoDB as the backed DB. This seems to work well except that for entities that have a field annotated with @Enumerated(EnumType.STRING), we get an exception show below. The exception disappears when the field is deactivated (source code comment out).

Any help appreciated.

Thorsten





Code:
2014-11-26T10:30:59.331+0100|Schwerwiegend: javax.persistence.PersistenceException: [PersistenceUnit: fm] Unable to build Hibernate SessionFactory
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1225)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.access$600(EntityManagerFactoryBuilderImpl.java:119)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:853)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
       at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
       at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
       at org.hibernate.ogm.jpa.HibernateOgmPersistence.createContainerEntityManagerFactory(HibernateOgmPersistence.java:105)
       at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)
       at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
       at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
       at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
       at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
       at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
       at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.Subject.doAs(Subject.java:360)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.Subject.doAs(Subject.java:360)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
       at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
       at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
       at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
       at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
       at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
       at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
       at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
       at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
       at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
       at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
       at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
       at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
       at java.lang.Thread.run(Thread.java:744)
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister
       at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:185)
       at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135)
       at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:401)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
       ... 51 more
Caused by: org.hibernate.HibernateException: OGM000059: Unable to find a GridType for org.hibernate.type.EnumType
       at org.hibernate.ogm.type.impl.TypeTranslatorImpl.getType(TypeTranslatorImpl.java:94)
       at org.hibernate.ogm.persister.impl.OgmEntityPersister.<init>(OgmEntityPersister.java:265)
       at org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister.<init>(SingleTableOgmEntityPersister.java:35)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
       at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:163)
       ... 55 more
2014-11-26T10:30:59.333+0100|Schwerwiegend: Exception while preparing the app
2014-11-26T10:30:59.333+0100|Schwerwiegend: Exception during lifecycle processing
javax.persistence.PersistenceException: [PersistenceUnit: fm] Unable to build Hibernate SessionFactory
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1225)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.access$600(EntityManagerFactoryBuilderImpl.java:119)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:853)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
       at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
       at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
       at org.hibernate.ogm.jpa.HibernateOgmPersistence.createContainerEntityManagerFactory(HibernateOgmPersistence.java:105)
       at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)
       at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
       at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
       at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
       at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
       at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
       at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.Subject.doAs(Subject.java:360)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.Subject.doAs(Subject.java:360)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
       at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
       at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
       at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
       at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
       at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
       at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
       at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
       at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
       at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
       at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
       at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
       at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
       at java.lang.Thread.run(Thread.java:744)
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister
       at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:185)
       at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135)
       at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:401)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
       ... 51 more
Caused by: org.hibernate.HibernateException: OGM000059: Unable to find a GridType for org.hibernate.type.EnumType
       at org.hibernate.ogm.type.impl.TypeTranslatorImpl.getType(TypeTranslatorImpl.java:94)
       at org.hibernate.ogm.persister.impl.OgmEntityPersister.<init>(OgmEntityPersister.java:265)
       at org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister.<init>(SingleTableOgmEntityPersister.java:35)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
       at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:163)
       ... 55 more

2014-11-26T10:30:59.403+0100|Schwerwiegend: Exception while preparing the app : [PersistenceUnit: fm] Unable to build Hibernate SessionFactory
org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister
       at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:185)
       at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135)
       at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:401)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
       at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
       at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
       at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
       at org.hibernate.ogm.jpa.HibernateOgmPersistence.createContainerEntityManagerFactory(HibernateOgmPersistence.java:105)
       at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)
       at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
       at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
       at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
       at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
       at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
       at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.Subject.doAs(Subject.java:360)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.Subject.doAs(Subject.java:360)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
       at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
       at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
       at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
       at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
       at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
       at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
       at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
       at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
       at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
       at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
       at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
       at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
       at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
       at java.lang.Thread.run(Thread.java:744)
Caused by: org.hibernate.HibernateException: OGM000059: Unable to find a GridType for org.hibernate.type.EnumType
       at org.hibernate.ogm.type.impl.TypeTranslatorImpl.getType(TypeTranslatorImpl.java:94)
       at org.hibernate.ogm.persister.impl.OgmEntityPersister.<init>(OgmEntityPersister.java:265)
       at org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister.<init>(SingleTableOgmEntityPersister.java:35)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
       at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:163)
       ... 55 more


Top
 Profile  
 
 Post subject: Re: Exception on deploy of Entity with @Enumerated field
PostPosted: Wed Nov 26, 2014 7:31 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
I've tried to replicate the issue but it seems to work fine.

Would you be able to create a test case for it or post more details about the configuration and the entity causing the issue?

Thanks,
Davide


Top
 Profile  
 
 Post subject: Re: Exception on deploy of Entity with @Enumerated field
PostPosted: Wed Nov 26, 2014 7:42 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
At least it works as a standalone application, I haven't deployed it on GlassFish


Top
 Profile  
 
 Post subject: Re: Exception on deploy of Entity with @Enumerated field
PostPosted: Wed Nov 26, 2014 8:02 am 
Newbie

Joined: Wed Nov 26, 2014 5:56 am
Posts: 12
DavideD wrote:
At least it works as a standalone application, I haven't deployed it on GlassFish


This goes in the direction that we suspect: a configuration issue. So far, we haven't found a working example using Glassfish documented somewhere. Anyway we'll try to prepare an example to reproduce the issue (which is a bit of work since we cannot disclose the real code here).

Thanks
Thorsten


Top
 Profile  
 
 Post subject: Re: Exception on deploy of Entity with @Enumerated field
PostPosted: Wed Nov 26, 2014 2:06 pm 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi Thorsten,

There is a test which also uses an enum-typed property in our test suite:

* https://github.com/hibernate/hibernate-ogm/blob/master/core/src/test/java/org/hibernate/ogm/backendtck/type/BuiltInTypeTest.java
* https://github.com/hibernate/hibernate-ogm/blob/master/core/src/test/java/org/hibernate/ogm/backendtck/type/Bookmark.java#L164

Maybe you can use it as a basis for your reproducer. I'd be surprised if there really is a correlation with GlassFish, but then, you never now :) Can you reproduce the issue in standalone test case as well?

If you can debug the application it would also be very interesting to see of which type/class the "type" variable is here:

https://github.com/hibernate/hibernate-ogm/blob/4.1.0.Beta8/core/src/main/java/org/hibernate/ogm/type/impl/TypeTranslatorImpl.java#L91

For enum types, it should actually go to the next block (else if ( type instanceof CustomType ) { ... }) rather than exiting at the line in your stack trace.

Thanks for giving OGM a spin and reporting this issue! I'd also be very interested in any other feedback you may have (be it good or bad), or feature requests and so on!

Cheers,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
 Post subject: Re: Exception on deploy of Entity with @Enumerated field
PostPosted: Thu Nov 27, 2014 11:44 am 
Newbie

Joined: Wed Nov 26, 2014 5:56 am
Posts: 12
Gunnar wrote:
For enum types, it should actually go to the next block (else if ( type instanceof CustomType ) { ... }) rather than exiting at the line in your stack trace.


We also did some debugging and came to the same question. Apparently, the program does not go into the else branch.

Meanwhile we have prepared a minimal example to reproduce the issue. It comes as a WAR so that you can simply put it into Glassfish's auto deploy dir. Unfortunately, its size is about 20MB (due to a lot of dependencies). How could we send you this? Or should we open a Jira issue and attach the WAR?

Thorsten


Top
 Profile  
 
 Post subject: Re: Exception on deploy of Entity with @Enumerated field
PostPosted: Fri Nov 28, 2014 4:44 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi Thorsten,

Many thanks for preparing a test case for this. 20MB still is huge, though. Could you provide just the essential parts, stripping any unneccessary dependencies? And did you try to reproduce this in small JUnit test which does not need to be run in a container? That'd be the best as it allows for much simpler debugging etc.

My suggestion would be to fork the Hibernate OGM project on GitHub (https://github.com/hibernate/hibernate-ogm), take one of the existing tests for MongoDB (e.g. https://github.com/hibernate/hibernate-ogm/blob/master/mongodb/src/test/java/org/hibernate/ogm/datastore/mongodb/test/id/TableGeneratorTest.java) and adapt it to use your entity.

If the issue is not reproducible that way and it really only shows up when deployed in the container, e.g. a small Maven project which I can build myself would help. That should be much smaller than 20MB as it wouldn't contain any dependencies itself. Opening up a JIRA issue and attaching that project would be the way to go.

Thanks again for your help,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.