Couldn't resolve reference to JvmType 'ecore2xtext.FormatterFragment' [message #1716443] |
Thu, 03 December 2015 21:35 |
Brandon Lewis Messages: 268 Registered: May 2012 |
Senior Member |
|
|
I have a fresh install of Luna and just grabbed Xtext 2.9. I was trying to migrate a 3.7.2 Project that used Xtextz 2.2 to Luna/Xtext2.9 and ran into many frustrating unhandled ui loop exceptions that constantly froze Luna.
So I tried to create a new Xtext Project from my existing ecore model. [I should add that I created this ecore model, some I'm importing it and not generating it from any existing grammar]
I'm running into issues right away.
My GenerateMyDsl.mwe2 can't resolve stuff that would seem like the Xtext wizard and generators should handle on their own. Examples:
Couldn't resolve reference to JvmType 'ecore2xtext.FormatterFragment'
Couldn't resolve reference to JvmIdentifiableElement 'fragment'
Couldn't resolve reference to JvmIdentifiableElement 'standaloneSetup
Couldn't resolve reference to JvmIdentifiableElement 'loadedResource
The content of the mwe2 file is also drastically different than before (which might be expected from migrating to Xtext 2.2 to 2.9)
Any idea what I'm missing?
[Updated on: Fri, 04 December 2015 03:27] Report message to a moderator
|
|
|
Re: Couldn't resolve reference to JvmType 'ecore2xtext.FormatterFragment' [message #1716454 is a reply to message #1716443] |
Fri, 04 December 2015 03:06 |
Brandon Lewis Messages: 268 Registered: May 2012 |
Senior Member |
|
|
I think I must obviously be missing a plugin. Here's the "broken" lines from the Xtext generated GenerateMyDsl.mwe2 file:
standaloneSetup = {
loadedResource = "platform:/resource/<MyProject>/model/<MyModel>.genmodel"
}
fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment2 auto-inject {}
fragment = adapter.FragmentAdapter {
fragment = ecore2xtext.FormatterFragment {}
My xtext.common.types is very new 2.9.0.v210512010527
My model Project has Xtext nature set.
The dependencies between my previous working xtext project and thew newest one are quite different - primarily most of the Xtext 2.9 dependencies are found in the Automated Management of Dependency section (and hence not in the Manifest file.
Confused.
[Updated on: Fri, 04 December 2015 03:06] Report message to a moderator
|
|
|
|
|
Re: Couldn't resolve reference to JvmType 'ecore2xtext.FormatterFragment' [message #1716513 is a reply to message #1716471] |
Fri, 04 December 2015 13:23 |
Brandon Lewis Messages: 268 Registered: May 2012 |
Senior Member |
|
|
Thanks Stefan!
Just some additional info:
- My workflow already had import org.eclipse.xtext.xtext.generator.* and I added import org.eclipse.xtext.generator.*
- I placed referencedResource = "uriOfReferencedEcoreModel" in the workflow
- fragment = adapter.FragmentAdapter {
fragment = ecore2xtext.FormatterFragment {}
}
was still unable to resolve. I commented it out for now.
- My Manifest.MF already contained: org.eclipse.xtext.generator
So I'm now able to run the workflow and progress. Thank you for your help.
Unfortunately, and this isn't your problem, but I'm back to having Luna throw unhandled event loops again from the e4 workbench randomly after about 4-10 key presses. Very frustrating that a year old release of Eclipse is having unstable workbench behavior right out of the box.
Looking forward to learning more about Xtext! Thanks!
[Updated on: Fri, 04 December 2015 13:24] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Couldn't resolve reference to JvmType 'ecore2xtext.FormatterFragment' [message #1720905 is a reply to message #1716678] |
Thu, 21 January 2016 18:14 |
Alfonso de la Vega Messages: 18 Registered: January 2016 |
Junior Member |
|
|
Hello,
As I have a problem similar to Brandon's I will ask it here.
I am running Xtext 2.9.1 on Eclipse Mars and I am finding problems when creating projects from existing metamodels using Maven or Gradle configurations.
When I try to generate Xtext artifacts from eclipse run configurations, it works fine, as it was announced to be fixed in 2.9.1.
However, when I try to build the project using Maven or Gradle (for example, trying to run the new web editor via the gradle jettyrun task), I see the same dependency failure problem:
.../org.xtext.example.mydsl.parent$ ./gradlew jettyrun
:org.xtext.example.mydsl:generateXtextLanguage
0 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - [XtextLinkingDiagnostic: null:41 Couldn't resolve reference to JvmType 'org.eclipse.xtext.generator.adapter.FragmentAdapter'., XtextLinkingDiagnostic: null:42 Couldn't resolve reference to JvmIdentifiableElement 'fragment'., XtextLinkingDiagnostic: null:42 Couldn't resolve reference to JvmType 'org.eclipse.xtext.generator.ecore2xtext.FormatterFragment'.]
java.lang.IllegalStateException: [XtextLinkingDiagnostic: null:41 Couldn't resolve reference to JvmType 'org.eclipse.xtext.generator.adapter.FragmentAdapter'., XtextLinkingDiagnostic: null:42 Couldn't resolve reference to JvmIdentifiableElement 'fragment'., XtextLinkingDiagnostic: null:42 Couldn't resolve reference to JvmType 'org.eclipse.xtext.generator.ecore2xtext.FormatterFragment'.]
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:88)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
:org.xtext.example.mydsl:generateXtextLanguage FAILED
Steps to reproduce this problem:
1. Create a new xtext project from an existing metamodel.
2. Select web integration and gradle as build system
3. Run a gradle task (for example, gradlew jettyrun)
Both org.eclipse.xtext.generator and org.eclipse.xtext.xtext.generator are included by default in the dsl manifest.
Am I missing some extra configuration I need to apply?
Thank you very much,
Alfonso.
|
|
|
|
|
|
|
|
Re: Couldn't resolve reference to JvmType 'ecore2xtext.FormatterFragment' [message #1721011 is a reply to message #1720982] |
Fri, 22 January 2016 14:51 |
|
Alfonso de la Vega wrote on Fri, 22 January 2016 09:41
...now I have problems with the dependencies to my "existing metamodel project" as you mentioned:
219 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow org.xtext.example.mydsl.GenerateMyDsl: java.io.IOException: The path '/metamodel/Entity.genmodel' is unmapped
Dependencies to this project appear in the MANIFEST.MF file, but it seems that is not enough for gradle to be aware of them.
The Gradle build generated by the Xtext project wizard can be used as a starting point, but of course it cannot automatically detect the structure of your other projects and integrate with that. You will have to set up the Gradle build yourself in such a case. A quick first step could be the following.
- Move the existing metamodel project into the parent project generated by the wizard and add it to the settings.gradle
- Set up a basic build.gradle in the metamodel project:
dependencies {
compile "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}"
}
(actually a dependency to EMF would be enough, but that would not work with the existing setup of the Gradle project)
- Add dependencies to the metamodel project in the dsl runtime project.
|
|
|
|
Powered by
FUDForum. Page generated in 0.06692 seconds