Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] ClassCastException occurs when getting a list of EEnum
[CDO] ClassCastException occurs when getting a list of EEnum [message #670966] Mon, 16 May 2011 12:12 Go to next message
Julien Jorge is currently offline Julien JorgeFriend
Messages: 6
Registered: January 2011
Junior Member
Hi,

I made an ecore model where a class has an attribute defined as a list of EEnum values. When reading the attribute's value, a ClassCastException occurs with the following message :

Quote:
An error has occurred. See error log for more details.
org.eclipse.emf.cdo.internal.common.revision.CDOListImpl cannot be cast to java.lang.Integer


To reproduce the problem, open a CDO Session in Eclipse and register the attached test.ecore file. Open a transaction, create a resource then create a new root of type "Sample object". Then, open the properties of the created instance, edit the "Sample attribute" and press OK to see the error message.

I use CDO 3. In my opinion it looks like a missing feature in CDO. Is there a workaround for it ? Maybe it is implemented in a more recent release ?

The stack trace is :
CDOTypeImpl$23.convertToEMF(EClassifier, Object) line: 478
CDOStore.convertToEMF(EObject, InternalCDORevision, EStructuralFeature, int, Object) line: 581
CDOStore.get(InternalEObject, EStructuralFeature, int) line: 176
CDOStore.isSet(InternalEObject, EStructuralFeature) line: 194
Sample_objectImpl(CDOObjectImpl).eDynamicIsSet(int, EStructuralFeature) line: 563
Sample_objectImpl(BasicEObjectImpl).eIsSet(int) line: 1263
Sample_objectImpl(BasicEObjectImpl).eIsSet(EStructuralFeature) line: 1247
SetCommand.prepare() line: 540
SetCommand(AbstractCommand).canExecute() line: 114
SetCommand(AbstractOverrideableCommand).doCanExecute() line: 120
SetCommand(AbstractOverrideableCommand).canExecute() line: 113
BasicCommandStack.execute(Command) line: 80
ItemPropertyDescriptor.setPropertyValue(Object, Object) line: 1441
PropertySource.setPropertyValue(Object, Object) line: 116
PropertySheetEntry.valueChanged(PropertySheetEntry) line: 782
PropertySheetEntry.setValue(Object) line: 723
PropertySheetEntry.applyEditorValue() line: 146
PropertySheetEntry$1.applyEditorValue() line: 103
CellEditor$1.run() line: 333
SafeRunner.run(ISafeRunnable) line: 42
JFaceUtil$1.run(ISafeRunnable) line: 49
SafeRunnable.run(ISafeRunnable) line: 175
PropertyDescriptor$3(CellEditor).fireApplyEditorValue() line: 331
DialogCellEditor$2.widgetSelected(SelectionEvent) line: 259
TypedListener.handleEvent(Event) line: 234
EventTable.sendEvent(Event) line: 84
Button(Widget).sendEvent(Event) line: 1053
Display.runDeferredEvents() line: 4066
Display.readAndDispatch() line: 3657
Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2629
Workbench.runUI() line: 2593
Workbench.access$4(Workbench) line: 2427
Workbench$7.run() line: 670
Realm.runWithDefault(Realm, Runnable) line: 332
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 663
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149
IDEApplication.start(IApplicationContext) line: 115
EclipseAppHandle.run(Object) line: 196
EclipseAppLauncher.runApplication(Object) line: 110
EclipseAppLauncher.start(Object) line: 79
EclipseStarter.run(Object) line: 369
EclipseStarter.run(String[], Runnable) line: 179
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
Main.invokeFramework(String[], URL[]) line: 619
Main.basicRun(String[]) line: 574
Main.run(String[]) line: 1407
Main.main(String[]) line: 1383


Best regards

Julien
  • Attachment: test.ecore
    (Size: 0.65KB, Downloaded 141 times)
Re: [CDO] ClassCastException occurs when getting a list of EEnum [message #686769 is a reply to message #670966] Mon, 16 May 2011 14:28 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi Julien,

I just tried it with the current HEAD revision of CDO and there it
works. So, I guess your issue is really a missing feature/a bug which
has been fixed in the meantime.

Cheers
Stefan

Am 16.05.11 14:12, schrieb forums-noreply@eclipse.org:
> Hi,
>
> I made an ecore model where a class has an attribute defined
> as a list of EEnum values. When reading the attribute's
> value, a ClassCastException occurs with the following
> message :
>
> Quote:
>> An error has occurred. See error log for more details.
>> org.eclipse.emf.cdo.internal.common.revision.CDOListImpl
>> cannot be cast to java.lang.Integer
>
>
> To reproduce the problem, open a CDO Session in Eclipse and
> register the attached test.ecore file. Open a transaction,
> create a resource then create a new root of type "Sample
> object". Then, open the properties of the created instance,
> edit the "Sample attribute" and press OK to see the error
> message.
>
> I use CDO 3. In my opinion it looks like a missing feature
> in CDO. Is there a workaround for it ? Maybe it is
> implemented in a more recent release ?
>
> The stack trace is :
> CDOTypeImpl$23.convertToEMF(EClassifier, Object) line: 478
> CDOStore.convertToEMF(EObject, InternalCDORevision,
> EStructuralFeature, int, Object) line: 581
> CDOStore.get(InternalEObject, EStructuralFeature, int) line:
> 176
> CDOStore.isSet(InternalEObject, EStructuralFeature) line:
> 194
> Sample_objectImpl(CDOObjectImpl).eDynamicIsSet(int,
> EStructuralFeature) line: 563
> Sample_objectImpl(BasicEObjectImpl).eIsSet(int) line: 1263
> Sample_objectImpl(BasicEObjectImpl).eIsSet(EStructuralFeature)
> line: 1247
> SetCommand.prepare() line: 540
> SetCommand(AbstractCommand).canExecute() line: 114
> SetCommand(AbstractOverrideableCommand).doCanExecute() line:
> 120
> SetCommand(AbstractOverrideableCommand).canExecute() line:
> 113
> BasicCommandStack.execute(Command) line: 80
> ItemPropertyDescriptor.setPropertyValue(Object, Object)
> line: 1441
> PropertySource.setPropertyValue(Object, Object) line: 116
> PropertySheetEntry.valueChanged(PropertySheetEntry) line:
> 782
> PropertySheetEntry.setValue(Object) line: 723
> PropertySheetEntry.applyEditorValue() line: 146
> PropertySheetEntry$1.applyEditorValue() line: 103
> CellEditor$1.run() line: 333
> SafeRunner.run(ISafeRunnable) line: 42
> JFaceUtil$1.run(ISafeRunnable) line: 49
> SafeRunnable.run(ISafeRunnable) line: 175
> PropertyDescriptor$3(CellEditor).fireApplyEditorValue()
> line: 331
> DialogCellEditor$2.widgetSelected(SelectionEvent) line: 259
> TypedListener.handleEvent(Event) line: 234
> EventTable.sendEvent(Event) line: 84
> Button(Widget).sendEvent(Event) line: 1053
> Display.runDeferredEvents() line: 4066
> Display.readAndDispatch() line: 3657
> Workbench.runEventLoop(Window$IExceptionHandler, Display)
> line: 2629
> Workbench.runUI() line: 2593
> Workbench.access$4(Workbench) line: 2427
> Workbench$7.run() line: 670
> Realm.runWithDefault(Realm, Runnable) line: 332
> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor)
> line: 663
> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor)
> line: 149
> IDEApplication.start(IApplicationContext) line: 115
> EclipseAppHandle.run(Object) line: 196
> EclipseAppLauncher.runApplication(Object) line: 110
> EclipseAppLauncher.start(Object) line: 79
> EclipseStarter.run(Object) line: 369
> EclipseStarter.run(String[], Runnable) line: 179
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[])
> line: not available [native method]
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: not
> available
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line:
> not available
> Method.invoke(Object, Object...) line: not available
> Main.invokeFramework(String[], URL[]) line: 619
> Main.basicRun(String[]) line: 574
> Main.run(String[]) line: 1407
> Main.main(String[]) line: 1383
>
> Best regards
>
> Julien
> begin 644 test.ecore
> M/#]X;6P@=F5R<VEO;CTB,2XP(B!E;F-O9&EN9STB551&+3@B/SX*/&5C;W)E
> M.D5086-K86=E('AM:3IV97)S:6]N/2(R+C`B"B`@("!X;6QN<SIX;6D](FAT
> M='`Z+R]W=W<N;VUG+F]R9R]834DB('AM;&YS.GAS:3TB:'1T<#HO+W=W=RYW
> M,RYO<F<O,C`P,2]834Q38VAE;6$M:6YS=&%N8V4B"B`@("!X;6QN<SIE8V]R
> M93TB:'1T<#HO+W=W=RYE8VQI<'-E+F]R9R]E;68O,C`P,B]%8V]R92(@;F%M
> M93TB=&5S='!A8VLB"B`@("!N<U5223TB:'1T<#HO+R]T97-T+F5C;W)E(B!N
> M<U!R969I>#TB=&5S='!A8VLB/@H@(#QE0VQA<W-I9FEE<G,@>'-I.G1Y<&4]
> M(F5C;W)E.D5%;G5M(B!N86UE/2)386UP;&5?96YU;2(^"B`@("`\94QI=&5R
> M86QS(&YA;64](D%L;',B+SX*("`@(#QE3&ET97)A;',@;F%M93TB3F]N97,B
> M('9A;'5E/2(Q,"(O/@H@(#PO94-L87-S:69I97)S/@H@(#QE0VQA<W-I9FEE
> M<G,@>'-I.G1Y<&4](F5C;W)E.D5#;&%S<R(@;F%M93TB4V%M<&QE7V]B:F5C
> M="(^"B`@("`\95-T<G5C='5R86Q&96%T=7)E<R!X<VDZ='EP93TB96-O<F4Z
> M14%T=')I8G5T92(@;F%M93TB<V%M<&QE7V%T=')I8G5T92(@=7!P97)";W5N
> M9#TB+3$B"B`@("`@("`@951Y<&4](B,O+U-A;7!L95]E;G5M(B\^"B`@/"]E
> ?0VQA<W-I9FEE<G,^"CPO96-O<F4Z15!A8VMA9V4^"@``
> `
> end
>
Re: [CDO] ClassCastException occurs when getting a list of EEnum [message #686770 is a reply to message #670966] Mon, 16 May 2011 16:23 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Julien,

Please also note that CDO 4.0 will be generally available (GA) next month.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 16.05.2011 14:12, schrieb forums-noreply@eclipse.org:
> Hi,
>
> I made an ecore model where a class has an attribute defined
> as a list of EEnum values. When reading the attribute's
> value, a ClassCastException occurs with the following
> message :
>
> Quote:
>> An error has occurred. See error log for more details.
>> org.eclipse.emf.cdo.internal.common.revision.CDOListImpl
>> cannot be cast to java.lang.Integer
>
>
> To reproduce the problem, open a CDO Session in Eclipse and
> register the attached test.ecore file. Open a transaction,
> create a resource then create a new root of type "Sample
> object". Then, open the properties of the created instance,
> edit the "Sample attribute" and press OK to see the error
> message.
>
> I use CDO 3. In my opinion it looks like a missing feature
> in CDO. Is there a workaround for it ? Maybe it is
> implemented in a more recent release ?
>
> The stack trace is :
> CDOTypeImpl$23.convertToEMF(EClassifier, Object) line: 478
> CDOStore.convertToEMF(EObject, InternalCDORevision,
> EStructuralFeature, int, Object) line: 581
> CDOStore.get(InternalEObject, EStructuralFeature, int) line:
> 176
> CDOStore.isSet(InternalEObject, EStructuralFeature) line:
> 194
> Sample_objectImpl(CDOObjectImpl).eDynamicIsSet(int,
> EStructuralFeature) line: 563
> Sample_objectImpl(BasicEObjectImpl).eIsSet(int) line: 1263
> Sample_objectImpl(BasicEObjectImpl).eIsSet(EStructuralFeature)
> line: 1247
> SetCommand.prepare() line: 540
> SetCommand(AbstractCommand).canExecute() line: 114
> SetCommand(AbstractOverrideableCommand).doCanExecute() line:
> 120
> SetCommand(AbstractOverrideableCommand).canExecute() line:
> 113
> BasicCommandStack.execute(Command) line: 80
> ItemPropertyDescriptor.setPropertyValue(Object, Object)
> line: 1441
> PropertySource.setPropertyValue(Object, Object) line: 116
> PropertySheetEntry.valueChanged(PropertySheetEntry) line:
> 782
> PropertySheetEntry.setValue(Object) line: 723
> PropertySheetEntry.applyEditorValue() line: 146
> PropertySheetEntry$1.applyEditorValue() line: 103
> CellEditor$1.run() line: 333
> SafeRunner.run(ISafeRunnable) line: 42
> JFaceUtil$1.run(ISafeRunnable) line: 49
> SafeRunnable.run(ISafeRunnable) line: 175
> PropertyDescriptor$3(CellEditor).fireApplyEditorValue()
> line: 331
> DialogCellEditor$2.widgetSelected(SelectionEvent) line: 259
> TypedListener.handleEvent(Event) line: 234
> EventTable.sendEvent(Event) line: 84
> Button(Widget).sendEvent(Event) line: 1053
> Display.runDeferredEvents() line: 4066
> Display.readAndDispatch() line: 3657
> Workbench.runEventLoop(Window$IExceptionHandler, Display)
> line: 2629
> Workbench.runUI() line: 2593
> Workbench.access$4(Workbench) line: 2427
> Workbench$7.run() line: 670
> Realm.runWithDefault(Realm, Runnable) line: 332
> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor)
> line: 663
> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor)
> line: 149
> IDEApplication.start(IApplicationContext) line: 115
> EclipseAppHandle.run(Object) line: 196
> EclipseAppLauncher.runApplication(Object) line: 110
> EclipseAppLauncher.start(Object) line: 79
> EclipseStarter.run(Object) line: 369
> EclipseStarter.run(String[], Runnable) line: 179
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[])
> line: not available [native method]
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: not
> available
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line:
> not available
> Method.invoke(Object, Object...) line: not available
> Main.invokeFramework(String[], URL[]) line: 619
> Main.basicRun(String[]) line: 574
> Main.run(String[]) line: 1407
> Main.main(String[]) line: 1383
>
> Best regards
>
> Julien
> begin 644 test.ecore
> M/#]X;6P@=F5R<VEO;CTB,2XP(B!E;F-O9&EN9STB551&+3@B/SX*/&5C;W)E
> M.D5086-K86=E('AM:3IV97)S:6]N/2(R+C`B"B`@("!X;6QN<SIX;6D](FAT
> M='`Z+R]W=W<N;VUG+F]R9R]834DB('AM;&YS.GAS:3TB:'1T<#HO+W=W=RYW
> M,RYO<F<O,C`P,2]834Q38VAE;6$M:6YS=&%N8V4B"B`@("!X;6QN<SIE8V]R
> M93TB:'1T<#HO+W=W=RYE8VQI<'-E+F]R9R]E;68O,C`P,B]%8V]R92(@;F%M
> M93TB=&5S='!A8VLB"B`@("!N<U5223TB:'1T<#HO+R]T97-T+F5C;W)E(B!N
> M<U!R969I>#TB=&5S='!A8VLB/@H@(#QE0VQA<W-I9FEE<G,@>'-I.G1Y<&4]
> M(F5C;W)E.D5%;G5M(B!N86UE/2)386UP;&5?96YU;2(^"B`@("`\94QI=&5R
> M86QS(&YA;64](D%L;',B+SX*("`@(#QE3&ET97)A;',@;F%M93TB3F]N97,B
> M('9A;'5E/2(Q,"(O/@H@(#PO94-L87-S:69I97)S/@H@(#QE0VQA<W-I9FEE
> M<G,@>'-I.G1Y<&4](F5C;W)E.D5#;&%S<R(@;F%M93TB4V%M<&QE7V]B:F5C
> M="(^"B`@("`\95-T<G5C='5R86Q&96%T=7)E<R!X<VDZ='EP93TB96-O<F4Z
> M14%T=')I8G5T92(@;F%M93TB<V%M<&QE7V%T=')I8G5T92(@=7!P97)";W5N
> M9#TB+3$B"B`@("`@("`@951Y<&4](B,O+U-A;7!L95]E;G5M(B\^"B`@/"]E
> ?0VQA<W-I9FEE<G,^"CPO96-O<F4Z15!A8VMA9V4^"@``
> `
> end
>


Previous Topic:(no subject)
Next Topic:(no subject)
Goto Forum:
  


Current Time: Tue Apr 23 10:50:59 GMT 2024

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

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

Back to the top