Skip to main content



      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 04:57 Go to next message
Eclipse UserFriend
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 04:10 Go to previous messageGo to next message
Eclipse UserFriend
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] Fri, 19 March 2010 20:04 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 08:17:23 EDT 2025

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

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

Back to the top