Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [CDO] IllegalArgumentException and ClassCastException
[CDO] IllegalArgumentException and ClassCastException [message #619222] Mon, 09 June 2008 14:33
Tom Crockett is currently offline Tom CrockettFriend
Messages: 54
Registered: July 2009
Member
Hi, I've encountered a few problems while using CDO, and I'm not sure if
they are a problem with my model or with CDO. I have a modeled class
called Area, which has an attribute called "type" which is an Enumerator
with literals "elliptical" and "rectangular". The first problem is that
I've specified that the "type" attribute has a default value of
"elliptical", but when I create an Area object in the CDO editor it
doesn't have this default value. The second problem is that when I try to
set a value on it, and then click elsewhere, I get an error dialog caused
by an IllegalArgumentException being thrown in the FactoryImpl:

public Type createTypeFromString(EDataType eDataType, String initialValue)
{
Type result = Type.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" +
initialValue + "' is not a valid enumerator of '" + eDataType.getName() +
"'");
return result;
}

For some reason the initialValue is null even though a default value
literal was specified.

Another problem I've seen is that when I create an Area object in the
regular EMF editor and save it as an xmi or xml resource and then try to
import it into the CDO editor, I get a ClassCastException here:

[ERROR]
org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$Containmen tUpdatingFeatureMapEntry
java.lang.ClassCastException:
org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$Containmen tUpdatingFeatureMapEntry
at org.eclipse.emf.internal.cdo.CDOStore.get(CDOStore.java:138)
at
org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreFeatureMa p.delegateGet(CDOObjectImpl.java:940)
at
org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreFeatureMa p.delegateGet(CDOObjectImpl.java:1)
at
org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEL ist.java:396)
at
org.eclipse.emf.common.util.DelegatingEList$EIterator.doNext (DelegatingEList.java:1075)
at
org.eclipse.emf.common.util.DelegatingEList$EIterator.next(D elegatingEList.java:1062)
at
org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.scanNext(EContentsEList.java:512)
at
org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.hasNext(EContentsEList.java:436)
at org.eclipse.emf.internal.cdo.util.FSMUtil$1.hasNext(FSMUtil. java:166)
at
org.eclipse.emf.internal.cdo.CDOStateMachine$AttachTransitio n.execute(CDOStateMachine.java:391)
at
org.eclipse.emf.internal.cdo.CDOStateMachine$AttachTransitio n.execute(CDOStateMachine.java:1)
at
org.eclipse.net4j.util.fsm.FiniteStateMachine.process(Finite StateMachine.java:161)
at
org.eclipse.emf.internal.cdo.CDOStateMachine.attach(CDOState Machine.java:161)
at
org.eclipse.emf.internal.cdo.CDOStore.handleContainmentAdd(C DOStore.java:572)
at org.eclipse.emf.internal.cdo.CDOStore.add(CDOStore.java:427)
at
org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEList.del egateAdd(CDOObjectImpl.java:676)
at
org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEList.del egateAdd(CDOObjectImpl.java:682)
at
org.eclipse.emf.common.util.DelegatingEList.addUnique(Delega tingEList.java:517)
at
org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.doAddUnique(DelegatingNotifyingListImpl.java:323)
at
org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.addUnique(DelegatingNotifyingListImpl.java:307)
at
org.eclipse.emf.common.util.DelegatingEList.add(DelegatingEL ist.java:499)
at
org.eclipse.emf.cdo.internal.ui.actions.ImportResourceAction .doRun(ImportResourceAction.java:107)
at
org.eclipse.net4j.util.ui.actions.LongRunningAction$1.run(Lo ngRunningAction.java:164)
at
org.eclipse.net4j.util.om.monitor.MonitoredJob.run(Monitored Job.java:48)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Any ideas?

Tom
Previous Topic:Sparse lists seem to cause havoc in Teneo 0.7.5
Next Topic:[CDO] IllegalArgumentException and ClassCastException
Goto Forum:
  


Current Time: Sat Apr 04 12:12:50 GMT 2020

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

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

Back to the top