Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Feature xyz must be set
Feature xyz must be set [message #776752] Mon, 09 January 2012 03:16 Go to next message
Yves Weissig is currently offline Yves Weissig
Messages: 9
Registered: January 2012
Junior Member
Hi,

I'm running in a problem when using ETL, I don't know where it origins, maybe someone of you has a hint?
Im executing a standalone ETL transformation. I'm trying to save my target model, I've set:
emfModelTarget.setStoredOnDisposal(true);

When I invoke the module via
module.execute();
module.getContext().getModelRepository().dispose();
it crashes with:
org.eclipse.xtext.validation.IConcreteSyntaxValidator$InvalidConcreteSyntaxException: These errors need to be fixed before the model can be serialized.
Model: Feature Model.document must be set.

(why in org.eclipse.xtext.validation? where does this come from?).
So I don't know why that happens because in my .etl I'm pretty sure I'm setting this feature:
rule Model2Model
transform m : Source!Model
to m : Target!Model {
	("Transforming a Model to a Model").println();	
	var neet := new Target!NonEmptyElementTag;
	var stag := new Target!STag;
	stag.name := "span";
	neet.stag := stag;
	var etag := new Target!ETag;
	etag.name := "span";
	neet.etag := etag;
	m.document = neet;
}

Any guesses? What could be the problem?
Best regards
Yves
Re: Feature xyz must be set [message #776757 is a reply to message #776752] Mon, 09 January 2012 03:26 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 804
Registered: July 2009
Senior Member
Hi Yves,

At a first glance, both the input and the output parameters of your transformation rule appear to be named "m". Could you perhaps try changing this and giving it another go? If this still fails, please put together a minimal configuration that we can use to reproduce this and send it to us at epsilon.devs gmail com.

http://eclipse.org/gmt/epsilon/doc/articles/minimal-examples/

Cheers,
Dimitris
Re: Feature xyz must be set [message #776804 is a reply to message #776757] Mon, 09 January 2012 04:51 Go to previous messageGo to next message
Yves Weissig is currently offline Yves Weissig
Messages: 9
Registered: January 2012
Junior Member
Hi,
thanks for the quick reply.
I had no success renaming the target model to a unique name, still the same exception.
Attached my minimal example, somehow with this setup the target model is empty.
You can see my standalone setup here: pastebin.com/kW3wv8sB
Is there anything else I can try?
Best regards
Yves
Re: Feature xyz must be set [message #776806 is a reply to message #776804] Mon, 09 January 2012 04:51 Go to previous messageGo to next message
Yves Weissig is currently offline Yves Weissig
Messages: 9
Registered: January 2012
Junior Member
My Epsilon version is:
Epsilon Core (Incubation)	0.9.1.201107251201	org.eclipse.epsilon.feature.feature.group	Eclipse.org
Re: Feature xyz must be set [message #778330 is a reply to message #776806] Thu, 12 January 2012 07:14 Go to previous messageGo to next message
Yves Weissig is currently offline Yves Weissig
Messages: 9
Registered: January 2012
Junior Member
I've sent you an e-mail with a description of the problem, did you receive it?
Best regards
Yves
Re: Feature xyz must be set [message #778367 is a reply to message #778330] Thu, 12 January 2012 10:55 Go to previous messageGo to next message
Yves Weissig is currently offline Yves Weissig
Messages: 9
Registered: January 2012
Junior Member
Now this problem is solved, I had to set the source model to
emfModelSource.setStoredOnDisposal(false);

Now a new exception is kicking in:
java.lang.RuntimeException: The context 'Model' is not valid for type 'Model'
Recommended contexts for type 'Model': 
The context 'Model' is valid for types: Model

Semantic Object: Model
	at org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic$ExceptionThrowingAcceptor.accept(ISerializationDiagnostic.java:70)
	at org.x.html.serializer.AbstractHTMLLanguageSemanticSequencer.createSequence(AbstractHTMLLanguageSemanticSequencer.java:101)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:84)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:103)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:125)
	at org.eclipse.xtext.resource.XtextResource.doSave(XtextResource.java:313)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1423)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:992)
	at org.eclipse.epsilon.emc.emf.EmfModel.store(EmfModel.java:269)
	at org.eclipse.epsilon.eol.models.Model.dispose(Model.java:160)
	at org.eclipse.epsilon.eol.models.CachedModel.dispose(CachedModel.java:158)
	at org.eclipse.epsilon.eol.models.ModelRepository.dispose(ModelRepository.java:170)
	at RTF2HTMLTransformerTestEpsilon.transform(RTF2HTMLTransformerTestEpsilon.java:144)
	at RTF2HTMLTransformerTestEpsilon.invoke(RTF2HTMLTransformerTestEpsilon.java:159)
	at RTF2HTMLTransformerTest.test(RTF2HTMLTransformerTest.java:38)
	at RTF2HTMLTransformerTest.testItalicText(RTF2HTMLTransformerTest.java:61)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Is it correct for Xtext to serialize the model? The transformation is working in a different standalone setup. Any ideas what could be wrong?
Re: Feature xyz must be set [message #778380 is a reply to message #778367] Thu, 12 January 2012 11:51 Go to previous messageGo to next message
Yves Weissig is currently offline Yves Weissig
Messages: 9
Registered: January 2012
Junior Member
I accidentally named the output model with an extension of ".html" instead of ".xmi", this made Xtext treat it and serialize it. Case closed. Thanks for the help.
Re: Feature xyz must be set [message #778618 is a reply to message #778380] Fri, 13 January 2012 09:20 Go to previous message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 804
Registered: July 2009
Senior Member
Hi Yves,

Apologies for not being very responsive on this. Glad you got it working!

Cheers,
Dimitris
Previous Topic:Bug in org.eclipse.epsilon.emc.emf
Next Topic:[eol][evl]Handling exception in casting types
Goto Forum:
  


Current Time: Sat Aug 02 00:37:58 EDT 2014

Powered by FUDForum. Page generated in 0.03447 seconds