Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » IllegalValueException when extending EssentialOCL
IllegalValueException when extending EssentialOCL [message #1733934] Thu, 02 June 2016 10:21 Go to next message
Florian König is currently offline Florian KönigFriend
Messages: 30
Registered: June 2014
Member
Hi,

I want to extend EssentialOCL to use its expressions in my Xtext grammar, but I cannot figure out where this error comes from.

My Xtext grammar (a simple test):
grammar org.xtext.example.extendingOCL.EOCL with org.eclipse.ocl.xtext.essentialocl.EssentialOCL

generate eOCL "http://www.xtext.org/example/extendingOCL/EOCL"
import "http://www.eclipse.org/ocl/2015/EssentialOCLCS" as essentialocl
import "http://www.eclipse.org/emf/2002/Ecore" as ecore

Greeting:
	'Hello' model=Model;


My workflow:
module org.xtext.example.extendingOCL.GenerateEOCL

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."

Workflow {

	component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "org.xtext.example.extendingOCL"
				rootPath = rootPath
				eclipsePlugin = {
					enabled = true
				}
				createEclipseMetaData = true
			}
			code = {
				encoding = "windows-1252"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}
		}
		language = StandardLanguage {
			name = "org.xtext.example.extendingOCL.EOCL"
			fileExtensions = "eocl"
			
			referencedResource = "platform:/resource/org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.genmodel"
			referencedResource = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"
			
			serializer = {
				generateStub = false
			}
			validator = {
			// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
			}
			parserGenerator = {
				options = {
					backtrack = true // because OCL is no LL(*)-grammar
				}
			}
		}
	}
}


Whenever I try to generate the grammar, I get this IllegalValueException. It seems like I am missing something in the mwe2 workflow, but I don't know what it is. I added my projects as a zip archive to this post.

Can anybody help?

Stacktrace:
0    [main] INFO  text.xtext.generator.XtextGenerator  - Initializing Xtext generator
17   [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
156  [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project org.antlr.runtime at 'archive:file:/C:/eclipse-OCL/plugins/org.antlr.runtime_3.2.0.v201101311130.jar!/' and using 'archive:file:/C:/eclipse-OCL/plugins/org.antlr.runtime_4.3.0.v201502022030.jar!/' instead.
178  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.extendingOCL at 'file:/C:/Users/Florian/workspace/ScenarioTools-OCL/org.xtext.example.extendingOCL/'
179  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.extendingOCL.ide at 'file:/C:/Users/Florian/workspace/ScenarioTools-OCL/org.xtext.example.extendingOCL.ide/'
180  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.extendingOCL.ui at 'file:/C:/Users/Florian/workspace/ScenarioTools-OCL/org.xtext.example.extendingOCL.ui/'
192  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Using resourceSet registry. The registered Packages will not be registered in the global EPackage.Registry.INSTANCE!
768  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
774  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
786  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
786  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
949  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/ocl/2015/EssentialOCLCS' from 'platform:/resource/org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.genmodel'
949  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/ocl/2015/BaseCS' from 'platform:/resource/org.eclipse.ocl.xtext.base/model/BaseCS.genmodel'
949  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/ocl/2015/Pivot' from 'platform:/resource/org.eclipse.ocl.pivot/model/Pivot.genmodel'
950  [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.eclipse.org/emf/2002/Ecore' from 'platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel'
1907 [main] INFO  text.xtext.generator.XtextGenerator  - Generating org.xtext.example.extendingOCL.EOCL
6963 [main] INFO  nerator.ecore.EMFGeneratorFragment2  - Generating EMF model code
7030 [main] INFO  clipse.emf.mwe.utils.GenModelHelper  - Registered GenModel 'http://www.xtext.org/example/extendingOCL/EOCL' from 'platform:/resource/org.xtext.example.extendingOCL/model/generated/EOCL.genmodel'
18939 [main] INFO  text.xtext.generator.XtextGenerator  - Generating common infrastructure
19866 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems running workflow org.xtext.example.extendingOCL.GenerateEOCL: 
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
	 org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@29f58b44 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6ef7623 (name: EReference) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/org.xtext.example.extendingOCL/model/generated/EOCL.genmodel, 10, 132)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
	at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:265)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenModelResource(GenModelUtil2.java:201)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenPackage(GenModelUtil2.java:119)
	at org.eclipse.xtext.xtext.generator.model.TypeReference.getQualifiedName(TypeReference.java:236)
	at org.eclipse.xtext.xtext.generator.model.TypeReference.<init>(TypeReference.java:149)
	at org.eclipse.xtext.xtext.generator.model.JavaFileAccess$JavaTypeAwareStringConcatenation.getStringRepresentation(JavaFileAccess.java:73)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:177)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:148)
	at org.eclipse.xtend2.lib.StringConcatenation$SimpleTarget.append(StringConcatenation.java:523)
	at org.eclipse.xtend2.lib.StringConcatenation$IndentedTarget.append(StringConcatenation.java:571)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2$15.appendTo(SerializerFragment2.java:752)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:175)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:148)
	at org.eclipse.xtend2.lib.StringConcatenation$SimpleTarget.append(StringConcatenation.java:523)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2$7.appendTo(SerializerFragment2.java:584)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:129)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:108)
	at org.eclipse.xtext.xtext.generator.model.JavaFileAccess.setContent(JavaFileAccess.java:215)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2.generateAbstractSemanticSequencer(SerializerFragment2.java:621)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2.generate(SerializerFragment2.java:244)
	at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@29f58b44 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6ef7623 (name: EReference) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/org.xtext.example.extendingOCL/model/generated/EOCL.genmodel, 10, 132)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2697)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2682)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:2141)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setValueFromId(XMLHandler.java:2794)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2755)
	at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2229)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFeatureType(XMLHandler.java:2195)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2071)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:151)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1876)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1030)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	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)
	... 32 more
Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to org.eclipse.emf.ecore.EStructuralFeature
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenFeatureImpl.eSet(GenFeatureImpl.java:762)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1204)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2692)
	... 65 more

[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
	 java.lang.ClassCastException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to org.eclipse.emf.ecore.EPackage
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.getEcorePackage(GenPackageImpl.java:1235)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.reconcile(GenPackageImpl.java:4119)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl.reconcile(GenModelImpl.java:9099)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenModelResource(GenModelUtil2.java:211)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenPackage(GenModelUtil2.java:119)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenClassifier(GenModelUtil2.java:45)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getJavaTypeName(GenModelUtil2.java:262)
	at org.eclipse.xtext.xtext.generator.junit.Junit4Fragment2.generateExampleRuntimeTest(Junit4Fragment2.java:164)
	at org.eclipse.xtext.xtext.generator.junit.Junit4Fragment2.generate(Junit4Fragment2.java:131)
	at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

java.lang.RuntimeException: Problems running workflow org.xtext.example.extendingOCL.GenerateEOCL: 
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
	 org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@29f58b44 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6ef7623 (name: EReference) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/org.xtext.example.extendingOCL/model/generated/EOCL.genmodel, 10, 132)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
	at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:265)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenModelResource(GenModelUtil2.java:201)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenPackage(GenModelUtil2.java:119)
	at org.eclipse.xtext.xtext.generator.model.TypeReference.getQualifiedName(TypeReference.java:236)
	at org.eclipse.xtext.xtext.generator.model.TypeReference.<init>(TypeReference.java:149)
	at org.eclipse.xtext.xtext.generator.model.JavaFileAccess$JavaTypeAwareStringConcatenation.getStringRepresentation(JavaFileAccess.java:73)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:177)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:148)
	at org.eclipse.xtend2.lib.StringConcatenation$SimpleTarget.append(StringConcatenation.java:523)
	at org.eclipse.xtend2.lib.StringConcatenation$IndentedTarget.append(StringConcatenation.java:571)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2$15.appendTo(SerializerFragment2.java:752)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:175)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:148)
	at org.eclipse.xtend2.lib.StringConcatenation$SimpleTarget.append(StringConcatenation.java:523)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2$7.appendTo(SerializerFragment2.java:584)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:129)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:108)
	at org.eclipse.xtext.xtext.generator.model.JavaFileAccess.setContent(JavaFileAccess.java:215)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2.generateAbstractSemanticSequencer(SerializerFragment2.java:621)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2.generate(SerializerFragment2.java:244)
	at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@29f58b44 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6ef7623 (name: EReference) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/org.xtext.example.extendingOCL/model/generated/EOCL.genmodel, 10, 132)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2697)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2682)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:2141)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setValueFromId(XMLHandler.java:2794)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2755)
	at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2229)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFeatureType(XMLHandler.java:2195)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2071)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:151)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1876)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1030)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	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)
	... 32 more
Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to org.eclipse.emf.ecore.EStructuralFeature
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenFeatureImpl.eSet(GenFeatureImpl.java:762)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1204)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2692)
	... 65 more

[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
	 java.lang.ClassCastException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to org.eclipse.emf.ecore.EPackage
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.getEcorePackage(GenPackageImpl.java:1235)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.reconcile(GenPackageImpl.java:4119)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl.reconcile(GenModelImpl.java:9099)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenModelResource(GenModelUtil2.java:211)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenPackage(GenModelUtil2.java:119)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenClassifier(GenModelUtil2.java:45)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getJavaTypeName(GenModelUtil2.java:262)
	at org.eclipse.xtext.xtext.generator.junit.Junit4Fragment2.generateExampleRuntimeTest(Junit4Fragment2.java:164)
	at org.eclipse.xtext.xtext.generator.junit.Junit4Fragment2.generate(Junit4Fragment2.java:131)
	at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: java.lang.RuntimeException: 
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
	 org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@29f58b44 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6ef7623 (name: EReference) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/org.xtext.example.extendingOCL/model/generated/EOCL.genmodel, 10, 132)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
	at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:265)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenModelResource(GenModelUtil2.java:201)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenPackage(GenModelUtil2.java:119)
	at org.eclipse.xtext.xtext.generator.model.TypeReference.getQualifiedName(TypeReference.java:236)
	at org.eclipse.xtext.xtext.generator.model.TypeReference.<init>(TypeReference.java:149)
	at org.eclipse.xtext.xtext.generator.model.JavaFileAccess$JavaTypeAwareStringConcatenation.getStringRepresentation(JavaFileAccess.java:73)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:177)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:148)
	at org.eclipse.xtend2.lib.StringConcatenation$SimpleTarget.append(StringConcatenation.java:523)
	at org.eclipse.xtend2.lib.StringConcatenation$IndentedTarget.append(StringConcatenation.java:571)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2$15.appendTo(SerializerFragment2.java:752)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:175)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:148)
	at org.eclipse.xtend2.lib.StringConcatenation$SimpleTarget.append(StringConcatenation.java:523)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2$7.appendTo(SerializerFragment2.java:584)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:129)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:108)
	at org.eclipse.xtext.xtext.generator.model.JavaFileAccess.setContent(JavaFileAccess.java:215)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2.generateAbstractSemanticSequencer(SerializerFragment2.java:621)
	at org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2.generate(SerializerFragment2.java:244)
	at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@29f58b44 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6ef7623 (name: EReference) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/org.xtext.example.extendingOCL/model/generated/EOCL.genmodel, 10, 132)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2697)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2682)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:2141)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setValueFromId(XMLHandler.java:2794)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2755)
	at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2229)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFeatureType(XMLHandler.java:2195)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2071)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:151)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1876)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1030)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	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)
	... 32 more
Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to org.eclipse.emf.ecore.EStructuralFeature
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenFeatureImpl.eSet(GenFeatureImpl.java:762)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1204)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2692)
	... 65 more

[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
	 java.lang.ClassCastException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to org.eclipse.emf.ecore.EPackage
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.getEcorePackage(GenPackageImpl.java:1235)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.reconcile(GenPackageImpl.java:4119)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl.reconcile(GenModelImpl.java:9099)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenModelResource(GenModelUtil2.java:211)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenPackage(GenModelUtil2.java:119)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenClassifier(GenModelUtil2.java:45)
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getJavaTypeName(GenModelUtil2.java:262)
	at org.eclipse.xtext.xtext.generator.junit.Junit4Fragment2.generateExampleRuntimeTest(Junit4Fragment2.java:164)
	at org.eclipse.xtext.xtext.generator.junit.Junit4Fragment2.generate(Junit4Fragment2.java:131)
	at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.handleIssues(Mwe2Bridge.java:56)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:48)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	... 4 more
Re: IllegalValueException when extending EssentialOCL [message #1733937 is a reply to message #1733934] Thu, 02 June 2016 10:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13709
Registered: July 2009
Senior Member
in xtext 2.10.0 you no longer need the referencedResource = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"

without this the wf works fine for me


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: IllegalValueException when extending EssentialOCL [message #1733943 is a reply to message #1733937] Thu, 02 June 2016 11:09 Go to previous messageGo to next message
Florian König is currently offline Florian KönigFriend
Messages: 30
Registered: June 2014
Member
Ok I have Xtext 2.9 and deleting this line does not help. I will install Xtext 2.10 now and try that again.
Re: IllegalValueException when extending EssentialOCL [message #1733951 is a reply to message #1733943] Thu, 02 June 2016 11:58 Go to previous messageGo to next message
Florian König is currently offline Florian KönigFriend
Messages: 30
Registered: June 2014
Member
Thank you Christian! With Xtext 2.10 I can generate the grammar.

I fixed some errors in the generated code (EssentialOCLValidator -> EssentialOCLJavaValidator).
But in the EOCLSemanticSequencer I have many errors I don't know how to fix. Diving into the class hierarchy, the OCL sequencer seems to be using deprecated methods that use other parameters (EObject instead of ISerializationContext). So the context variable does not fit. Can I just cast every occurrence of the context variable into EObject or is there a better fix?
Re: IllegalValueException when extending EssentialOCL [message #1733952 is a reply to message #1733951] Thu, 02 June 2016 12:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13709
Registered: July 2009
Senior Member
looks like your supergrammar is still xtext 2.8

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: IllegalValueException when extending EssentialOCL [message #1733953 is a reply to message #1733951] Thu, 02 June 2016 12:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6985
Registered: July 2009
Senior Member
Hi

Xtext 2.9 changed the generated API.

Since OCL provides better backward compatibility than Xtext, the OCL
tooling is generated with Xtext 2.8.4 in order to use an API that is
compatible across Luna, Mars and Neon.

Regards

Ed Willink


On 02/06/2016 12:58, Florian König wrote:
> Thank you Christian! With Xtext 2.10 I can generate the grammar.
>
> I fixed some errors in the generated code (EssentialOCLValidator ->
> EssentialOCLJavaValidator).
> But in the EOCLSemanticSequencer I have many errors I don't know how to
> fix. Diving into the class hierarchy, the OCL sequencer seems to be
> using deprecated methods that use other parameters (EObject instead of
> ISerializationContext). So the context variable does not fit. Can I just
> cast every occurrence of the context variable into EObject or is there a
> better fix?
Re: IllegalValueException when extending EssentialOCL [message #1733954 is a reply to message #1733953] Thu, 02 June 2016 12:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6985
Registered: July 2009
Senior Member
Hi

https://bugs.eclipse.org/bugs/show_bug.cgi?id=481865

Ed

On 02/06/2016 13:17, Ed Willink wrote:
> Hi
>
> Xtext 2.9 changed the generated API.
>
> Since OCL provides better backward compatibility than Xtext, the OCL
> tooling is generated with Xtext 2.8.4 in order to use an API that is
> compatible across Luna, Mars and Neon.
>
> Regards
>
> Ed Willink
>
>
> On 02/06/2016 12:58, Florian König wrote:
>> Thank you Christian! With Xtext 2.10 I can generate the grammar.
>>
>> I fixed some errors in the generated code (EssentialOCLValidator ->
>> EssentialOCLJavaValidator).
>> But in the EOCLSemanticSequencer I have many errors I don't know how to
>> fix. Diving into the class hierarchy, the OCL sequencer seems to be
>> using deprecated methods that use other parameters (EObject instead of
>> ISerializationContext). So the context variable does not fit. Can I just
>> cast every occurrence of the context variable into EObject or is there a
>> better fix?
>
Re: IllegalValueException when extending EssentialOCL [message #1734220 is a reply to message #1733954] Mon, 06 June 2016 10:44 Go to previous messageGo to next message
Florian König is currently offline Florian KönigFriend
Messages: 30
Registered: June 2014
Member
Ok I am a little confused now.
So do I understand correctly? In order to fix this sequencer issue, I have to change something in the OCL plugin?
So there is no way to simply extend the OCL plugin as it is?

Or do I overlook something?
Re: IllegalValueException when extending EssentialOCL [message #1734221 is a reply to message #1734220] Mon, 06 June 2016 10:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13709
Registered: July 2009
Senior Member
if you use xtext <=284 you are fine

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: IllegalValueException when extending EssentialOCL [message #1734436 is a reply to message #1734221] Wed, 08 June 2016 11:30 Go to previous messageGo to next message
Florian König is currently offline Florian KönigFriend
Messages: 30
Registered: June 2014
Member
Ok I will try that out. Thanks for your help.
Is there anything important in Xtext that we lose by downgrading our project from Xtext 2.9 to 2.8.4?
Re: IllegalValueException when extending EssentialOCL [message #1734437 is a reply to message #1734436] Wed, 08 June 2016 11:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13709
Registered: July 2009
Senior Member
well the actual release is 2.10 so you are missing a ton of other bugfixes and changes, especially the "new" xtext generator

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: IllegalValueException when extending EssentialOCL [message #1734450 is a reply to message #1734436] Wed, 08 June 2016 13:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6985
Registered: July 2009
Senior Member
Hi

I took another stab at creating a Luna/Mars/Neon OCL grammar build and
seemed to be able to solve the serializer incompatibility that shows up
as compilation errors for you.

But there is a much more insidious incompatibility in Xtext 2.9. Rule
names acquire grammar-id qualification, so GrammarUtil.findRule fails to
find anything. As a static routine, findRule is hard to retrofit.
Conversely changing the newer Xtext to tolerate unqualified rule names
would probably ripple badly.

This is probably more of a pain for you than me so I am trying hard to
find a solution. It is very disappointing that Xtext introduced such a
crippling incompatibility and I fail to understand why there was no
accompanying major version change. (A major version change wouldn't
solve the priblems but it would signal the break to everyone.)

Perhaps this forces OCL to start providing 7.0 development builds very
soon and thereby signal the major incompatibility from the Xtext 'major'
change. Maybe a 6.2 will do; use 6.1 for Luna/Mars/Neon,
6.2 for Neon/Oxygen.

Regards

Ed Willink




On 08/06/2016 12:30, Florian König wrote:
> Ok I will try that out. Thanks for your help.
> Is there anything important in Xtext that we lose by downgrading our
> project from Xtext 2.9 to 2.8.4?
Re: IllegalValueException when extending EssentialOCL [message #1734451 is a reply to message #1734450] Wed, 08 June 2016 13:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13709
Registered: July 2009
Senior Member
HI Ed,

can you give some hints about the findRuleForName problem.
as far as i understand it can handle qualified and unqualified rule names


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: IllegalValueException when extending EssentialOCL [message #1734454 is a reply to message #1734451] Wed, 08 June 2016 13:24 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6985
Registered: July 2009
Senior Member
Hi

The problem is that an Xtext 2.10 grammar provides qualified names to an
Xtext < 2.9 run-time that does not understand them. It is not possible
to change the old run-time so all new code needs to pass unqualifued
names for semantic compatibility.

Regards

Ed Willink

On 08/06/2016 14:19, Christian Dietrich wrote:
> HI Ed,
>
> can you give some hints about the findRuleForName problem.
> as far as i understand it can handle qualified and unqualified rule names
Re: IllegalValueException when extending EssentialOCL [message #1734455 is a reply to message #1734454] Wed, 08 June 2016 13:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13709
Registered: July 2009
Senior Member
so you want to generate a grammar with xtext 2.10 and run it with 2.8 right?
or you want to be able to subclass a "binary" 2.8 grammar with a 2.10 subgrammar


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: IllegalValueException when extending EssentialOCL [message #1734458 is a reply to message #1734455] Wed, 08 June 2016 13:37 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6985
Registered: July 2009
Senior Member
Hi

Both.

The OCL distribution is installable on Luna, Mars, Neon, therefore it
must run with 2.8.

(The move to Java 8 lost Indigo/Juno installability.)

Distributions should in principle be build with current tools so it
should be possible to build a 2.8 run-time editor with a 2.10 Xtext. It
isn't. Using Xtext 2.8.4 for editor generation is a tedious workaround
that developers can use. cf. EMF generation that supports 2.7 through
2.12 run-times.

Since Xtext forces the use of legacy generator tooling it then creates a
problem for users who want to subclass. They too must use Xtext 2.8.4
for editor generation. Not really acceptable for the user who started
this thread.

Regards

Ed Willink



On 08/06/2016 14:29, Christian Dietrich wrote:
> so you want to generate a grammar with xtext 2.10 and run it with 2.8
> right?
> or you want to be able to subclass a "binary" 2.8 grammar with a 2.10
> subgrammar
Re: IllegalValueException when extending EssentialOCL [message #1734467 is a reply to message #1734450] Wed, 08 June 2016 14:30 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6985
Registered: July 2009
Senior Member
Hi

On 08/06/2016 14:07, Ed Willink wrote:
> Perhaps this forces OCL to start providing 7.0 development builds very
> soon and thereby signal the major incompatibility from the Xtext 'major'
> change. Maybe a 6.2 will do; use 6.1 for Luna/Mars/Neon,
> 6.2 for Neon/Oxygen.

An OCL 6.2 re-build using Xtext 2.10 is available at

https://hudson.eclipse.org/ocl/job/buckminster-ocl-branch-tests/lastSuccessfulBuild/artifact/MDT-OCL.downloads/mdt-ocl-Update-201606080958.zip

and at ewillink/495691 in the OCL GIT.

It will take a few weeks for this to ripple all the way through the
system to become a formal build, but hopefully it helps you out for now.

Regards

Ed Willink
Re: IllegalValueException when extending EssentialOCL [message #1736324 is a reply to message #1734467] Tue, 28 June 2016 12:29 Go to previous messageGo to next message
Florian König is currently offline Florian KönigFriend
Messages: 30
Registered: June 2014
Member
Thanks Ed,

With your build I can generate my DSL without errors!

By formal build you mean an update of the official update sites?
So what do you think, when will the OCL plugins be compatible with the newest Xtext version again?
Re: IllegalValueException when extending EssentialOCL [message #1736338 is a reply to message #1736324] Tue, 28 June 2016 13:50 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6985
Registered: July 2009
Senior Member
Hi

The OCL GIT master branch for 6.3.0 and the 6.2.0RC1 tag require/support
Xtext 2.10 now.

6.2.0RC1 is downloadable now from:
http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/downloads/drops/6.2.0/S201606131221/mdt-ocl-Update-6.2.0RC1.zip

6.2.0 is scheduled for release on 24th July 2016.

6.2.0 will be available from
http://download.eclipse.org/modeling/mdt/ocl/updates/releases/6.2.0

But 6.1.0, 6.1.1, 6.1.2 are/will be the Neon.0, Neon.1, Neon.2 release
and so I doubt that 6.2.0 will be available from
http://download.eclipse.org/modeling/mdt/ocl/updates/releases till after
Oxygen and 6.3.0.

Has anyone any experience of making two releases available concurrently
(6.1.x and 6.2.x)?

Regards

Ed Willink

On 28/06/2016 13:29, Florian König wrote:
> Thanks Ed,
>
> With your build I can generate my DSL without errors!
>
> By formal build you mean an update of the official update sites?
> So what do you think, when will the OCL plugins be compatible with the
> newest Xtext version again?
Previous Topic:Xtext grammar
Next Topic:No operations in Xexpressionorvardeclaration
Goto Forum:
  


Current Time: Wed Jan 20 04:41:43 GMT 2021

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

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

Back to the top