Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with XtextLinkingDiagnostic
Problem with XtextLinkingDiagnostic [message #882975] Thu, 07 June 2012 15:09 Go to next message
kon f is currently offline kon fFriend
Messages: 152
Registered: March 2012
Senior Member

I would like to perform the generation process without need of starting an Eclipse instance. It just takes to much time and I'm currently working only on the generation process. The process works fine if I just use one Resource for generation.

If I have two Resources that contain references to each other, the validation results in the following error :

XtextLinkingDiagnostic: null:51 Couldn't resolve reference to SubProduct 'productNameXYZ'.

Here is the extracted part of my GenerationClass:

private Provider<ResourceSet> resourceSetProvider;

private IResourceValidator validator;

private IGenerator generator;

private JavaIoFileSystemAccess fileAccess;

public static void main(String[] args) {
    if (args.length == 0) {
	System.err.println("Aborting: no path to EMF resource provided!");
    Injector injector = new org.product.ProductStandaloneSetupGenerated()
    ProductGeneratorRunner main = injector

public List<Issue> runGenerator(String[] paths) {
	// load the resource
	ResourceSet set = resourceSetProvider.get();

	List<Resource> resources = new ArrayList<Resource>();

	for (String path : paths) {
		Resource resource = set.getResource(URI.createURI(path), true);

	for (Resource resource : resources) {
		List<Issue> issues = validator.validate(resource, CheckMode.ALL,
		if (!issues.isEmpty()) {
			for (Issue issue : issues) {
			return issues;
		generator.doGenerate(resource, fileAccess);

	System.out.println("Code generation finished.");

	return null;

Somehow is Xtext aware of the referenced file if I execute the generation process with an Eclipse instance. How can I resolve this issue? Thank you.

Re: Problem with XtextLinkingDiagnostic [message #883000 is a reply to message #882975] Thu, 07 June 2012 16:02 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13669
Registered: July 2009
Senior Member

i cannot reproduce this problem. please note: in standalone mode you have to add all involved resource to the resourceset.
so are you sure you added the file containing productNameXYZ to the resourceset?


Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:Ecore Modell from extisting Grammar
Next Topic:How to support implicit imports?
Goto Forum:

Current Time: Sat Dec 05 00:20:21 GMT 2020

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

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

Back to the top