[Edapt] Migrating cross reference classcast issue [message #1862345] |
Mon, 27 November 2023 15:18 |
Roland Fahlbusch Messages: 5 Registered: November 2023 |
Junior Member |
|
|
Hi,
i am trying to get started with Edapt on migrating models and i am stuck on this exception when loading reconstructing the original history:
(I am Testing migrating models by migrating a reusable rename operation)
java.lang.ClassCastException: class org.eclipse.emf.ecore.impl.EObjectImpl cannot be cast to class org.eclipse.emf.ecore.EClassifier (org.eclipse.emf.ecore.impl.EObjectImpl and org.eclipse.emf.ecore.EClassifier are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @602297ad)
at org.eclipse.emf.ecore.impl.EReferenceImpl.eSet(EReferenceImpl.java:423)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1110)
at org.eclipse.emf.edapt.history.reconstruction.EcoreReconstructorSwitchBase.set(EcoreReconstructorSwitchBase.java:82)
at org.eclipse.emf.edapt.history.reconstruction.EcoreForwardReconstructor$EcoreReconstructorSwitch.caseSet(EcoreForwardReconstructor.java:107)
at org.eclipse.emf.edapt.spi.history.util.HistorySwitch.doSwitch(HistorySwitch.java:309)
at org.eclipse.emf.edapt.spi.history.util.HistorySwitch.doSwitch(HistorySwitch.java:106)
at org.eclipse.emf.edapt.spi.history.util.HistorySwitch.doSwitch(HistorySwitch.java:92)
at org.eclipse.emf.edapt.history.reconstruction.EcoreForwardReconstructor.startChange(EcoreForwardReconstructor.java:73)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:99)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:114)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:104)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:80)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:59)
at org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:76)
at org.eclipse.emf.edapt.migration.execution.Migrator.migrate(Migrator.java:271)
at org.eclipse.emf.edapt.migration.execution.Migrator.migrateAndLoad(Migrator.java:223)
After some debugging i realized that the problem involves an EReference which is located in another model.
So here is the setup:
3 ecore models:
designForX.ecore -> The overarching model where the history is located
a.ecore
b.ecore
Code From designForX.ecore:
<eClassifiers xsi:type="ecore:EClass" name="CustomD4XClass" eSuperTypes="../../bPlugin/b.ecore#//CustomBSuperclass">
<eStructuralFeatures xsi:type="ecore:EReference" name="CustomAClass" eType="../../aPlugin/a.ecore#//CustomAPackage/CustomAClass"/>
</eClassifiers>
The models were already created and are quite big. I created the history and added the orther models as ressource. I see the history in all models and i can release the changes. The migrator detects when the saved XMI is of an old version and starts the migration.
Any idea where thi issue could be? I gladly atach more information. I am using 1.8 as execution environment with an Edapt version 1.5 and EMF 2.35.
Thanks in advance ;)
[Updated on: Mon, 27 November 2023 17:18] Report message to a moderator
|
|
|
|
Re: [Edapt] Migrating cross reference classcast issue [message #1862369 is a reply to message #1862345] |
Wed, 29 November 2023 09:52 |
|
Hi,
so usually in these cases you will have to open designForX.ecore's context menu -> Edapt -> Add Metamodel to history -> Next -> Select "a.ecore" and "b.ecore" as Metamodel Resources -> Finish
This should make sure that all the changes in the initial release are in the right order and contains the changes from all three ecores.
If you still have issues, please try to attach a small reproducer. Otherwise it is really hard to diagnose issues with Edapt.
Johannes Faltermeier
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03484 seconds