Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » An Error when loading and OCL File for verification
An Error when loading and OCL File for verification [message #1760387] Wed, 26 April 2017 14:45 Go to next message
ping cin is currently offline ping cinFriend
Messages: 13
Registered: February 2014
Junior Member
Dear Ed,

I (and some of my colleagues) have been facing an issue with OCL.

I just created an OCL file ".ocl" and then wanted to load it on an xmi for verification.

I got an error which says that "IllegalStateException: Cannot modify resource set without a write transaction" (the full error log can be seen below), After that all the OCL file crashes and I got errors over all constraints.

I have the feeling that the OCL resource of the OCL file is not accepting modifications anymore for a reason I do not understand.
Please, do you know the cause of this error ?

Thank you.
Best regards.

Error Message: Complete OCL Editor linking error

Full error log:

java.lang.IllegalStateException: Cannot modify resource set without a write transaction
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:284)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:240)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.ocl.pivot.internal.PrecedenceImpl.setOrder(PrecedenceImpl.java:177)
at org.eclipse.ocl.pivot.internal.manager.PrecedenceManager.compilePrecedences(PrecedenceManager.java:112)
at org.eclipse.ocl.pivot.internal.manager.PivotMetamodelManager.createPrecedenceManager(PivotMetamodelManager.java:649)
at org.eclipse.ocl.pivot.internal.manager.PivotMetamodelManager.getPrecedenceManager(PivotMetamodelManager.java:1492)
at org.eclipse.ocl.pivot.internal.manager.PivotMetamodelManager.getInfixPrecedence(PivotMetamodelManager.java:1337)
at org.eclipse.ocl.xtext.essentialocl.cs2as.EssentialOCLCSPreOrderVisitor$InfixExpContinuation.execute(EssentialOCLCSPreOrderVisitor.java:107)
at org.eclipse.ocl.xtext.base.cs2as.CS2ASConversion.progressContinuations(CS2ASConversion.java:839)
at org.eclipse.ocl.xtext.base.cs2as.CS2ASConversion.update(CS2ASConversion.java:1328)
at org.eclipse.ocl.xtext.base.cs2as.CS2AS.update(CS2AS.java:614)
at org.eclipse.ocl.xtext.base.utilities.CS2ASLinker.afterModelLinked(CS2ASLinker.java:84)
at org.eclipse.xtext.linking.impl.AbstractCleaningLinker.linkModel(AbstractCleaningLinker.java:57)
at org.eclipse.xtext.resource.XtextResource.doLinking(XtextResource.java:323)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLinking(LazyLinkingResource.java:107)
at org.eclipse.ocl.xtext.essentialocl.utilities.EssentialOCLCSResource.doLinking(EssentialOCLCSResource.java:346)
at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:284)
at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:273)
at org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:171)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:100)
at org.eclipse.ocl.xtext.essentialocl.utilities.EssentialOCLCSResource.doLoad(EssentialOCLCSResource.java:354)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.ocl.xtext.completeocl.utilities.CompleteOCLLoader.loadResource(CompleteOCLLoader.java:171)
at org.eclipse.ocl.xtext.completeocl.utilities.CompleteOCLLoader.loadDocument(CompleteOCLLoader.java:133)
at org.eclipse.ocl.xtext.completeocl.ui.commands.LoadCompleteOCLResourceHandler$ResourceDialog$DeferredLoadDocumentJob.processResources(LoadCompleteOCLResourceHandler.java:187)
at org.eclipse.ocl.xtext.completeocl.ui.commands.LoadCompleteOCLResourceHandler$ResourceDialog$DeferredLoadDocumentJob.run(LoadCompleteOCLResourceHandler.java:151)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Re: An Error when loading and OCL File for verification [message #1760393 is a reply to message #1760387] Wed, 26 April 2017 15:14 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You will need to be much more precise about your repro. What you describe is impossible since OCL does not use EMF Transaction. I suspect that the problem is that OCL->Load re-uses someone else's ResourceSet and that ResourceSet is subject to EMF Transactions, and so org.eclipse.ocl.xtext.completeocl.ui.commands.LoadCompleteOCLResourceHandler$ResourceDialog$DeferredLoadDocumentJob.processResources(LoadCompleteOCLResourceHandler.java:187) should have tested for EMF Transaction in use and created a write transaction. But the offence seems to be a Precedence.setOrder which should be in OCL's private ResourceSet. Maybe EMF Transaction is infecting all ResourceSets.

Regards

Ed Willink

Previous Topic:Start/End position
Next Topic:Generating Java code for OCL constraints
Goto Forum:
  


Current Time: Thu Apr 25 13:32:06 GMT 2024

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

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

Back to the top