Problems Using XText Language in Java project. [message #1736104] |
Sun, 26 June 2016 06:35  |
Eclipse User |
|
|
|
Hello,
I followed Sebastian Zarnekow's guide on how to export an XText language and use it in a standalone project.
However I'm getting the following error when attempting to validate the language:
"The string resource '_UI_DiagnosticRoot_diagnostic' could not be located"
Could it be something to do with how the JAR is exported? When exporting I chose the "Export required libraries into generated JAR", however if I use 2nd option eclipse tells me it cannot find the main class for the project.
Anyone help is appreciated 
|
|
|
|
Re: Problems Using XText Language in Java project. [message #1736281 is a reply to message #1736104] |
Tue, 28 June 2016 08:18   |
Eclipse User |
|
|
|
On 27/06/2016 13:57, Sam Patterson wrote:
> Hello,
>
> I followed Sebastian Zarnekow's guide on how to export an XText language
> and use it in a standalone project.
>
> However I'm getting the following error when attempting to validate the
> language:
>
> "The string resource '_UI_DiagnosticRoot_diagnostic' could not be located"
>
> Could it be something to do with how the JAR is exported? When exporting
> I chose the "Export required libraries into generated JAR", however if I
> use 2nd option eclipse tells me it cannot find the main class for the
> project.
>
> Anyone help is appreciated :)
>
>
Hi
If I remember correctly, you should export the jar with all dependencies
packed as jars into the exported jar, and NOT as extracted into the
packed jars. Otherwise the properties files and manifests will override
each others and EMF won't be able to find the properties containing the
substitutions for the strings.
hope this helps
Lorenzo
--
Prof. Lorenzo Bettini, Computer Science, DISIA, Univ. Firenze
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
|
|
|
|
Re: Problems Using XText Language in Java project. [message #1738010 is a reply to message #1736289] |
Fri, 15 July 2016 03:53   |
Eclipse User |
|
|
|
I tried both extracting and packaging the JAR, however when I package the JAR none of the imports are recognized (mainly the XText and google ones), so I can't even run the program. However if I extract the JAR then the imports do work but of course I get the original error message.
|
|
|
|
Re: Problems Using XText Language in Java project. [message #1738082 is a reply to message #1738071] |
Fri, 15 July 2016 15:37   |
Eclipse User |
|
|
|
Well the problem still lies in the fact that packaging the JAR(as people stated I should be doing) causes the required imports to not be recognized, so I'm not able to get to a point where the program can be executed, therefore even if creating a plugin.properties file fixes the original '_UI_DiagnosticRoot_diagnostic error at run time, I still can't execute the application.
|
|
|
|
Re: Problems Using XText Language in Java project. [message #1738088 is a reply to message #1738085] |
Fri, 15 July 2016 16:36   |
Eclipse User |
|
|
|
p.s. i did the following
(1) create a new xtext project.
(2) adapt workflow to generate java main for generator
(3) generate lang
(4) run generated java main once
(5) use the export as runnable jar file, tell it to create a ant file
(6) copy the ant file to the project
(7) adapted the ant file to include another file at the end
<fileset dir="${dir.workspace}/org.xtext.example.mydsl2/">
<include name="plugin.properties"/>
</fileset>
( create org.xtext.example.mydsl2/plugin.properties as follows
_UI_DiagnosticRoot_diagnostic=Dont Care
well i was too lazy to look up the real values and the other key value pairs
(9) rerun ant file
(10) have fun
if id be an ant wizard i would somehow adapt the build.xml to create a plugin.properties that contains all plugin.properties of the unpacked files merged
unfortunately i am not an ant wizard
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10571 seconds