Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Is there a headless feature fur running MWE2 workflows?
Is there a headless feature fur running MWE2 workflows? [message #1066861] Thu, 04 July 2013 19:53 Go to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
Hi,

I've been posting this a few days ago into the EMF forum but since I got no response think I may have posted in the wrong forum. I hope this is the right one since I couldn't find one dedicated to MWE or MWE2 (please tell me if there's a more appropriate forum). I'm trying to run a MWE2 workflow from a headless Buckminster installation.
(original Thread: http://www.eclipse.org/forums/index.php/t/489772/0 )

When I use the following feature Buckminster knows how to run the launch configuration for my MWE2 workflow but unfortunately that feature is not headless and throws countless errors since it couldn't find the UI classes:

buckminster install http://download.eclipse.org/releases/kepler org.eclipse.emf.mwe2.language.sdk



Is there a headless feature (or any other way) I can run the MWE2 workflow with? In the end I want to use Jenkins to generate my classes, compile my projects and run unit tests, etc. The first point is the final missing piece in the puzzle and I'm reluctant to store generated files in our repository, since for our team this has proven to be a significant cause of errors.

Thanks everyone
Marcel
Re: Is there a headless feature fur running MWE2 workflows? [message #1066866 is a reply to message #1066861] Thu, 04 July 2013 20:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i dont know about buckminister
(you may look into xtext sourcecode for that)

never the less there is
the possibility for maven/tycho
http://fornax.itemis.de/confluence/pages/viewpage.action?pageId=914
https://github.com/aphethean/xtext-maven-examples

and org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher should be triggerable from ant etc.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Is there a headless feature fur running MWE2 workflows? [message #1066867 is a reply to message #1066866] Thu, 04 July 2013 20:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Maybe https://github.com/LorenzoBettini/Xtext-Buckminster-Example helps

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Is there a headless feature fur running MWE2 workflows? [message #1066870 is a reply to message #1066867] Thu, 04 July 2013 20:46 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
Christian Dietrich wrote on Thu, 04 July 2013 16:15
Maybe https://github.com/LorenzoBettini/Xtext-Buckminster-Example helps

Thanks for your suggestion. His tutorial was what got me this far but it relies on the generated files being committed to the repository (as you can see from the populated src-gen folder. In my opinion generated files don't belong in version control. If I can't find a solution to this, I will have no other choice but I can't imagine that running a MWE workflow is strongly dependent on the Eclipse user interface...

[Updated on: Thu, 04 July 2013 20:55]

Report message to a moderator

Re: Is there a headless feature fur running MWE2 workflows? [message #1066871 is a reply to message #1066866] Thu, 04 July 2013 20:53 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
Christian Dietrich wrote on Thu, 04 July 2013 16:10
Hi,

i dont know about buckminister
(you may look into xtext sourcecode for that)

never the less there is
the possibility for maven/tycho
http://fornax.itemis.de/confluence/pages/viewpage.action?pageId=914
https://github.com/aphethean/xtext-maven-examples

and org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher should be triggerable from ant etc.


As far as I see it, the problem remains the same: you need to fulfill the dependencies. So you need all the JARs that are required to run an MWE workflow, whether that's with ANT, buckminster or whatever. All I need is a headless build of the depending libraries otherwise I'll have to deploy a full eclipse library to the build server - or am I misunderstanding something here?
Re: Is there a headless feature fur running MWE2 workflows? [message #1066873 is a reply to message #1066871] Thu, 04 July 2013 20:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi more or less. Maven Tycho Directly accesses eclipse P2 repos

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Is there a headless feature fur running MWE2 workflows? [message #1066874 is a reply to message #1066873] Thu, 04 July 2013 21:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
P.s. I just saw Even the xtext Guys Check in the generated code so this might be accepted practice with buckminister

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Is there a headless feature fur running MWE2 workflows? [message #1066920 is a reply to message #1066861] Fri, 05 July 2013 07:21 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
I don't exactly get your problem: When you launch an MWE workflow from
Eclipse, a new process is started running a standalone JVM without
Equinox. That's why we have to do all the hassle with the standalone
setups and manual Ecore model registration. There is no UI dependency here.

Buckminster is known for doing exactly the same as you would manually
from within Eclipse, so I see no reason how a UI dependency should come
in here.

Could you elaborate what kind of workflow induces which UI dependency?


Am 04.07.13 21:53, schrieb Marcel Abou Khalil:
> Hi,
>
> I've been posting this a few days ago into the EMF forum but since I got
> no response think I may have posted in the wrong forum. I hope this is
> the right one since I couldn't find one dedicated to MWE or MWE2 (please
> tell me if there's a more appropriate forum). I'm trying to run a MWE2
> workflow from a headless Buckminster installation.
> (original Thread: http://www.eclipse.org/forums/index.php/t/489772/0 )
>
> When I use the following feature Buckminster knows how to run the launch
> configuration for my MWE2 workflow but unfortunately that feature is not
> headless and throws countless errors since it couldn't find the UI classes:
>
>
> buckminster install http://download.eclipse.org/releases/kepler
> org.eclipse.emf.mwe2.language.sdk
>
>
> Is there a headless feature (or any other way) I can run the MWE2
> workflow with? In the end I want to use Jenkins to generate my classes,
> compile my projects and run unit tests, etc. The first point is the
> final missing piece in the puzzle and I'm reluctant to store generated
> files in our repository, since for our team this has proven to be a
> significant cause of errors.
>
> Thanks everyone
> Marcel


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: Is there a headless feature fur running MWE2 workflows? [message #1067000 is a reply to message #1066861] Fri, 05 July 2013 11:45 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

Hi Marcel,
unfortunately MWE2 Language feature strictly depends on some eclipse and Xtext UI bundles.
What you can try is installing mwe2 runtime feature and additionally mwe2 Launch bundle

Regards,
Dennis.



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: Is there a headless feature fur running MWE2 workflows? [message #1067094 is a reply to message #1067000] Fri, 05 July 2013 19:25 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
Christian Dietrich wrote on Thu, 04 July 2013 17:11
P.s. I just saw Even the xtext Guys Check in the generated code so this might be accepted practice with buckminister


I always thought the reason for this was to take some load off the build server and improve build times - not that it was a necessity. Hmm...

Jan Kohnlein wrote on Fri, 05 July 2013 03:21
[...]
Could you elaborate what kind of workflow induces which UI dependency?


The feature that includes the mwe2 launch bundle has UI dependencies. If you install it in buckminster, it will complain that the dependencies are not found. Even if the launch bundle itself never uses anything from the UI, some parts of the whole feature obviously do. And that's the problem I'm facing.

Dennis Huebner wrote on Fri, 05 July 2013 07:45
Hi Marcel,
unfortunately MWE2 Language feature strictly depends on some eclipse and Xtext UI bundles.
What you can try is installing mwe2 runtime feature and additionally mwe2 Launch bundle

Regards,
Dennis.


Thanks Dennis. Installing the runtime feature is straight-forward but I didn't know you could install single bundles as well. The install command only takes feature IDs to install - so how do I install the mwe2 launch bundle in buckminster?
Re: Is there a headless feature fur running MWE2 workflows? [message #1067098 is a reply to message #1067094] Fri, 05 July 2013 20:13 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

I will try it out locally, if all went as expected (it should), I will prepare a corresponding mwe2 headless feature.


+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: Is there a headless feature fur running MWE2 workflows? [message #1067417 is a reply to message #1067098] Mon, 08 July 2013 14:48 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
Thanks for all the effort!
Re: Is there a headless feature fur running MWE2 workflows? [message #1067467 is a reply to message #1067417] Mon, 08 July 2013 20:09 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

Hi Marcel,
plz try out the launcher feature

-i org.eclipse.emf.mwe2.launcher.feature.group
-r http://download.eclipse.org/modeling/tmf/xtext/updates/composite/latest/

Regards,
Dennis.

P.S.: deactivate refresh feature (remove <stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" .../> tag) in your launch config file. You will get a NoClassDefFound otherwise.



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: Is there a headless feature fur running MWE2 workflows? [message #1067637 is a reply to message #1067467] Tue, 09 July 2013 18:02 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
Hi Dennis,

I've come a bit further but I get a conflict in versions now:

INFO:  install 'http://download.eclipse.org/modeling/tmf/xtext/updates/composite/latest/' 'org.eclipse.emf.mwe2.runtime.sdk'
INFO:  install 'http://download.eclipse.org/modeling/tmf/xtext/updates/composite/latest/' 'org.eclipse.emf.mwe2.launcher'
INFO:  resolve 'de.ovgu.cse.vecs.saml.buckminster/projects-platform.cquery'
WARNING [0023] : Component request org.eclipse.xtext.xbase.lib:osgi.bundle/[2.4.2.v201306120542,2.4.2.v201306120542] is in conflict with request org.eclipse.xtext.xbase.lib:osgi.bundle/2.4.3
INFO:  TAG-ID 0023 = Query for de.ovgu.cse.vecs.saml.buckminster:buckminster, path: de.ovgu.cse.vecs.saml.buckminster:buckminster$1.0.0 -> org.eclipse.xtext.sdk:eclipse.feature$2.4.2.v201306120542 -> rg.eclipse.xtext.xbase:eclipse.feature$2.4.2.v201306120542 -> org.eclipse.xtext.xbase.lib:eclipse.feature$2.4.2.v201306120542

INFO:  Import complete.
INFO:  resolve 'de.ovgu.cse.vecs.saml.buckminster/project.cquery'
INFO:  Import complete.
INFO:  clean
INFO:  launch '-l' 'de.ovgu.cse.vecs.saml/GenerateSaml.buckminster.mwe2.launch'
WARN:  Process C:\Program Files\Java\jdk1.7.0_05\bin\javaw.exe (09.07.2013 19:42:00) terminated with exit status 1.


I guess my clean buckminster installation (version 4.3) does not provide the necessary versions of all required features.

I've already adjusted my projects-platform.rmap to point towards "latest" instead of "release" but that didn't help:

[...]
  <rm:property key="xtext.p2.repository" value="${eclipse.download}/modeling/tmf/xtext/updates/composite/latest/"/>
  <rm:locator pattern="^org\.eclipse\.(?:xtext|xpand|xtend|xtend2|emf)(?:\..+)?$" searchPathRef="xtext"/>
  <rm:searchPath name="xtext">
    <rm:provider componentTypes="osgi.bundle,eclipse.feature" readerType="p2" source="false">
      <rm:property key="buckminster.source" value="false"/>
      <rm:uri format="{0}">
        <bc:propertyRef key="xtext.p2.repository"/>
      </rm:uri>
    </rm:provider>
  </rm:searchPath>
[...]


I'm not sure where the old version comes from...
Re: Is there a headless feature fur running MWE2 workflows? [message #1067640 is a reply to message #1067637] Tue, 09 July 2013 18:26 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
My bad - Buckminster held some cached versions which I had to delete manually. I don't get any warnings any more apart from an uninformative

WARN:  Process C:\Program Files\Java\jdk1.7.0_05\bin\javaw.exe (09.07.2013 19:42:00) terminated with exit status 1.


I guess this has nothing to do with the new feature, correct? Now if I could only convince buckminster to print out more information...
Re: Is there a headless feature fur running MWE2 workflows? [message #1067644 is a reply to message #1067640] Tue, 09 July 2013 19:23 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
Just to get a comparison. If I use my original mwe2.launch configuration I get the exception that you mentioned:

INFO:  launch '-l' 'de.ovgu.cse.vecs.saml/GenerateSaml.mwe2.launch'
ERROR: An internal error occurred during: "Refreshing after mwe2 launch".
java.lang.NoClassDefFoundError: org/eclipse/debug/ui/RefreshTab
        at org.eclipse.emf.mwe2.launch.shortcut.Mwe2LaunchDelegate$1$1.run(Mwe2L
aunchDelegate.java:38)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.eclipse.debug.ui.RefreshTab can
not be found by org.eclipse.emf.mwe2.launch_2.4.0.v201307091049
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(Bundl
eLoader.java:501)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.
java:421)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.
java:412)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(De
faultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 2 more
WARN:  Process C:\Program Files\Java\jdk1.7.0_05\bin\javaw.exe (09.07.2013 21:14
:10) terminated with exit status 1.


without the
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" [...] />
the launch execution just exits without any message. Without a message I have no clue whatsoever where even to begin searching for the error.
Re: Is there a headless feature fur running MWE2 workflows? [message #1067645 is a reply to message #1067644] Tue, 09 July 2013 19:27 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

Maybe standard out/err says a bit more run with:
launch --stdout --stderr -l foo




+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: Is there a headless feature fur running MWE2 workflows? [message #1067693 is a reply to message #1067645] Wed, 10 July 2013 07:12 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
Dennis Huebner wrote on Tue, 09 July 2013 15:27
Maybe standard out/err says a bit more run with:
launch --stdout --stderr -l foo



Thanks for all your time, you are incredibly helpful. With the output I was able to quickly determine that the problem was on our end: We're extending the Generator class and we're also using an additional GeneratorFragment - both of which are in the actual Xtext project. Eclipse seems to not have minded that cyclic dependency between the MWE2 workflow and the Xtext project (even with a clean git clone; sounds like black magic to me!). Buckminster of course can't find the Generator and Fragment classes before the build - which in turn requires the generated classes. So I guess the correct solution would be to build the Xtext project in two steps. First the Generator and Fragment classes and then run the MWE2 workflow and build the Xtext project.

Yesterday I've spent all day trying to figure out how to implement this. The only method (that I've found) for providing the results of one build to the next in Jenkins/BuckminsterPlugin are "targetPlatforms" but so far trying to tie both up were unsuccessful. Is that even a correct way of tying things up or am I on the wrong path? Documentation seem to be scarce on that topic.
Re: Is there a headless feature fur running MWE2 workflows? [message #1067771 is a reply to message #1067693] Wed, 10 July 2013 14:02 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

Process in the same way you do it in your local eclipse. That is what buckminster was build for, to move your local IDE to the remote build server.
What is your local workflow step-by-step?



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: Is there a headless feature fur running MWE2 workflows? [message #1067933 is a reply to message #1067771] Thu, 11 July 2013 10:44 Go to previous messageGo to next message
Marcel Abou Khalil is currently offline Marcel Abou KhalilFriend
Messages: 15
Registered: July 2013
Junior Member
My local workflow is:


  1. Clone Repository
  2. Import existing project into Eclipse
  3. Run MWE2 Workflow
  4. Run Unit Tests


This works fine but the MWE2 Workflow has dependencies on classes in my project (Generator and GeneratorFragment). Eclipse seems to not mind much. I guess it performs a partial build as soon as you import the project, showing errors for everything it couldn't build but allows the use of classes for the MWE2 workflow that were fine.

In Buckminster (from what I understand) a build is either complete or it fails. So I can't tell Buckminster to build it but ignore all errors, then run the MWE2 workflow with everything that was built successfully and then build again, this time not ignoring any errors. Is my understanding correct?

[Updated on: Thu, 11 July 2013 10:45]

Report message to a moderator

Re: Is there a headless feature fur running MWE2 workflows? [message #1068415 is a reply to message #1067933] Sat, 13 July 2013 07:44 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi Marcel

see comments inline

On 11/07/2013 12:44, Marcel Abou Khalil wrote:
> My local workflow is:
>
>
> Clone Repository
> Import existing project into Eclipse
> Run MWE2 Workflow
> Run Unit Tests
>
>
> This works fine but the MWE2 Workflow has dependencies on classes in my
> project (Generator and GeneratorFragment). Eclipse seems to not mind
> much. I guess it performs a partial build as soon as you import the
> project, showing errors for everything it couldn't build but allows the
> use of classes that were fine in the MWE2 workflow.
>

you could put Generator and GeneratorFragment into a separate project.
These classes do not depend on the classes that MWE2 Workflow generates,
do they? They do not have dependencies on the Xtext projects either, do
they?

You could do a first buckminster run: import this separate bundle and
build it.

Then you do another buckminster run which imports the other projects,
launch the MWE2 workflow etc.

(of course you might want to first try this as a local workflow in Eclipse).

If on the contrary, by cyclic dependency you actually mean that
Generator actually depends on the generated classes, then I wouldn't
know how to do that...

> In Buckminster (from what I understand) a build is either complete or it
> fails. So I can't tell Buckminster to build it, ignore all errors, then
> run the MWE2 workflow with everything that was built successfully and
> then build again, this time not ignoring any errors. Is my understanding
> correct?

When you tell buckminster to "build" does it create the .class files for
your Generator and GeneratorFragment? If it does, you could run
buckminster a second time to execute MWE2 workflow and then go on...

By the way, would it really be a problem to put the generated sources in
the git repository? I usually prefer to put them in the repo, and also
many other (including the Xtext guys).

hope this helps
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it


Previous Topic:Problem parsing xtext from variable: references missing
Next Topic:post processing
Goto Forum:
  


Current Time: Fri Apr 26 15:51:05 GMT 2024

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

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

Back to the top