Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problems with Xtext and XBase in version 2.8.0.v201503090534(Xtext and XBase compilation errors)
Problems with Xtext and XBase in version 2.8.0.v201503090534 [message #1666026] Wed, 11 March 2015 14:02 Go to next message
Som 2015 is currently offline Som 2015Friend
Messages: 16
Registered: March 2015
Junior Member
Hello,

I am trying to develop a DSL using Xtext and Xbase. I would like to include some Java-like statements in my DSL. However, it seems that existing examples and tutorials do not work with Xtext Redistributable 2.8.0.v201503090534.

Here are two ways that I tried:

1- I created an example DSL using standard Xtext project, which is named MyDSL

2- I tried to add some XBase expressions, and added "with org.eclipse.xtext.xbase.Xbase" to my grammar, as it is expected. But just adding this is enough to get the following exception when I try to compile a program written in MyDSL: (MyDSLTester is the name of tester project)

1 [Worker-1] ERROR org.eclipse.xtext.builder.impl.XtextBuilder - Java Model Exception: Java Model Status [MyDSLTesterdoes not exist]
java.lang.RuntimeException: Java Model Exception: Java Model Status [SOM does not exist]
at org.eclipse.xtext.builder.JDTAwareSourceFolderProvider.getSourceFolders(JDTAwareSourceFolderProvider.java:36)
at org.eclipse.xtext.builder.EclipseOutputConfigurationProvider.createAndOverlayOutputConfiguration(EclipseOutputConfigurationProvider.java:153)
at org.eclipse.xtext.builder.EclipseOutputConfigurationProvider.getOutputConfigurations(EclipseOutputConfigurationProvider.java:110)
at org.eclipse.xtext.builder.BuilderParticipant.getOutputConfigurations(BuilderParticipant.java:583)
.....


3- The second way was to try to compile existing examples, from the book, using Xtext 2.8... I tried with the example "org.example.xbase.entities". But, when I try to generate XText artifacts, the java classes for grammar rules (e.g. Entity, Attribute, Operation) are not generated.

Can someone help me?
Thanks



Re: Problems with Xtext and XBase in version 2.8.0.v201503090534 [message #1666064 is a reply to message #1666026] Wed, 11 March 2015 14:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13879
Registered: July 2009
Senior Member
Hi,

how does your model project look like? is it a java project? it will work with java projects only.

(3) i cannot answer without any traces/logs from the language generation


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problems with Xtext and XBase in version 2.8.0.v201503090534 [message #1666103 is a reply to message #1666064] Wed, 11 March 2015 14:44 Go to previous messageGo to next message
Som 2015 is currently offline Som 2015Friend
Messages: 16
Registered: March 2015
Junior Member
Hello

I try to build and work with the existing example of the book, which is on GitHub. The example of org.example.xbase.entity

When I compile it with Xtext 2.8.0.v201503090534, the folder org.example.xbase.entities.entities in /src-gen/ is empty. Probably, it has to do with workflow, etc. but unfortunately, I am not an expert on this Sad

The grammar and mwe2 files are attached to this message.
I get the following error when I try to save a program written in my DSL: (MyDSLTester is the name of tester project)

1 [Worker-5] ERROR org.eclipse.xtext.builder.impl.XtextBuilder - Java Model Exception: Java Model Status [MyDSLTester does not exist]
java.lang.RuntimeException: Java Model Exception: Java Model Status [MyDSLTester does not exist]
at org.eclipse.xtext.builder.JDTAwareSourceFolderProvider.getSourceFolders(JDTAwareSourceFolderProvider.java:36)
at org.eclipse.xtext.builder.EclipseOutputConfigurationProvider.createAndOverlayOutputConfiguration(EclipseOutputConfigurationProvider.java:153)
at org.eclipse.xtext.builder.EclipseOutputConfigurationProvider.getOutputConfigurations(EclipseOutputConfigurationProvider.java:110)
at org.eclipse.xtext.builder.BuilderParticipant.getOutputConfigurations(BuilderParticipant.java:583)
at org.eclipse.xtext.builder.BuilderParticipant.build(BuilderParticipant.java:204)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant$DeferredBuilderParticipant.build(RegistryBuilderParticipant.java:161)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:69)
at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:244)
at org.eclipse.xtext.builder.impl.XtextBuilder.fullBuild(XtextBuilder.java:272)
at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:111)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: Java Model Exception: Java Model Status [MyDSLTester does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:556)
at org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:2344)
at org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:1909)
at org.eclipse.jdt.internal.core.JavaProject.getRawClasspath(JavaProject.java:1931)
at org.eclipse.xtext.builder.JDTAwareSourceFolderProvider.getSourceFolders(JDTAwareSourceFolderProvider.java:34)
... 21 more
Re: Problems with Xtext and XBase in version 2.8.0.v201503090534 [message #1666160 is a reply to message #1666103] Wed, 11 March 2015 15:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13879
Registered: July 2009
Senior Member
HI,

it is a problem of the project you create the .fileextension file in.
it has to be a java project.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problems with Xtext and XBase in version 2.8.0.v201503090534 [message #1666169 is a reply to message #1666160] Wed, 11 March 2015 15:15 Go to previous messageGo to next message
Som 2015 is currently offline Som 2015Friend
Messages: 16
Registered: March 2015
Junior Member
Well your solution works with Xtext 2.7.3, but with 2.8.0 my problem is that the project does not compile correctly, it does not generate Java classes from the grammar. Any clue?

Thanks a lot.

[Updated on: Wed, 11 March 2015 15:18]

Report message to a moderator

Re: Problems with Xtext and XBase in version 2.8.0.v201503090534 [message #1666170 is a reply to message #1666169] Wed, 11 March 2015 15:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13879
Registered: July 2009
Senior Member
Hi,

i dont know your jvm model inferrer. nor do i know the manifest of your model project


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problems with Xtext and XBase in version 2.8.0.v201503090534 [message #1666189 is a reply to message #1666170] Wed, 11 March 2015 15:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13879
Registered: July 2009
Senior Member
btw what is the stacktrace on grammar gen you get?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problems with Xtext and XBase in version 2.8.0.v201503090534 [message #1666190 is a reply to message #1666169] Wed, 11 March 2015 15:26 Go to previous message
Som 2015 is currently offline Som 2015Friend
Messages: 16
Registered: March 2015
Junior Member
Hello

I made a mistake, it works also with 2.8.0, thanks a lot for the support. Smile

--Somy
Previous Topic:Cross-referencing overloaded methods of a DSL program
Next Topic:Working example of Xtext and XBase
Goto Forum:
  


Current Time: Sun Apr 11 17:06:17 GMT 2021

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

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

Back to the top