Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Reference to external project
Reference to external project [message #893485] Wed, 04 July 2012 10:37 Go to next message
Marco Tinacci is currently offline Marco TinacciFriend
Messages: 4
Registered: May 2012
Junior Member
I need to use classes from an external java project in my xtext project. I have added the project to the build path but the eclipse application has problems with showing the code of files of my language: it shows instead a white frame and a nullPointerException. That happens if and only if I use a class from an external project.
Can anyone help me, please?
Re: Reference to external project [message #893586 is a reply to message #893485] Wed, 04 July 2012 17:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

can you elaborate what you are doing? what step do i have to do the reproduce the problem

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Reference to external project [message #893834 is a reply to message #893586] Thu, 05 July 2012 15:48 Go to previous messageGo to next message
Marco Tinacci is currently offline Marco TinacciFriend
Messages: 4
Registered: May 2012
Junior Member
Hi Christian, I'll try to give you a minimal example of my case:
create a Greetings Xtext project and, after the generation of the artifacts, implement the generator class as follow
override void doGenerate(Resource resource, IFileSystemAccess fsa) {
	Example::printHello
}

where Example is a simple class in another project that has been added to the project references.
package example;
public class Example {
	public static void printHello(){
		System.out.println("Hello World!");
	}
}

When I launch the Eclipse instance I get the error when I save a mydsl file without syntax errors:
Errors occurred during the build.
Errors running builder 'Xtext Project Builder' on project 'example'.
example/Example

and of course it doesn't print "Hello World!" on the console.

The problem is not exactly what I get on my real project and I haven't figured out how to reproduce it yet but I think that this case is somehow related.
Re: Reference to external project [message #893836 is a reply to message #893834] Thu, 05 July 2012 15:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi please make sure you reference the other project with osgi/eclipse
plugin means. Don't use project references

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Reference to external project [message #893985 is a reply to message #893485] Fri, 06 July 2012 10:37 Go to previous message
Marco Tinacci is currently offline Marco TinacciFriend
Messages: 4
Registered: May 2012
Junior Member
Ok, I'll try this way. Thanks for the help Smile

[Updated on: Fri, 06 July 2012 10:38]

Report message to a moderator

Previous Topic:How to create Editors for sychronize GMF and Xtext
Next Topic:IJvmModelInferrer and Generation of Java files outside of Eclipse model project
Goto Forum:
  


Current Time: Thu Apr 25 01:19:56 GMT 2024

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

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

Back to the top