Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » [EMF][CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.Hibe
[EMF][CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.Hibe [message #831028] Wed, 28 March 2012 11:15 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: [EMF][CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer. [message #831071 is a reply to message #831028] Wed, 28 March 2012 12:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26088
Registered: July 2009
Senior Member
Kris,

Please use eclipse.tools.emf for asking questions about CDO.


On 28/03/2012 7:15 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
>
Re: [EMF][CDO][Hibernate] ClassCastException org.eclipse.emf.cdo.server.internal.hibernate.tuplizer. [message #831925 is a reply to message #831071] Thu, 29 March 2012 14:25 Go to previous message
Kris Missing name is currently offline Kris Missing name
Messages: 47
Registered: July 2009
Member
Hi Ed,

OK, I reposted to the eclipse.tools.emf group.

Thanks & Regards
Kris

Am 3/28/12 2:33 PM, schrieb Ed Merks:
> Kris,
>
> Please use eclipse.tools.emf for asking questions about CDO.
>
>
> On 28/03/2012 7:15 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:New Eclipse User Group in New Jersey
Next Topic:SysML and GMF -based domain specific modeling language
Goto Forum:
  


Current Time: Wed Oct 01 14:28:15 GMT 2014

Powered by FUDForum. Page generated in 0.16762 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software