Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Null-Pointer-Exception in EMFGeneratorFragment(GenModel Proxy object resolution fails. Is this a bug in EMF code?)
Null-Pointer-Exception in EMFGeneratorFragment [message #1265856] Thu, 06 March 2014 16:50 Go to next message
Reiner Jung is currently offline Reiner JungFriend
Messages: 9
Registered: June 2010
Location: Uni Kiel
Junior Member
Hi folks,

presently, or more precise for days, a NullPointerException in a MWE2 workflow is bugging me. It is originating in the EMFGeneratorFragment.

I am trying to fix this issue now for a couple of days and I cannot find a solution. This problem looks similar to http://www.eclipse.org/forums/index.php/t/457644/. However, the proposed solution of modifying the ecore model is not feasible and the uri mapping option is already in place.

The setup is as follows: I have, for test purposes, made a very small language PCMXtext which includes a reference to a Palladio component model (PCM) node.

Object:
	'obj' name=ID 
	reference=[repository::BasicComponent] 
	';'
;


The repository meta-model is imported with

import "http //sdq.ipd.uka.de/PalladioComponentModel/Repository/5.0" as repository

(The missing : in the URI is not an error, but a method circumvent the forums ill assumption that I want to post an URL to some external website. The real code includes that colon.)

During the MWE2 workflow a lot of GenModels are registered and it all looks fine. However, during EMFGeneratorFragment execution, the whole thing comes apart with a NullPointerException

at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.hasExtendedMetaData(GenPackageImpl.java:4404)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.initialize(GenPackageImpl.java:2815)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl.initialize(GenModelImpl.java:2386)
	at org.eclipse.xtext.generator.ecore.EMFGeneratorFragment.getSaveAndReconcileGenModel(EMFGeneratorFragment.java:713)
	at org.eclipse.xtext.generator.ecore.EMFGeneratorFragment.generate(EMFGeneratorFragment.java:234)
	at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:92)
	at org.eclipse.xtext.generator.LanguageConfig.generate(LanguageConfig.java:113)
	at org.eclipse.xtext.generator.Generator.generate(Generator.java:366)
	at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:132)
	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:74)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)


I looks like, a proxy object is not resolved properly and a null pointer is returned instead. However, I could be wrong, as the debugging is a really cumbersome process due to the large number of involved references.

I have attached the workflow, the grammar, the console.log, and the present MANIFEST.MF. There might be more packages listed than necessary in the MANIFEST due to my "fixing" efforts.

Any ideas and suggestions to solve this issue are welcome.

Thanks
Reiner
Re: Null-Pointer-Exception in EMFGeneratorFragment [message #1265870 is a reply to message #1265856] Thu, 06 March 2014 17:17 Go to previous message
Reiner Jung is currently offline Reiner JungFriend
Messages: 9
Registered: June 2010
Location: Uni Kiel
Junior Member
I've create a small example project which produces the described problem. Presently, I use Eclipse Kepler (build id 20130919-0819), Xtext 2.5.0 and Palladio 3.4.1 on a Linux machine (Ubuntu 13.10) with Java 1.7

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Previous Topic:Problem with automatic update of a P2 repository
Next Topic:XtextResourceSetProvider problems in junit
Goto Forum:
  


Current Time: Thu Oct 29 14:05:54 GMT 2020

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