Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to add web integration to existing project?(Xtext 2.9)(Xtext 2.9 web integration support)
How to add web integration to existing project?(Xtext 2.9) [message #1717774] Wed, 16 December 2015 16:06 Go to next message
Chunbaixue Yang is currently offline Chunbaixue YangFriend
Messages: 20
Registered: April 2015
Junior Member
Hi All,

I'm trying to add web integration to my DSL created with older version of Xtext.
I tried creating Xtext project from existing ecore models, because I only see the web integration option when creating new project.
The project seemed to be created correctly, but when I try to generate the Xtext Artifacts from my old grammar, i got errors shown like below:

Quote:
1 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - [XtextLinkingDiagnostic: null:31 Couldn't resolve reference to JvmIdentifiableElement 'standaloneSetup'., XtextLinkingDiagnostic: null:32 Couldn't resolve reference to JvmIdentifiableElement 'loadedResource'., XtextLinkingDiagnostic: null:37 Couldn't resolve reference to JvmType 'adapter.FragmentAdapter'., XtextLinkingDiagnostic: null:38 Couldn't resolve reference to JvmIdentifiableElement 'fragment'., XtextLinkingDiagnostic: null:38 Couldn't resolve reference to JvmType 'ecore2xtext.FormatterFragment'.]
java.lang.IllegalStateException: [XtextLinkingDiagnostic: null:31 Couldn't resolve reference to JvmIdentifiableElement 'standaloneSetup'., XtextLinkingDiagnostic: null:32 Couldn't resolve reference to JvmIdentifiableElement 'loadedResource'., XtextLinkingDiagnostic: null:37 Couldn't resolve reference to JvmType 'adapter.FragmentAdapter'., XtextLinkingDiagnostic: null:38 Couldn't resolve reference to JvmIdentifiableElement 'fragment'., XtextLinkingDiagnostic: null:38 Couldn't resolve reference to JvmType '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)


In my build.gradle, org.eclipse.emf:org.eclipse.emf.mwe2.launch is added to the dependencies, and I've done Gradle->Refresh gradle project so I don't understand why the error happened.
Anyone knows anything about this error?
Or is there a standard way to add web integration to existing project?

Thanks in advance for all your help!

Regards,
Yang
Re: How to add web integration to existing project?(Xtext 2.9) [message #1717792 is a reply to message #1717774] Wed, 16 December 2015 17:59 Go to previous messageGo to next message
Stefan Oehme is currently offline Stefan OehmeFriend
Messages: 159
Registered: April 2010
Location: Kiel
Senior Member

The wizard from existing ecore models is currently broken. It will be fixed in 2.9.1, which will be out soon.

Cheers,
Stefan
Re: How to add web integration to existing project?(Xtext 2.9) [message #1717801 is a reply to message #1717792] Wed, 16 December 2015 19:43 Go to previous messageGo to next message
Chunbaixue Yang is currently offline Chunbaixue YangFriend
Messages: 20
Registered: April 2015
Junior Member
Hi Stefan,

Thank you for your reply.
If the wizard is broken, is there any other good way to add web integration to an existing Xtext project?

Greetings,
Yang
Re: How to add web integration to existing project?(Xtext 2.9) [message #1717825 is a reply to message #1717801] Thu, 17 December 2015 05:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi you can Create a new project and copy and paste your stuff

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to add web integration to existing project?(Xtext 2.9) [message #1717870 is a reply to message #1717825] Thu, 17 December 2015 13:24 Go to previous messageGo to next message
Chunbaixue Yang is currently offline Chunbaixue YangFriend
Messages: 20
Registered: April 2015
Junior Member
Hi Christian,

Creating a new project and copy paste everything was what I was trying to avoid.
I have a relatively complex language which also references to another DSL i've created. With the new project I made, I'm a bit confused about how language reference works with the new .mwe2 file.
I remember you've written a post in your blog about referencing elements from another language, could you please give me a hint or something about how that works with the new version of Xtext?

And, if possible, how could I make languages referencing work with web integration?

Best regards,
Yang
Re: How to add web integration to existing project?(Xtext 2.9) [message #1717872 is a reply to message #1717870] Thu, 17 December 2015 13:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
find (one) example attached at https://www.eclipse.org/forums/index.php/t/1073018/
you simply add a referencedResource to the genmodel in the lang section of the wf.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719018 is a reply to message #1717872] Mon, 04 January 2016 13:15 Go to previous messageGo to next message
Chunbaixue Yang is currently offline Chunbaixue YangFriend
Messages: 20
Registered: April 2015
Junior Member
Hi Christian,

Thank you for your reply.
I've followed your advice of adding genmodel as referencedResource in the lang section of wf. However, while running the workflow, the program complained that the path to my genmodel is unmapped.
From what I understood, this is due to the fact that the genmodel is not registered as platform uri. (I could be wrong)

However, with the new .mwe file, I'm sure how the genmodel should be registered.

Cheers,
Yang
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719021 is a reply to message #1719018] Mon, 04 January 2016 13:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
this is a bug in xtext 2.9.0

did you add it via classpath://..../genmodel

?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719024 is a reply to message #1719021] Mon, 04 January 2016 13:53 Go to previous messageGo to next message
Chunbaixue Yang is currently offline Chunbaixue YangFriend
Messages: 20
Registered: April 2015
Junior Member
Hi Christian,

This was the line I added:

referencedResource = "platform:/resource/myprojectname/model/generated/myDSL.genmodel"
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719027 is a reply to message #1719024] Mon, 04 January 2016 14:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
this will not work in 2.9.0 if you build with maven.
this bug is fixed in 2.9.1 afaik
https://bugs.eclipse.org/bugs/show_bug.cgi?id=484372


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719028 is a reply to message #1719027] Mon, 04 January 2016 14:08 Go to previous messageGo to next message
Chunbaixue Yang is currently offline Chunbaixue YangFriend
Messages: 20
Registered: April 2015
Junior Member
Hi Christian,

But I'm not using maven.
when I created the project, I chose None for the preferred build system.
And for the source layout, I chose Plain.

So I think maven isn't the problem.
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719037 is a reply to message #1719028] Mon, 04 January 2016 15:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
can you share a small sample project?
did you make sure the xtext project has a dependency to the project containing the genmodel?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719041 is a reply to message #1719037] Mon, 04 January 2016 16:39 Go to previous messageGo to next message
Chunbaixue Yang is currently offline Chunbaixue YangFriend
Messages: 20
Registered: April 2015
Junior Member
Hi Christian,

Here is a simple example.
I have 2 simple language dslA and dslB.
I modified the grammar and .mwe of dslB a bit for the language reference.

  • Attachment: Example.zip
    (Size: 1.61MB, Downloaded 127 times)
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719047 is a reply to message #1719041] Mon, 04 January 2016 17:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
as i said: you miss the dependency

.../mydslb/meta-inf/manifest.mf

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.xtext.example.mydslB
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: org.xtext.example.mydslB; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xtext,
 org.eclipse.xtext.xbase,
 org.eclipse.equinox.common;bundle-version="3.5.0",
 org.xtext.example.mydslA;bundle-version="1.0.0",
 org.eclipse.emf.ecore,
 org.eclipse.xtext.xbase.lib,
 org.antlr.runtime,
 org.eclipse.xtext.util,
 org.eclipse.xtend.lib,
 org.eclipse.emf.common
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.xtext.example.mydsl.parser.antlr.internal,
 org.xtext.example.mydsl.myDslB,
 org.xtext.example.mydsl.scoping,
 org.xtext.example.mydsl.services,
 org.xtext.example.mydsl.myDslB.util,
 org.xtext.example.mydsl.generator,
 org.xtext.example.mydsl.validation,
 org.xtext.example.mydsl,
 org.xtext.example.mydsl.myDslB.impl,
 org.xtext.example.mydsl.serializer,
 org.xtext.example.mydsl.parser.antlr
Import-Package: org.apache.log4j



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to add web integration to existing project?(Xtext 2.9) [message #1719095 is a reply to message #1719047] Tue, 05 January 2016 08:38 Go to previous message
Chunbaixue Yang is currently offline Chunbaixue YangFriend
Messages: 20
Registered: April 2015
Junior Member
Indeed I missed the dependency.
Thanks for your help!
Previous Topic:resolveElementAt returns null (updated)
Next Topic:Modell-Instance of the DSL
Goto Forum:
  


Current Time: Tue Apr 23 17:03:07 GMT 2024

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

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

Back to the top