Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.Hibernate
[CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.Hibernate [message #831634] Thu, 29 March 2012 01:54 Go to next message
Kris Missing name is currently offline Kris Missing name
Messages: 47
Registered: July 2009
Member
Hi,

in my model one class has an attribute, that is a list of enumerations.
The enumeration is defined with the standard emf EEnum and EEnumLiteral
elements.

When I create an instance of that class, add an Enum type to the
attribute list and then save it with CDO/Hibernate, I get the following
exception (see below).

Any idea whats the reason for this class cast exception?


Thanks & Regards
Kris

org.eclipse.emf.cdo.util.CommitException: Rollback in HibernateStore:
java.lang.ClassCastException:
org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper
cannot be cast to org.eclipse.emf.common.util.Enumerator
at
org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
at
org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
at
org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
at
org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
at
org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
at
org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at
org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
at
org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
at
org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
at
org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
at
org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
at
org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
at
org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
at
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
at
org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
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:680)

at
com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:205)
at
com.foo.persistence.hibernate.impl.PersistenceManagerImpl.saveSomeObject(PersistenceManagerImpl.java:101)
at
biz.foo.persistence.hibernate.impl.test.PersistenceManagerTest.testAddSomeObject(PersistenceManagerTest.java:109)
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 junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.eclipse.emf.cdo.util.CommitException: Rollback in
HibernateStore: java.lang.ClassCastException:
org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper
cannot be cast to org.eclipse.emf.common.util.Enumerator
at
org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
at
org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
at
org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
at
org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
at
org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
at
org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at
org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
at
org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
at
org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
at
org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
at
org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
at
org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
at
org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
at
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
at
org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
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:680)

at
org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:94)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1069)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1089)
at
com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:203)
... 21 more
Re: [CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.Hiber [message #832501 is a reply to message #831634] Fri, 30 March 2012 04:03 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi Kris,
Lists of enums are not supported by Hibernate, at least there is a bug. Can you enter a bugzilla? Will take a look at it
soon (over the weekend I hope).

gr. Martin


On 03/29/2012 07:54 AM, KW wrote:
> Hi,
>
> in my model one class has an attribute, that is a list of enumerations. The enumeration is defined with the standard emf
> EEnum and EEnumLiteral elements.
>
> When I create an instance of that class, add an Enum type to the attribute list and then save it with CDO/Hibernate, I
> get the following exception (see below).
>
> Any idea whats the reason for this class cast exception?
>
>
> Thanks & Regards
> Kris
>
> org.eclipse.emf.cdo.util.CommitException: Rollback in HibernateStore: java.lang.ClassCastException:
> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper cannot be cast to
> org.eclipse.emf.common.util.Enumerator
> at org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
> at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
> at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
> at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
> at org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
> at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
> at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
> at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
> at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
> at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
>
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
> at org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
> at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
> at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>
> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
> 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:680)
>
> at com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:205)
> at com.foo.persistence.hibernate.impl.PersistenceManagerImpl.saveSomeObject(PersistenceManagerImpl.java:101)
> at biz.foo.persistence.hibernate.impl.test.PersistenceManagerTest.testAddSomeObject(PersistenceManagerTest.java:109)
> 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 junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at junit.framework.TestSuite.run(TestSuite.java:238)
> at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: org.eclipse.emf.cdo.util.CommitException: Rollback in HibernateStore: java.lang.ClassCastException:
> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper cannot be cast to
> org.eclipse.emf.common.util.Enumerator
> at org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
> at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
> at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
> at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
> at org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
> at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
> at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
> at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
> at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
> at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
>
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
> at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
> at org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
> at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
> at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>
> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
> 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:680)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:94)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1069)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1089)
> at com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:203)
> ... 21 more


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.Hiber [message #832987 is a reply to message #832501] Fri, 30 March 2012 16:32 Go to previous messageGo to next message
Kris Missing name is currently offline Kris Missing name
Messages: 47
Registered: July 2009
Member
Hi Martin,

thanks for taking time for this problem.

(I attached a copy of the post as file for better readability of the xml
sections).

I created a second project as showcase project for the bugzilla entry
and with this project it is possible to save a model that has an
attribute being a list of Enums! What makes me confused is that I cannot
see any difference in the model/used plugin versions between my original
project and the showcase project. When I compare the generated
databases, there is a first difference: In the showcase project the
relationship between the model (Employee) and the list of enums
(EmployeeType) is properly applied to the database with an additional
table employee_types. The generated hbm is equal to what is generated as
database structure:


<hibernate-mapping auto-import="false">
<class entity-name="Employee" abstract="false" lazy="true"
table="`employee`">
<meta attribute="eclassName" inherit="false">Employee</meta>
<meta attribute="epackage"
inherit="false">http://orgstructure/1.0</meta>
<tuplizer entity-mode="pojo"
class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
<tuplizer entity-mode="dynamic-map"
class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
<id name="id" type="java.lang.String">
<column not-null="true" unique="false" name="`id`"/>
</id>
<property name="resourceID"
type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
<column name="resource_id"/>
</property>
<property name="containerID" type="string">
<column name="container_id"/>
</property>
<property name="version" type="java.lang.Integer">
<meta attribute="version">true</meta>
<column name="version"/>
</property>
<property name="commit_TimeStamp" type="java.lang.Long"/>
<property name="name" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`name`"/>
</property>
<list name="types" table="`employee_types`" lazy="false"
cascade="all,delete-orphan">
<key update="true">
<column name="`employee_types_id`" unique="false"/>
</key>
<list-index column="`employee_types_idx`"/>
<element>
<type
name="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType">
<param
name="enumClass">com.emfdbexample.orgstructure.model.EmployeeType</param>
<param name="eclassifier">EmployeeType</param>
<param name="epackage">http://orgstructure/1.0</param>
</type>
</element>
</list>
</class>
</hibernate-mapping>


In my orignal project producing the ClassCastExeption the generated hbm
is not equal with the generated database structure. The generated hbm
looks good, also here is a second table defined to apply the 1:n
relationship between the model (Business) and the list of enums
(BusinessType).

<hibernate-mapping auto-import="false">
<class entity-name="Business" abstract="false" lazy="true"
table="`business`">
<meta attribute="eclassName" inherit="false">Business</meta>
<meta attribute="epackage"
inherit="false">http://mymodel.biz/1.0</meta>
<tuplizer entity-mode="pojo"
class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
<tuplizer entity-mode="dynamic-map"
class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
<id type="long" name="idcol" column="idcol"
access="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOSyntheticIdPropertyHandler">
<meta attribute="syntheticId" inherit="false">true</meta>
<generator class="native"/>
</id>
<property name="resourceID"
type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
<column name="resource_id"/>
</property>
<property name="containerID" type="string">
<column name="container_id"/>
</property>
<property name="version" type="java.lang.Integer">
<meta attribute="version">true</meta>
<column name="version"/>
</property>
<property name="commit_TimeStamp" type="java.lang.Long"/>
<property name="url" lazy="false" insert="true" update="true"
not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`url`"/>
</property>
<property name="name" lazy="false" insert="true" update="true"
not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
<property name="id" lazy="false" insert="true" update="true"
not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`id`"/>
</property>

<list name="types" table="`business_types`" lazy="false"
cascade="all,delete-orphan">
<key update="true">
<column name="`business_types_e_id`" unique="false"/>
</key>
<list-index column="`business_types_idx`"/>
<element>
<type
name="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType">
<param name="enumClass">biz.mymodel.model.BusinessType</param>
<param name="eclassifier">BusinessType</param>
<param name="epackage">http://mymodel.biz/1.0</param>
</type>
</element>
</list>
</class>
</hibernate-mapping>


the database itself DOES NOT have this additional table "business_types"
and instead the model table "business" has only a column "types" of type
VARCHAR. So the 1:n relationship is actually not applied in the database.
I don't understand why this is the case, since both hbm definitions are
fine and the configured mapping providers are the same:

Mopping provider / config from the showcase project:

<repository name="repo1">
<property name="overrideUUID" value=""/>
<property name="supportingAudits" value="false"/>
<store type="hibernate">
<mappingProvider type="teneo">
<property name="teneo.mapping.cascade_policy_on_non_containment"
value="PERSIST,MERGE"/>
<property name="teneo.mapping.inheritance" value="JOINED"/>
<property name="teneo.mapping.add_index_for_fk" value="true"/>
</mappingProvider>

<!-- Hibernate properties , see:
http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional
-->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.connection.pool_size" value="10"/>
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>

<!-- Setting for hsqldb -->
<property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.url"
value="jdbc:hsqldb:hsql://localhost:9002/orgdb"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.autocommit" value="true"/>
</store>
</repository>

Mapping provider / config from the original project:

<repository name="mymodelcdorepo">
<property name="overrideUUID" value=""/>
<property name="supportingAudits" value="false"/>
<store type="hibernate">
<mappingProvider type="teneo">
<property name="teneo.mapping.cascade_policy_on_non_containment"
value="PERSIST,MERGE"/>
<property name="teneo.mapping.inheritance" value="JOINED"/>
<property name="teneo.mapping.add_index_for_fk" value="true"/>
</mappingProvider>

<!-- Hibernate properties , see:
http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional
-->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.connection.pool_size" value="10"/>
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>

<!-- Setting for hsqldb -->
<property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.url"
value="jdbc:hsqldb:hsql://localhost:9002/cdomymodel"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.autocommit" value="true"/>
</store>
</repository>

Furthermore, when I debug into the
org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet
method, in the showcase project the "value" parameter is an Integer and
therefore probably never reaches the line where the Classcast Excepiton
occurs. In the original project the "value" parameter is of type
HibernateMovableListWrapper and therefore goes into the last else block
where Classcast exception occurs.

Does the above information provide any hint where the two setups
(original and showcase) are not equal?

Thanks & Regards
Kris





Am 3/30/12 10:03 AM, schrieb Martin Taal:
> Hi Kris,
> Lists of enums are not supported by Hibernate, at least there is a bug.
> Can you enter a bugzilla? Will take a look at it soon (over the weekend
> I hope).
>
> gr. Martin
>
>
> On 03/29/2012 07:54 AM, KW wrote:
>> Hi,
>>
>> in my model one class has an attribute, that is a list of
>> enumerations. The enumeration is defined with the standard emf
>> EEnum and EEnumLiteral elements.
>>
>> When I create an instance of that class, add an Enum type to the
>> attribute list and then save it with CDO/Hibernate, I
>> get the following exception (see below).
>>
>> Any idea whats the reason for this class cast exception?
>>
>>
>> Thanks & Regards
>> Kris
>>
>> org.eclipse.emf.cdo.util.CommitException: Rollback in HibernateStore:
>> java.lang.ClassCastException:
>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper
>> cannot be cast to
>> org.eclipse.emf.common.util.Enumerator
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
>>
>> at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
>>
>> at
>> org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
>>
>> at
>> org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
>>
>> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
>>
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
>>
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
>>
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>>
>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
>>
>> at
>> org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
>>
>> at
>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
>>
>> at
>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
>>
>> at
>> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>>
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>>
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>>
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
>>
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
>> 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:680)
>>
>> at
>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:205)
>>
>> at
>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.saveSomeObject(PersistenceManagerImpl.java:101)
>>
>> at
>> biz.foo.persistence.hibernate.impl.test.PersistenceManagerTest.testAddSomeObject(PersistenceManagerTest.java:109)
>>
>> 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 junit.framework.TestCase.runTest(TestCase.java:168)
>> at junit.framework.TestCase.runBare(TestCase.java:134)
>> at junit.framework.TestResult$1.protect(TestResult.java:110)
>> at junit.framework.TestResult.runProtected(TestResult.java:128)
>> at junit.framework.TestResult.run(TestResult.java:113)
>> at junit.framework.TestCase.run(TestCase.java:124)
>> at junit.framework.TestSuite.runTest(TestSuite.java:243)
>> at junit.framework.TestSuite.run(TestSuite.java:238)
>> at
>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
>>
>> at
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>
>> Caused by: org.eclipse.emf.cdo.util.CommitException: Rollback in
>> HibernateStore: java.lang.ClassCastException:
>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper
>> cannot be cast to
>> org.eclipse.emf.common.util.Enumerator
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
>>
>> at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
>>
>> at
>> org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
>>
>> at
>> org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
>>
>> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
>>
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
>>
>> at
>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
>>
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
>>
>> at
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>>
>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
>>
>> at
>> org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
>>
>> at
>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
>>
>> at
>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
>>
>> at
>> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>>
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>>
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>>
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
>>
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
>> 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:680)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:94)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1069)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1089)
>>
>> at
>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:203)
>>
>> ... 21 more
>
>


I created a second project as showcase project for the bugzilla entry and with this project it is possible to save a model that has an attribute being a list of Enums! What makes me confused is that I cannot see any difference in the model/used plugin versions between my original project and the showcase project. When I compare the generated databases, there is a first difference: In the showcase project the relationship between the model (Employee) and the list of enums (EmployeeType) is properly applied to the database with an additional table employee_types. The generated hbm is equal to what is generated as database structure:


<hibernate-mapping auto-import="false">
<class entity-name="Employee" abstract="false" lazy="true" table="`employee`">
<meta attribute="eclassName" inherit="false">Employee</meta>
<meta attribute="epackage" inherit="false">http://orgstructure/1.0</meta>
<tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
<tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
<id name="id" type="java.lang.String">
<column not-null="true" unique="false" name="`id`"/>
</id>
<property name="resourceID" type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
<column name="resource_id"/>
</property>
<property name="containerID" type="string">
<column name="container_id"/>
</property>
<property name="version" type="java.lang.Integer">
<meta attribute="version">true</meta>
<column name="version"/>
</property>
<property name="commit_TimeStamp" type="java.lang.Long"/>
<property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`name`"/>
</property>
<list name="types" table="`employee_types`" lazy="false" cascade="all,delete-orphan">
<key update="true">
<column name="`employee_types_id`" unique="false"/>
</key>
<list-index column="`employee_types_idx`"/>
<element>
<type name="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType">
<param name="enumClass">com.emfdbexample.orgstructure.model.EmployeeType</param>
<param name="eclassifier">EmployeeType</param>
<param name="epackage">http://orgstructure/1.0</param>
</type>
</element>
</list>
</class>
</hibernate-mapping>


In my orignal project producing the ClassCastExeption the generated hbm is not equal with the generated database structure. The generated hbm looks good, also here is a second table defined to apply the 1:n relationship between the model (Business) and the list of enums (BusinessType).

<hibernate-mapping auto-import="false">
<class entity-name="Business" abstract="false" lazy="true" table="`business`">
<meta attribute="eclassName" inherit="false">Business</meta>
<meta attribute="epackage" inherit="false">http://mymodel.biz/1.0</meta>
<tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
<tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
<id type="long" name="idcol" column="idcol" access="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOSyntheticIdPropertyHandler">
<meta attribute="syntheticId" inherit="false">true</meta>
<generator class="native"/>
</id>
<property name="resourceID" type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
<column name="resource_id"/>
</property>
<property name="containerID" type="string">
<column name="container_id"/>
</property>
<property name="version" type="java.lang.Integer">
<meta attribute="version">true</meta>
<column name="version"/>
</property>
<property name="commit_TimeStamp" type="java.lang.Long"/>
<property name="url" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`url`"/>
</property>
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
<property name="id" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`id`"/>
</property>

<list name="types" table="`business_types`" lazy="false" cascade="all,delete-orphan">
<key update="true">
<column name="`business_types_e_id`" unique="false"/>
</key>
<list-index column="`business_types_idx`"/>
<element>
<type name="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType">
<param name="enumClass">biz.mymodel.model.BusinessType</param>
<param name="eclassifier">BusinessType</param>
<param name="epackage">http://mymodel.biz/1.0</param>
</type>
</element>
</list>
</class>
</hibernate-mapping>


the database itself DOES NOT have this additional table "business_types" and instead the model table "business" has only a column "types" of type VARCHAR. So the 1:n relationship is actually not applied in the database.
I don't understand why this is the case, since both hbm definitions are fine and the configured mapping providers are the same:

Mopping provider / config from the showcase project:

<repository name="repo1">
<property name="overrideUUID" value=""/>
<property name="supportingAudits" value="false"/>
<store type="hibernate">
<mappingProvider type="teneo">
<property name="teneo.mapping.cascade_policy_on_non_containment" value="PERSIST,MERGE"/>
<property name="teneo.mapping.inheritance" value="JOINED"/>
<property name="teneo.mapping.add_index_for_fk" value="true"/>
</mappingProvider>

<!-- Hibernate properties , see: http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional -->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.connection.pool_size" value="10"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>

<!-- Setting for hsqldb -->
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://localhost:9002/orgdb"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.autocommit" value="true"/>
</store>
</repository>

Mapping provider / config from the original project:

<repository name="mymodelcdorepo">
<property name="overrideUUID" value=""/>
<property name="supportingAudits" value="false"/>
<store type="hibernate">
<mappingProvider type="teneo">
<property name="teneo.mapping.cascade_policy_on_non_containment" value="PERSIST,MERGE"/>
<property name="teneo.mapping.inheritance" value="JOINED"/>
<property name="teneo.mapping.add_index_for_fk" value="true"/>
</mappingProvider>

<!-- Hibernate properties , see: http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional -->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.connection.pool_size" value="10"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>

<!-- Setting for hsqldb -->
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://localhost:9002/cdomymodel"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.autocommit" value="true"/>
</store>
</repository>

Furthermore, when I debug into the org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet method, in the showcase project the "value" parameter is an Integer and therefore probably never reaches the line where the Classcast Excepiton occurs. In the original project the "value" parameter is of type HibernateMovableListWrapper and therefore goes into the last else block where Classcast exception occurs.

Does the above information provide any hint where the two setups (original and showcase) are not equal?
Re: [CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.Hiber [message #833034 is a reply to message #832987] Fri, 30 March 2012 18:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi Kris,
Thanks for this extensive post. I will check it out also. I tried the list of enums in the example project I have and it
failed with the same error as you encountered. So I can reproduce it, and will work from that to. Let's hope it does not
disappear by itself :-).

Did you already enter the bugzilla? If so, can you post the link? (I did not receive an email from bugzilla)

gr. Martin

On 03/30/2012 10:32 PM, KW wrote:
> Hi Martin,
>
> thanks for taking time for this problem.
>
> (I attached a copy of the post as file for better readability of the xml sections).
>
> I created a second project as showcase project for the bugzilla entry and with this project it is possible to save a
> model that has an attribute being a list of Enums! What makes me confused is that I cannot see any difference in the
> model/used plugin versions between my original project and the showcase project. When I compare the generated databases,
> there is a first difference: In the showcase project the relationship between the model (Employee) and the list of enums
> (EmployeeType) is properly applied to the database with an additional table employee_types. The generated hbm is equal
> to what is generated as database structure:
>
>
> <hibernate-mapping auto-import="false">
> <class entity-name="Employee" abstract="false" lazy="true" table="`employee`">
> <meta attribute="eclassName" inherit="false">Employee</meta>
> <meta attribute="epackage" inherit="false">http://orgstructure/1.0</meta>
> <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
> <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
> <id name="id" type="java.lang.String">
> <column not-null="true" unique="false" name="`id`"/>
> </id>
> <property name="resourceID" type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
> <column name="resource_id"/>
> </property>
> <property name="containerID" type="string">
> <column name="container_id"/>
> </property>
> <property name="version" type="java.lang.Integer">
> <meta attribute="version">true</meta>
> <column name="version"/>
> </property>
> <property name="commit_TimeStamp" type="java.lang.Long"/>
> <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`name`"/>
> </property>
> <list name="types" table="`employee_types`" lazy="false" cascade="all,delete-orphan">
> <key update="true">
> <column name="`employee_types_id`" unique="false"/>
> </key>
> <list-index column="`employee_types_idx`"/>
> <element>
> <type name="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType">
> <param name="enumClass">com.emfdbexample.orgstructure.model.EmployeeType</param>
> <param name="eclassifier">EmployeeType</param>
> <param name="epackage">http://orgstructure/1.0</param>
> </type>
> </element>
> </list>
> </class>
> </hibernate-mapping>
>
>
> In my orignal project producing the ClassCastExeption the generated hbm is not equal with the generated database
> structure. The generated hbm looks good, also here is a second table defined to apply the 1:n relationship between the
> model (Business) and the list of enums (BusinessType).
>
> <hibernate-mapping auto-import="false">
> <class entity-name="Business" abstract="false" lazy="true" table="`business`">
> <meta attribute="eclassName" inherit="false">Business</meta>
> <meta attribute="epackage" inherit="false">http://mymodel.biz/1.0</meta>
> <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
> <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
> <id type="long" name="idcol" column="idcol"
> access="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOSyntheticIdPropertyHandler">
> <meta attribute="syntheticId" inherit="false">true</meta>
> <generator class="native"/>
> </id>
> <property name="resourceID" type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
> <column name="resource_id"/>
> </property>
> <property name="containerID" type="string">
> <column name="container_id"/>
> </property>
> <property name="version" type="java.lang.Integer">
> <meta attribute="version">true</meta>
> <column name="version"/>
> </property>
> <property name="commit_TimeStamp" type="java.lang.Long"/>
> <property name="url" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
> <column not-null="true" unique="false" name="`url`"/>
> </property>
> <property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
> <column not-null="true" unique="false" name="`name`"/>
> </property>
> <property name="id" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
> <column not-null="true" unique="false" name="`id`"/>
> </property>
>
> <list name="types" table="`business_types`" lazy="false" cascade="all,delete-orphan">
> <key update="true">
> <column name="`business_types_e_id`" unique="false"/>
> </key>
> <list-index column="`business_types_idx`"/>
> <element>
> <type name="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType">
> <param name="enumClass">biz.mymodel.model.BusinessType</param>
> <param name="eclassifier">BusinessType</param>
> <param name="epackage">http://mymodel.biz/1.0</param>
> </type>
> </element>
> </list>
> </class>
> </hibernate-mapping>
>
>
> the database itself DOES NOT have this additional table "business_types" and instead the model table "business" has only
> a column "types" of type VARCHAR. So the 1:n relationship is actually not applied in the database.
> I don't understand why this is the case, since both hbm definitions are fine and the configured mapping providers are
> the same:
>
> Mopping provider / config from the showcase project:
>
> <repository name="repo1">
> <property name="overrideUUID" value=""/>
> <property name="supportingAudits" value="false"/>
> <store type="hibernate">
> <mappingProvider type="teneo">
> <property name="teneo.mapping.cascade_policy_on_non_containment" value="PERSIST,MERGE"/>
> <property name="teneo.mapping.inheritance" value="JOINED"/>
> <property name="teneo.mapping.add_index_for_fk" value="true"/>
> </mappingProvider>
>
> <!-- Hibernate properties , see:
> http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional -->
> <property name="hibernate.hbm2ddl.auto" value="update"/>
> <property name="hibernate.show_sql" value="false"/>
> <property name="hibernate.connection.pool_size" value="10"/>
> <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
>
> <!-- Setting for hsqldb -->
> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
> <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
> <property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://localhost:9002/orgdb"/>
> <property name="hibernate.connection.username" value="sa"/>
> <property name="hibernate.connection.password" value=""/>
> <property name="hibernate.connection.autocommit" value="true"/>
> </store>
> </repository>
>
> Mapping provider / config from the original project:
>
> <repository name="mymodelcdorepo">
> <property name="overrideUUID" value=""/>
> <property name="supportingAudits" value="false"/>
> <store type="hibernate">
> <mappingProvider type="teneo">
> <property name="teneo.mapping.cascade_policy_on_non_containment" value="PERSIST,MERGE"/>
> <property name="teneo.mapping.inheritance" value="JOINED"/>
> <property name="teneo.mapping.add_index_for_fk" value="true"/>
> </mappingProvider>
>
> <!-- Hibernate properties , see:
> http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional -->
> <property name="hibernate.hbm2ddl.auto" value="update"/>
> <property name="hibernate.show_sql" value="false"/>
> <property name="hibernate.connection.pool_size" value="10"/>
> <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
>
> <!-- Setting for hsqldb -->
> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
> <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
> <property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://localhost:9002/cdomymodel"/>
> <property name="hibernate.connection.username" value="sa"/>
> <property name="hibernate.connection.password" value=""/>
> <property name="hibernate.connection.autocommit" value="true"/>
> </store>
> </repository>
>
> Furthermore, when I debug into the org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet
> method, in the showcase project the "value" parameter is an Integer and therefore probably never reaches the line where
> the Classcast Excepiton occurs. In the original project the "value" parameter is of type HibernateMovableListWrapper and
> therefore goes into the last else block where Classcast exception occurs.
>
> Does the above information provide any hint where the two setups (original and showcase) are not equal?
>
> Thanks & Regards
> Kris
>
>
>
>
>
> Am 3/30/12 10:03 AM, schrieb Martin Taal:
>> Hi Kris,
>> Lists of enums are not supported by Hibernate, at least there is a bug.
>> Can you enter a bugzilla? Will take a look at it soon (over the weekend
>> I hope).
>>
>> gr. Martin
>>
>>
>> On 03/29/2012 07:54 AM, KW wrote:
>>> Hi,
>>>
>>> in my model one class has an attribute, that is a list of
>>> enumerations. The enumeration is defined with the standard emf
>>> EEnum and EEnumLiteral elements.
>>>
>>> When I create an instance of that class, add an Enum type to the
>>> attribute list and then save it with CDO/Hibernate, I
>>> get the following exception (see below).
>>>
>>> Any idea whats the reason for this class cast exception?
>>>
>>>
>>> Thanks & Regards
>>> Kris
>>>
>>> org.eclipse.emf.cdo.util.CommitException: Rollback in HibernateStore:
>>> java.lang.ClassCastException:
>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper
>>> cannot be cast to
>>> org.eclipse.emf.common.util.Enumerator
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
>>>
>>> at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
>>>
>>> at
>>> org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
>>>
>>> at
>>> org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
>>>
>>> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
>>>
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
>>>
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
>>>
>>>
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>>>
>>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
>>>
>>> at
>>> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>>>
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>>>
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>>>
>>>
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
>>>
>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
>>>
>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
>>> 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:680)
>>>
>>> at
>>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:205)
>>>
>>> at
>>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.saveSomeObject(PersistenceManagerImpl.java:101)
>>>
>>> at
>>> biz.foo.persistence.hibernate.impl.test.PersistenceManagerTest.testAddSomeObject(PersistenceManagerTest.java:109)
>>>
>>> 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 junit.framework.TestCase.runTest(TestCase.java:168)
>>> at junit.framework.TestCase.runBare(TestCase.java:134)
>>> at junit.framework.TestResult$1.protect(TestResult.java:110)
>>> at junit.framework.TestResult.runProtected(TestResult.java:128)
>>> at junit.framework.TestResult.run(TestResult.java:113)
>>> at junit.framework.TestCase.run(TestCase.java:124)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:243)
>>> at junit.framework.TestSuite.run(TestSuite.java:238)
>>> at
>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>>
>>> Caused by: org.eclipse.emf.cdo.util.CommitException: Rollback in
>>> HibernateStore: java.lang.ClassCastException:
>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper
>>> cannot be cast to
>>> org.eclipse.emf.common.util.Enumerator
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
>>>
>>> at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
>>>
>>> at
>>> org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
>>>
>>> at
>>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
>>>
>>> at
>>> org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
>>>
>>> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
>>>
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
>>>
>>> at
>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
>>>
>>>
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
>>>
>>> at
>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>>>
>>> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
>>>
>>> at
>>> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>>>
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>>>
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>>>
>>>
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
>>>
>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
>>>
>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
>>> 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:680)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:94)
>>>
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1069)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1089)
>>>
>>> at
>>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:203)
>>>
>>> ... 21 more
>>
>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.Hiber [message #833319 is a reply to message #833034] Sat, 31 March 2012 05:21 Go to previous message
Kris Missing name is currently offline Kris Missing name
Messages: 47
Registered: July 2009
Member
Hi Martin,

I am glad to hear that you can reproduce the problem on your side. So I
created the following bugzilla entry

https://bugs.eclipse.org/bugs/show_bug.cgi?id=375766

without showcase project for repducability and referenced this forum
post instead.

Thanks for your help!

Regards
Kris


Am 3/31/12 12:09 AM, schrieb Martin Taal:
> Hi Kris,
> Thanks for this extensive post. I will check it out also. I tried the
> list of enums in the example project I have and it failed with the same
> error as you encountered. So I can reproduce it, and will work from that
> to. Let's hope it does not disappear by itself :-).
>
> Did you already enter the bugzilla? If so, can you post the link? (I did
> not receive an email from bugzilla)
>
> gr. Martin
>
> On 03/30/2012 10:32 PM, KW wrote:
>> Hi Martin,
>>
>> thanks for taking time for this problem.
>>
>> (I attached a copy of the post as file for better readability of the
>> xml sections).
>>
>> I created a second project as showcase project for the bugzilla entry
>> and with this project it is possible to save a
>> model that has an attribute being a list of Enums! What makes me
>> confused is that I cannot see any difference in the
>> model/used plugin versions between my original project and the
>> showcase project. When I compare the generated databases,
>> there is a first difference: In the showcase project the relationship
>> between the model (Employee) and the list of enums
>> (EmployeeType) is properly applied to the database with an additional
>> table employee_types. The generated hbm is equal
>> to what is generated as database structure:
>>
>>
>> <hibernate-mapping auto-import="false">
>> <class entity-name="Employee" abstract="false" lazy="true"
>> table="`employee`">
>> <meta attribute="eclassName" inherit="false">Employee</meta>
>> <meta attribute="epackage" inherit="false">http://orgstructure/1.0</meta>
>> <tuplizer entity-mode="pojo"
>> class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
>>
>> <tuplizer entity-mode="dynamic-map"
>> class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
>>
>> <id name="id" type="java.lang.String">
>> <column not-null="true" unique="false" name="`id`"/>
>> </id>
>> <property name="resourceID"
>> type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
>>
>> <column name="resource_id"/>
>> </property>
>> <property name="containerID" type="string">
>> <column name="container_id"/>
>> </property>
>> <property name="version" type="java.lang.Integer">
>> <meta attribute="version">true</meta>
>> <column name="version"/>
>> </property>
>> <property name="commit_TimeStamp" type="java.lang.Long"/>
>> <property name="name" lazy="false" insert="true" update="true"
>> not-null="false" unique="false" type="java.lang.String">
>> <column not-null="false" unique="false" name="`name`"/>
>> </property>
>> <list name="types" table="`employee_types`" lazy="false"
>> cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`employee_types_id`" unique="false"/>
>> </key>
>> <list-index column="`employee_types_idx`"/>
>> <element>
>> <type
>> name="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType">
>>
>> <param
>> name="enumClass">com.emfdbexample.orgstructure.model.EmployeeType</param>
>> <param name="eclassifier">EmployeeType</param>
>> <param name="epackage">http://orgstructure/1.0</param>
>> </type>
>> </element>
>> </list>
>> </class>
>> </hibernate-mapping>
>>
>>
>> In my orignal project producing the ClassCastExeption the generated
>> hbm is not equal with the generated database
>> structure. The generated hbm looks good, also here is a second table
>> defined to apply the 1:n relationship between the
>> model (Business) and the list of enums (BusinessType).
>>
>> <hibernate-mapping auto-import="false">
>> <class entity-name="Business" abstract="false" lazy="true"
>> table="`business`">
>> <meta attribute="eclassName" inherit="false">Business</meta>
>> <meta attribute="epackage" inherit="false">http://mymodel.biz/1.0</meta>
>> <tuplizer entity-mode="pojo"
>> class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
>>
>> <tuplizer entity-mode="dynamic-map"
>> class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
>>
>> <id type="long" name="idcol" column="idcol"
>> access="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOSyntheticIdPropertyHandler">
>>
>> <meta attribute="syntheticId" inherit="false">true</meta>
>> <generator class="native"/>
>> </id>
>> <property name="resourceID"
>> type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
>>
>> <column name="resource_id"/>
>> </property>
>> <property name="containerID" type="string">
>> <column name="container_id"/>
>> </property>
>> <property name="version" type="java.lang.Integer">
>> <meta attribute="version">true</meta>
>> <column name="version"/>
>> </property>
>> <property name="commit_TimeStamp" type="java.lang.Long"/>
>> <property name="url" lazy="false" insert="true" update="true"
>> not-null="true" unique="false" type="java.lang.String">
>> <column not-null="true" unique="false" name="`url`"/>
>> </property>
>> <property name="name" lazy="false" insert="true" update="true"
>> not-null="true" unique="false" type="java.lang.String">
>> <column not-null="true" unique="false" name="`name`"/>
>> </property>
>> <property name="id" lazy="false" insert="true" update="true"
>> not-null="true" unique="false" type="java.lang.String">
>> <column not-null="true" unique="false" name="`id`"/>
>> </property>
>>
>> <list name="types" table="`business_types`" lazy="false"
>> cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`business_types_e_id`" unique="false"/>
>> </key>
>> <list-index column="`business_types_idx`"/>
>> <element>
>> <type
>> name="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType">
>>
>> <param name="enumClass">biz.mymodel.model.BusinessType</param>
>> <param name="eclassifier">BusinessType</param>
>> <param name="epackage">http://mymodel.biz/1.0</param>
>> </type>
>> </element>
>> </list>
>> </class>
>> </hibernate-mapping>
>>
>>
>> the database itself DOES NOT have this additional table
>> "business_types" and instead the model table "business" has only
>> a column "types" of type VARCHAR. So the 1:n relationship is actually
>> not applied in the database.
>> I don't understand why this is the case, since both hbm definitions
>> are fine and the configured mapping providers are
>> the same:
>>
>> Mopping provider / config from the showcase project:
>>
>> <repository name="repo1">
>> <property name="overrideUUID" value=""/>
>> <property name="supportingAudits" value="false"/>
>> <store type="hibernate">
>> <mappingProvider type="teneo">
>> <property name="teneo.mapping.cascade_policy_on_non_containment"
>> value="PERSIST,MERGE"/>
>> <property name="teneo.mapping.inheritance" value="JOINED"/>
>> <property name="teneo.mapping.add_index_for_fk" value="true"/>
>> </mappingProvider>
>>
>> <!-- Hibernate properties , see:
>> http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional
>> -->
>> <property name="hibernate.hbm2ddl.auto" value="update"/>
>> <property name="hibernate.show_sql" value="false"/>
>> <property name="hibernate.connection.pool_size" value="10"/>
>> <property name="hibernate.cache.provider_class"
>> value="org.hibernate.cache.HashtableCacheProvider"/>
>>
>> <!-- Setting for hsqldb -->
>> <property name="hibernate.dialect"
>> value="org.hibernate.dialect.HSQLDialect"/>
>> <property name="hibernate.connection.driver_class"
>> value="org.hsqldb.jdbcDriver"/>
>> <property name="hibernate.connection.url"
>> value="jdbc:hsqldb:hsql://localhost:9002/orgdb"/>
>> <property name="hibernate.connection.username" value="sa"/>
>> <property name="hibernate.connection.password" value=""/>
>> <property name="hibernate.connection.autocommit" value="true"/>
>> </store>
>> </repository>
>>
>> Mapping provider / config from the original project:
>>
>> <repository name="mymodelcdorepo">
>> <property name="overrideUUID" value=""/>
>> <property name="supportingAudits" value="false"/>
>> <store type="hibernate">
>> <mappingProvider type="teneo">
>> <property name="teneo.mapping.cascade_policy_on_non_containment"
>> value="PERSIST,MERGE"/>
>> <property name="teneo.mapping.inheritance" value="JOINED"/>
>> <property name="teneo.mapping.add_index_for_fk" value="true"/>
>> </mappingProvider>
>>
>> <!-- Hibernate properties , see:
>> http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional
>> -->
>> <property name="hibernate.hbm2ddl.auto" value="update"/>
>> <property name="hibernate.show_sql" value="false"/>
>> <property name="hibernate.connection.pool_size" value="10"/>
>> <property name="hibernate.cache.provider_class"
>> value="org.hibernate.cache.HashtableCacheProvider"/>
>>
>> <!-- Setting for hsqldb -->
>> <property name="hibernate.dialect"
>> value="org.hibernate.dialect.HSQLDialect"/>
>> <property name="hibernate.connection.driver_class"
>> value="org.hsqldb.jdbcDriver"/>
>> <property name="hibernate.connection.url"
>> value="jdbc:hsqldb:hsql://localhost:9002/cdomymodel"/>
>> <property name="hibernate.connection.username" value="sa"/>
>> <property name="hibernate.connection.password" value=""/>
>> <property name="hibernate.connection.autocommit" value="true"/>
>> </store>
>> </repository>
>>
>> Furthermore, when I debug into the
>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet
>>
>> method, in the showcase project the "value" parameter is an Integer
>> and therefore probably never reaches the line where
>> the Classcast Excepiton occurs. In the original project the "value"
>> parameter is of type HibernateMovableListWrapper and
>> therefore goes into the last else block where Classcast exception occurs.
>>
>> Does the above information provide any hint where the two setups
>> (original and showcase) are not equal?
>>
>> Thanks & Regards
>> Kris
>>
>>
>>
>>
>>
>> Am 3/30/12 10:03 AM, schrieb Martin Taal:
>>> Hi Kris,
>>> Lists of enums are not supported by Hibernate, at least there is a bug.
>>> Can you enter a bugzilla? Will take a look at it soon (over the weekend
>>> I hope).
>>>
>>> gr. Martin
>>>
>>>
>>> On 03/29/2012 07:54 AM, KW wrote:
>>>> Hi,
>>>>
>>>> in my model one class has an attribute, that is a list of
>>>> enumerations. The enumeration is defined with the standard emf
>>>> EEnum and EEnumLiteral elements.
>>>>
>>>> When I create an instance of that class, add an Enum type to the
>>>> attribute list and then save it with CDO/Hibernate, I
>>>> get the following exception (see below).
>>>>
>>>> Any idea whats the reason for this class cast exception?
>>>>
>>>>
>>>> Thanks & Regards
>>>> Kris
>>>>
>>>> org.eclipse.emf.cdo.util.CommitException: Rollback in HibernateStore:
>>>> java.lang.ClassCastException:
>>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper
>>>>
>>>> cannot be cast to
>>>> org.eclipse.emf.common.util.Enumerator
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
>>>>
>>>>
>>>> at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
>>>>
>>>>
>>>> at
>>>> org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
>>>>
>>>>
>>>> at
>>>> org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
>>>>
>>>>
>>>> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>>>>
>>>>
>>>> at
>>>> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
>>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
>>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
>>>> 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:680)
>>>>
>>>> at
>>>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:205)
>>>>
>>>>
>>>> at
>>>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.saveSomeObject(PersistenceManagerImpl.java:101)
>>>>
>>>>
>>>> at
>>>> biz.foo.persistence.hibernate.impl.test.PersistenceManagerTest.testAddSomeObject(PersistenceManagerTest.java:109)
>>>>
>>>>
>>>> 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 junit.framework.TestCase.runTest(TestCase.java:168)
>>>> at junit.framework.TestCase.runBare(TestCase.java:134)
>>>> at junit.framework.TestResult$1.protect(TestResult.java:110)
>>>> at junit.framework.TestResult.runProtected(TestResult.java:128)
>>>> at junit.framework.TestResult.run(TestResult.java:113)
>>>> at junit.framework.TestCase.run(TestCase.java:124)
>>>> at junit.framework.TestSuite.runTest(TestSuite.java:243)
>>>> at junit.framework.TestSuite.run(TestSuite.java:238)
>>>> at
>>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
>>>>
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
>>>>
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>>
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>>>>
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>>>>
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>>>>
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>>>>
>>>>
>>>> Caused by: org.eclipse.emf.cdo.util.CommitException: Rollback in
>>>> HibernateStore: java.lang.ClassCastException:
>>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.HibernateMoveableListWrapper
>>>>
>>>> cannot be cast to
>>>> org.eclipse.emf.common.util.Enumerator
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOENumStringType.nullSafeSet(CDOENumStringType.java:187)
>>>>
>>>>
>>>> at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2143)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2321)
>>>>
>>>>
>>>> at
>>>> org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:56)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2327)
>>>>
>>>>
>>>> at
>>>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2834)
>>>>
>>>>
>>>> at
>>>> org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
>>>>
>>>>
>>>> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
>>>>
>>>>
>>>> at
>>>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
>>>>
>>>>
>>>> at
>>>> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
>>>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.doWrite(HibernateStoreAccessor.java:683)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
>>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
>>>> 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:680)
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:94)
>>>>
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1069)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1089)
>>>>
>>>>
>>>> at
>>>> com.foo.persistence.hibernate.impl.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:203)
>>>>
>>>>
>>>> ... 21 more
>>>
>>>
>>
>
>
Previous Topic:Teneo broken mysql connection handling
Next Topic:Databinding To Combo?
Goto Forum:
  


Current Time: Thu Jul 24 02:31:55 EDT 2014

Powered by FUDForum. Page generated in 0.02522 seconds