Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Deployed xText IDE does not work
Deployed xText IDE does not work [message #1807200] Fri, 24 May 2019 14:42 Go to next message
J Bouwhuis is currently offline J BouwhuisFriend
Messages: 16
Registered: April 2019
Junior Member
I want to create two DSLs; one for describing a functional behaviour, and one for describing resource demands. I want to import the first dsl into the second dsl (using an import statement). I had some problems before where compiling the second dsl gave some problems. I fixed this by adding a reference in the mwe2 workflow of the second language. Everything works fine now (no compilation erros anymore). However, when I deploy the second dsl in a new Eclipse environment and create a new text file in order to use my dsl , the editor does not recognize the dsl language (that is; no grammar checks, no auto-fill etc.). It just handles the text file as a plain text file with no programming context (I checked 10 times to make sure I used the right extension for the file; .transformationdsl). So to make everything clear --> I have two DSLs; one called finalDSL and one called transformationDSL. I am referring in the transformationDSL grammar (see xText code below, don't mind the semantics as this is just for testing purpose) to the finalDSL grammar. I am referring to the finalDSL not only in the xText grammar below, but also in the Mwe2 workflow file (see bottom of my post). The problem is that after deploying the DSL in a new Eclipse environment, it doesn't work (no grammar checking whatsoever, it just sees my 'texfile'.transformationdsl file as a plain text file). I have no idea what I am doing wrong, since the xText compiler gives absolutely no errors when running the Mwe2 workflow. However, when I boot up the TransformationDSL in a new Eclipse environment it works, but it does however give the following redlined messages in the console:

2019-05-24 16:26:15.853 java[29175:754081] -[NSView clearDeferFlushing]: unrecognized selector sent to instance 0x7f821f64a7c0
2019-05-24 16:26:15.913 java[29175:754081] -[NSView clearDeferFlushing]: unrecognized selector sent to instance 0x7f821f64a7c0
2019-05-24 16:26:15.973 java[29175:754081] -[NSView clearDeferFlushing]: unrecognized selector sent to instance 0x7f821f64a7c0
2019-05-24 16:26:16.009 java[29175:754081] -[NSView clearDeferFlushing]: unrecognized selector sent to instance 0x7f821f64a7c0
2019-05-24 16:26:16.015 java[29175:754081] -[NSView clearDeferFlushing]: unrecognized selector sent to instance 0x7f821f64a7c0
2019-05-24 16:26:16.021 java[29175:754081] -[NSView clearDeferFlushing]: unrecognized selector sent to instance 0x7f821f64a7c0
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://633.fwk860798122:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://633.fwk860798122:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
2019-05-24 16:26:16.375 java[29175:754081] -[NSView clearDeferFlushing]: unrecognized selector sent to instance 0x7f821f64a7c0


TransformationDSL xText grammar.

grammar org.xtext.example.TransformationDSL with org.eclipse.xtext.common.Terminals

generate transformationDSL "http://www.xtext.org/example/TransformationDSL"

import "http://www.xtext.org/example/mydsl/FinalDsl" as finalDSL

Model:
	greetings+=Greeting*;
	
Greeting:
	    'use' definition=[finalDSL::LibraryBusinessMethodStatement]
	    Check = check
	    ;

check:
	 check = [finalDSL::ClassOperationName]
;


The Mwe2 workflow file of the TransformationDSL is structured as follows (mind the referencedResource statement which I added manually in order to solve the problems with reference resolving to the finalDSL language).

module org.xtext.example.GenerateTransformationDSL

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."

Workflow {
	
	component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "org.xtext.example.transformationDSL"
				rootPath = rootPath
				runtimeTest = {
					enabled = true
				}
				eclipsePlugin = {
					enabled = true
				}
				eclipsePluginTest = {
					enabled = true
				}
				createEclipseMetaData = true
			}
			code = {
				encoding = "UTF-8"
				lineDelimiter = "\n"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}
		}
		language = StandardLanguage {
			name = "org.xtext.example.TransformationDSL"
			referencedResource = "platform:/resource/org.xtext.example.finaldsl/model/generated/FinalDsl.genmodel"//"platform:/resource/org.xtext.example.finaldsl/model/generated/FinalDsl.genmodel"
			fileExtensions = "transformationdsl"

			serializer = {
				generateStub = false
			}
			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
				// Generates checks for @Deprecated grammar annotations, an IssueProvider and a corresponding PropertyPage
				generateDeprecationValidation = true
			}
			junitSupport = {
				junitVersion = "5"
			}
		}
	}
} 

[Updated on: Fri, 24 May 2019 14:48]

Report message to a moderator

Re: Deployed xText IDE does not work [message #1807201 is a reply to message #1807200] Fri, 24 May 2019 14:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
Hi can you please provide a github (or similar ) repo showing the problem. Otherwise this is just pure guessing

- project has not Xtext nature
- build automatically turned off
- file Extension wrong
- dependencies unfulfilled
....


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deployed xText IDE does not work [message #1807202 is a reply to message #1807201] Fri, 24 May 2019 14:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
Also have a look if there are plugin.xml_gen files that differ from plugin.xml files

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deployed xText IDE does not work [message #1807204 is a reply to message #1807201] Fri, 24 May 2019 15:10 Go to previous messageGo to next message
J Bouwhuis is currently offline J BouwhuisFriend
Messages: 16
Registered: April 2019
Junior Member
@christian thanks a lot for your quick reply. I have already tried your first and third solution, and I think also the other solutions (but I will try these again to be sure). I'm sorry to not have provided everything directly, I though that I could keep it concise by only posting the snippets above. However, I have uploaded the repository from Eclipse in a zip file on Github (see https://github.com/JosBouwhuis/xText-DSL/blob/master/xText%20dsl.zip). It consists of two xText projects (for two DSLs) named finaldsl and transformationdsl. As described above, my problem is that when compiling the transformation dsl (which has a meaningless syntax now for testing purposes) and starting it in a new environment (where i create a 'textfile'.transformationdsl file) the transformation dsl syntax is not invoked in the Eclipse environment; it's just handled as a plain textfile, despite having the .transformationdsl extension. Looking forward towards your thoughts on this. And if you need any more clarification/information, I am of course more than willing to provide this!
Re: Deployed xText IDE does not work [message #1807206 is a reply to message #1807202] Fri, 24 May 2019 15:21 Go to previous messageGo to next message
J Bouwhuis is currently offline J BouwhuisFriend
Messages: 16
Registered: April 2019
Junior Member
Christian Dietrich wrote on Fri, 24 May 2019 14:49
Also have a look if there are plugin.xml_gen files that differ from plugin.xml files


With regards to the plugin.xml_gen and plugin.xml file; I threw them both in an online diff tool and found out that they are completely the same, except for the following lines which can be found in the plugin.xml file, but not in the plugin.xml_gen file. Adding them to the .xml_gen file however did not solve the problem unfortunately:

        <extension point="org.eclipse.ui.preferencePages">
		<page
			category="org.xtext.example.TransformationDSL"
			class="org.xtext.example.ui.TransformationDSLExecutableExtensionFactory:org.eclipse.xtext.ui.validation.ValidatorPreferencePage"
			id="org.xtext.example.TransformationDSL.validator.preferencePage"
			name="Errors/Warnings">
			<keywordReference id="org.xtext.example.ui.keyword_TransformationDSL"/>
		</page>
	</extension>

       </extension> 

[Updated on: Fri, 24 May 2019 15:22]

Report message to a moderator

Re: Deployed xText IDE does not work [message #1807208 is a reply to message #1807206] Fri, 24 May 2019 15:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
question: which java version is your eclipse you install the plugins to started with?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deployed xText IDE does not work [message #1807209 is a reply to message #1807208] Fri, 24 May 2019 16:07 Go to previous messageGo to next message
J Bouwhuis is currently offline J BouwhuisFriend
Messages: 16
Registered: April 2019
Junior Member
I configured them with Java 10 because xText stated that it is not compatible (yet) with Java 11
Re: Deployed xText IDE does not work [message #1807210 is a reply to message #1807209] Fri, 24 May 2019 16:12 Go to previous messageGo to next message
J Bouwhuis is currently offline J BouwhuisFriend
Messages: 16
Registered: April 2019
Junior Member
By the way, I also see a lot of errors right now in the error log of the Eclipse environment in which I deploy the DSL. They all talk about missing UI handlers (see below for one of the lines that I copied, they all have the "Unable to retrieve the bundle from the URI: bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers" part in common). The weird thing is that it states java version 11, but I configured it to use Java 10 as default.

eclipse.buildId=4.11.0.I20190307-0500
java.version=11.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=nl_NL
Framework arguments:  -product org.eclipse.platform.ide
Command-line arguments:  -product org.eclipse.platform.ide -data /Users/jos/eclipse-workspace/../runtime-EclipseXtext -dev file:/Users/jos/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/Launch Runtime Eclipse/dev.properties -os macosx -ws cocoa -arch x86_64

org.eclipse.e4.ui.workbench
Error
Fri May 24 17:17:13 CEST 2019
Unable to retrieve the bundle from the URI: bundleclass://org.eclipse.e4.tools.emf.ui/org.eclipse.e4.tools.emf.ui.internal.handlers.AutosizeColumnsHandler


[Updated on: Fri, 24 May 2019 16:13]

Report message to a moderator

Re: Deployed xText IDE does not work [message #1807211 is a reply to message #1807209] Fri, 24 May 2019 16:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
can you in your test eclipse open a host osgi console
(console view, + button in the top)
and type "ss org.xtext.example"


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deployed xText IDE does not work [message #1807213 is a reply to message #1807211] Fri, 24 May 2019 16:31 Go to previous messageGo to next message
J Bouwhuis is currently offline J BouwhuisFriend
Messages: 16
Registered: April 2019
Junior Member
Christian Dietrich wrote on Fri, 24 May 2019 16:14
can you in your test eclipse open a host osgi console
(console view, + button in the top)
and type "ss org.xtext.example"


Sure. Here is the output:

WARNING: This console is connected to the current running instance of Eclipse!
osgi> ss org.xtext.example
"Framework is launched."


id	State       Bundle
641	ACTIVE      org.xtext.example.finaldsl.ide_1.0.0.qualifier
642	STARTING    org.xtext.example.finaldsl.tests_1.0.0.qualifier
643	ACTIVE      org.xtext.example.finaldsl.ui_1.0.0.qualifier
669	STARTING    org.xtext.example.transformationDSL.ide_1.0.0.qualifier
670	STARTING    org.xtext.example.transformationDSL.tests_1.0.0.qualifier
671	STARTING    org.xtext.example.transformationDSL.ui_1.0.0.qualifier
672	STARTING    org.xtext.example.transformationDSL.ui.tests_1.0.0.qualifier
673	STARTING    org.xtext.example.transformationDSL_1.0.0.qualifier
674	STARTING    org.xtext.example.finaldsl.ui.tests_1.0.0.qualifier
676	ACTIVE      org.xtext.example.finaldsl_1.0.0.qualifier
osgi>
Re: Deployed xText IDE does not work [message #1807214 is a reply to message #1807213] Fri, 24 May 2019 16:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
type start 671

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deployed xText IDE does not work [message #1807223 is a reply to message #1807214] Fri, 24 May 2019 22:10 Go to previous messageGo to next message
J Bouwhuis is currently offline J BouwhuisFriend
Messages: 16
Registered: April 2019
Junior Member
Thanks for the reaction. I have started 671 but unfortunately without a result. As a matter of fact, I started all bundles which were listed as 'starting' and they were all listed as 'active' after I gave the ss command again. However, the editor was still not working :(
Re: Deployed xText IDE does not work [message #1807230 is a reply to message #1807223] Sat, 25 May 2019 05:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
Can you please provide your sample project too.
an make sure with right klick on the file in package/project explorer "open with"
its opened with yourdsl editor


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sat, 25 May 2019 05:56]

Report message to a moderator

Re: Deployed xText IDE does not work [message #1807239 is a reply to message #1807230] Sat, 25 May 2019 16:14 Go to previous messageGo to next message
J Bouwhuis is currently offline J BouwhuisFriend
Messages: 16
Registered: April 2019
Junior Member
@christian thanks a lot for the answer. Turns out the 'open with' step caused the problem. When I specified it to open the .transformationdsl file with mydsl editor in the deployed eclipse environment it instantly worked; what a relief. The next problem is that refering to the other DSL is still giving problems. When I execute the mwe2 workflow file of the transformation DSL, it states that the "org.xtext.example.finaldsl/model/generated/FinalDsl.genmodel" file is unmapped (the DSL that I want to refer to in my TransformationDSL). When I add the project of the FinalDSL to the classpath of the TransformationDSL, it compiles without errors. However, when I deploy the transformation DSL in a new eclipse environment, it gives the error "Failed to create injector for org.xtext.example.Transformationdsl (occurred in org.xtext.example.ui.TransformationdslExecutableExtensionFactory)". The MWE2 workflow file for the Transformation DSL can be found below. Does this seem familiar or do you have any quick solutions for this (I have not investigated it myself yet since I currently have little time, but if this problem has a very simple solution I am of course more than happy to hear it). Anyway, thanks a bunch for your incredible support. Without you I don't know (and I guess a lot of xText users) if I would have been able to solve these problems.

module org.xtext.example.GenerateTransformationdsl

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."

Workflow {
	
	component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "org.xtext.example.transformationdsl"
				rootPath = rootPath
				runtimeTest = {
					enabled = true
				}
				eclipsePlugin = {
					enabled = true
				}
				eclipsePluginTest = {
					enabled = true
				}
				createEclipseMetaData = true
			}
			code = {
				encoding = "UTF-8"
				lineDelimiter = "\n"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}
		}
		language = StandardLanguage {
			name = "org.xtext.example.Transformationdsl"
			//referencedResource = "platform:/resource/org.xtext.example.finaldsl/model/generated/FinalDsl.genmodel"
			referencedResource = "platform:/resource/org.xtext.example.finaldsl/model/generated/FinalDsl.genmodel"//"platform:/resource/org.xtext.example.finaldsl/model/generated/FinalDsl.genmodel"
			fileExtensions = "trans"
			
			
			serializer = {
				generateStub = false
			}
			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
				// Generates checks for @Deprecated grammar annotations, an IssueProvider and a corresponding PropertyPage
				generateDeprecationValidation = true
			}
			junitSupport = {
				junitVersion = "5"
			}
		}
	}
}
Re: Deployed xText IDE does not work [message #1807242 is a reply to message #1807239] Sat, 25 May 2019 17:18 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
its impossible you guesstrying to help you.

the dsl you refer to need to be on the classpath
you usually do this by adding it as dependency to the manifest


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Override import behavior to handle C-style includes
Next Topic:TortoiseShell - is there simple way to run the interpreter to run a program ?
Goto Forum:
  


Current Time: Sat Aug 24 00:23:38 GMT 2019

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

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

Back to the top