Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [XPand] java.lang.InstantiationException when running
[XPand] java.lang.InstantiationException when running [message #499210] Fri, 20 November 2009 12:51 Go to next message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
Hello,

I am a new XPand user, and when generating some code, I had some struggles. What am I doing wrong? I changed the dependencies and namespaces correctly...

I get the following error when running the transformation, which is a very simple transformation, Hello World like:
INFO: Registering platform uri '/Users/marten/Work/EclipseWorkspaces'
Nov 20, 2009 1:12:20 PM org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator createBean
SEVERE: org.eclipse.xtend.typesystem.MetaModel
java.lang.InstantiationException: org.eclipse.xtend.typesystem.MetaModel
	at java.lang.Class.newInstance0(Class.java:340)
	at java.lang.Class.newInstance(Class.java:308)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.createBean(VisitorCreator.java:135)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.visitComponentAST(VisitorCreator.java:116)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorBase.visit(VisitorBase.java:37)
	at org.eclipse.emf.mwe.internal.core.ast.AbstractASTBase.accept(AbstractASTBase.java:44)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.createBean(VisitorCreator.java:155)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.visitComponentAST(VisitorCreator.java:116)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorBase.visit(VisitorBase.java:37)
	at org.eclipse.emf.mwe.internal.core.ast.AbstractASTBase.accept(AbstractASTBase.java:44)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.createBean(VisitorCreator.java:155)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.visitComponentAST(VisitorCreator.java:116)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorBase.visit(VisitorBase.java:37)
	at org.eclipse.emf.mwe.internal.core.ast.AbstractASTBase.accept(AbstractASTBase.java:44)
	at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.parseInitAndCreate(WorkflowFactory.java:72)
	at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.parseInitAndCreate(WorkflowFactory.java:51)
	at org.eclipse.emf.mwe.core.WorkflowRunner.prepare(WorkflowRunner.java:331)
	at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.java:289)
	at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner.java:239)
Nov 20, 2009 1:12:20 PM org.eclipse.emf.mwe.core.WorkflowRunner logIssues
SEVERE: [ERROR]: Error creating instance of type 'null' : org.eclipse.xtend.typesystem.MetaModel(Element: bean metaModel id='mm' in /Users/marten/Work/EclipseWorkspaces/gwtCode.generator.project/src/workflow/generator.mwe:24; Reported by: -UNKNOWN-)
Nov 20, 2009 1:12:20 PM org.eclipse.emf.mwe.core.WorkflowRunner prepare
SEVERE: Workflow interrupted because of configuration errors.




My manifest.MF is as follows
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: gwtCode.generator.project
Bundle-SymbolicName: gwtCode.generator.project; singleton:=true
Bundle-Version: 1.0.0
Require-Bundle: org.eclipse.xpand,
 org.eclipse.xtend,
 org.eclipse.emf.mwe.utils;bundle-version="0.7.1",
 org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
 org.eclipse.jface.text;bundle-version="3.5.0",
 org.antlr.runtime;bundle-version="3.0.0",
 com.ibm.icu;bundle-version="4.0.1",
 org.eclipse.core.runtime;bundle-version="3.5.0",
 org.eclipse.jdt.core;bundle-version="3.5.0
Bundle-RequiredExecutionEnvironment: J2SE-1.5


My generator.mwe is as follows (i out-commented the check model component, is this required? Without comments it gives some class not found exception (cannot find org.eclipse.xtend.typesystememf.EmfRegistryMetaModel):
<?xml version="1.0"?>
<workflow>
	<property name="model" value="gwtCode.generator.project/src/PersonsMVC.ecore" />
	<property name="src-gen" value="src-gen" />
	
	<!-- set up EMF for standalone execution -->
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
		<platformUri value=".."/>
	</bean>

	<!-- load model and store it in slot 'model' -->
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="platform:/resource/${model}" />
		<firstElementOnly value="false" />
		<modelSlot value="model" />
	</component>
	<!-- check model -->
	<!-- <component class="org.eclipse.xtend.check.CheckComponent"> -->
	<!-- <metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/> -->
	<!-- <checkFile value="metamodel::Checks"/> -->
	<!-- <emfAllChildrenSlot value="model"/> -->
	<!-- </component> -->
	<!--  generate code -->
	<component class="org.eclipse.xpand2.Generator">
		<metaModel id="mm" />
		<expand	value="template::MVCTemplate::main FOR model" />
		<outlet path="${src-gen}" >
			<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
		</outlet>
	</component>
</workflow>




My company: Sytematic, building business software from models.
Re: [XPand] java.lang.InstantiationException when running [message #499241 is a reply to message #499210] Fri, 20 November 2009 14:32 Go to previous message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
alright, i fixed it. nevermind.

the class="" should be in the <metaModel> tag of the Generator component. Also, i missed a reference in the manifest.



My company: Sytematic, building business software from models.
Previous Topic:[XPAND/MWE] MetamodelContributor oAW4 -> oAW5
Next Topic:[Xpand] Error: XMLFeatureMap is not responsible for java type org.eclipse.emf.ecore.util.FeatureMap$
Goto Forum:
  


Current Time: Sat Oct 12 17:05:00 GMT 2024

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

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

Back to the top