Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [Xtend] what does this mean? EvaluationException : null
[Xtend] what does this mean? EvaluationException : null [message #521591] Thu, 18 March 2010 08:57 Go to next message
Tilo Thiele is currently offline Tilo ThieleFriend
Messages: 14
Registered: March 2010
Junior Member
Following Karstens advice, I tried out Xtend to do m2m transformation. But with just a trivial rule I only get this message:

INFO: XtendComponent: executing 'template::Trafo'
18.03.2010 09:16:18 org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent invokeInternal
SCHWERWIEGEND: Error in Component  of type org.eclipse.xtend.XtendComponent: 
	EvaluationException : null
	template::Trafo.ext[96,18] on line 6 'rv.setName(m.name)'
	nofile[0,16] on line 1 'transform(model)'                



While this is my Trafo.ext:

import de::ems::mm;

create EmsModel transform(uml::Model m) :
	let rv = new EmsModel :
		rv.setName(m.name) ->
		rv
;


While this is my workflow:

<workflow>
	<property name="model" value="AppGeneratorModel/src/metamodel/ReferenzModel.uml" />
	<property name="src-gen" value="src-gen" />
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
		<platformUri value=".."/>
	</bean>
  <bean class="org.eclipse.xtend.typesystem.uml2.Setup" standardUML2Setup="true" />
	<bean id="mm_profile" class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
		<profile value="src/metamodel/EmsApplicationProfile.profile.uml"/>
	</bean>
	<!-- load model and store it in slot 'model' -->
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="platform:/resource/${model}" />
		<modelSlot value="model" />
	</component>
...
	<component class="org.eclipse.xtend.XtendComponent">
		<metaModel idRef="mm_profile"/>
		<metaModel id="mm_java" class="org.eclipse.internal.xtend.type.impl.java.JavaMetaModel"/>
		<invoke value="template::Trafo::transform(model)"/>
		<outputSlot value="transformedModel"/>
	</component>
...
</workflow>


BTW. JavaBean, EMF and UML Meta model ist activated.

any hints are appreciated.
Re: [Xtend] what does this mean? EvaluationException : null [message #521897 is a reply to message #521591] Fri, 19 March 2010 08:10 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3101
Registered: July 2009
Senior Member
Hi Tilo,

this indicates a NullPointerException. You could try to tackle it with
Xpand 1.0.0M6 - the error reporting was improved in this version.
Another option is to use an exception breakpoint for EvaluationException.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 18.03.10 09:57, schrieb Tilo:
> Following Karstens advice, I tried out Xtend to do m2m transformation.
> But with just a trivial rule I only get this message:
>
>
> INFO: XtendComponent: executing 'template::Trafo'
> 18.03.2010 09:16:18
> org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflo wComponent
> invokeInternal
> SCHWERWIEGEND: Error in Component of type
> org.eclipse.xtend.XtendComponent: EvaluationException : null
> template::Trafo.ext[96,18] on line 6 'rv.setName(m.name)'
> nofile[0,16] on line 1 'transform(model)'
>
>
> While this is my Trafo.ext:
>
>
> import de::ems::mm;
>
> create EmsModel transform(uml::Model m) :
> let rv = new EmsModel :
> rv.setName(m.name) ->
> rv
> ;
>
>
> While this is my workflow:
>
>
> <workflow>
> <property name="model"
> value="AppGeneratorModel/src/metamodel/ReferenzModel.uml" />
> <property name="src-gen" value="src-gen" />
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
> <platformUri value=".."/>
> </bean>
> <bean class="org.eclipse.xtend.typesystem.uml2.Setup"
> standardUML2Setup="true" />
> <bean id="mm_profile"
> class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel ">
> <profile value="src/metamodel/EmsApplicationProfile.profile.uml"/>
> </bean>
> <!-- load model and store it in slot 'model' -->
> <component class="org.eclipse.emf.mwe.utils.Reader">
> <uri value="platform:/resource/${model}" />
> <modelSlot value="model" />
> </component>
> ...
> <component class="org.eclipse.xtend.XtendComponent">
> <metaModel idRef="mm_profile"/>
> <metaModel id="mm_java"
> class="org.eclipse.internal.xtend.type.impl.java.JavaMetaModel "/>
> <invoke value="template::Trafo::transform(model)"/>
> <outputSlot value="transformedModel"/>
> </component>
> ...
> </workflow>
>
>
> BTW. JavaBean, EMF and UML Meta model ist activated.
>
> any hints are appreciated.
>
Re: [Xtend] what does this mean? EvaluationException : null [message #522100 is a reply to message #521897] Sat, 20 March 2010 00:04 Go to previous message
Tilo Thiele is currently offline Tilo ThieleFriend
Messages: 14
Registered: March 2010
Junior Member
Sebastian,
oh - great. Exception Breakpoint was a good hint. I didn't know it yet. It shows a NPE in my code right here:

public int hashCode() {
	return name.hashCode();
}


but that is invoked before - or during - this line is executed

		rv.setName(m.name) ->


so changing my hashCode() algorithm to

public int hashCode() {
	return name==null ? 0 : name.hashCode();
}


is the ulimate pain reliever here. Now I can make a little pace forward. Thanks
/Tilo
Previous Topic:[ATL] File Path Problem
Next Topic:[ATL] Calling Java from ATL possible?
Goto Forum:
  


Current Time: Thu Oct 24 04:05:03 GMT 2019

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

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

Back to the top