Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » UI required when launching mwe2 headlessly?
UI required when launching mwe2 headlessly? [message #1404393] Thu, 31 July 2014 22:43 Go to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
I'm trying to set up a headless configuration where I launch an mwe2 workflow. I'm not able to do so without involving a large number of UI plug-ins in my setup. The bundle marks them as optional but I get the exception below when I launch.

I know I can make it work by adding the UI bundles but I would like to avoid that. Is there some configuration option that can be set to avoid it?

java.lang.NoClassDefFoundError: org/eclipse/debug/ui/RefreshTab
	at org.eclipse.emf.mwe2.launch.shortcut.Mwe2LaunchDelegate$1$1.run(Mwe2LaunchDelegate.java:38)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassNotFoundException: org.eclipse.debug.ui.RefreshTab cannot be found by org.eclipse.emf.mwe2.launch_2.6.0.v201405200939
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Re: UI required when launching mwe2 headlessly? [message #1404410 is a reply to message #1404393] Fri, 01 August 2014 07:48 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

> Is there some configuration option that can be set to avoid it?
No. Sad

We also have a job that currently runs mwe2 files with Buckminster headless.
As I started to create this launcher feature I've tried to minimize ui dependencies as far as possible.
Maybe I overlooked something... I will review this again.



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: UI required when launching mwe2 headlessly? [message #1404421 is a reply to message #1404410] Fri, 01 August 2014 09:24 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

After checking the code I found this:
try {
	org.eclipse.debug.ui.RefreshTab.refreshResources(configuration, monitor);
} catch (CoreException e) {
	logger.error(e.getMessage(), e);
	return Status.OK_STATUS;
} catch (Throwable t){
	// In eclipse headless mode there are normally any ui bundles,
	// just ignore auto refresh
	logger.error(t.getMessage(), t);
	return Status.OK_STATUS;
}

I will remove the error log statement. Maybe we should create launch.ui bundle, it would be better.



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: UI required when launching mwe2 headlessly? [message #1404422 is a reply to message #1404421] Fri, 01 August 2014 09:36 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

We decided to set the lower bound for eclipse runtime from 3.5 to 3.6. In helios, we can use RefreshUtil to refresh the WS after mwe2 run. So the code I've pasted before will become obsolete. Optional dependency to debug.ui will remain for a while.


+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: UI required when launching mwe2 headlessly? [message #1404445 is a reply to message #1404410] Fri, 01 August 2014 13:09 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 01/08/2014 09:48, Dennis Huebner wrote:
>> Is there some configuration option that can be set to avoid it?
> No. :(
>
> We also have a job that currently runs mwe2 files with Buckminster
> headless. As I started to create this launcher feature I've tried to
> minimize ui dependencies as far as possible.
> Maybe I overlooked something... I will review this again.

Hi

I've been using the mwe2 launcher feature
(org.eclipse.emf.mwe2.launcher.feature.group) for some time now in many
Buckminster builds and I've never experienced NoClassDefFoundErrors. At
least with version 2.5.1.

I was installing org.eclipse.emf.mwe2.launcher.feature.group in
Buckminster headless; Thomas, which feature are you installing?

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: UI required when launching mwe2 headlessly? [message #1404475 is a reply to message #1404393] Fri, 01 August 2014 15:18 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

Pushed changes to master. You can try 2.7 nightly tomorrow morning.


+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: UI required when launching mwe2 headlessly? [message #1404594 is a reply to message #1404445] Mon, 04 August 2014 11:18 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Lorenzo,

I'm using a brand new 'launch' actor that I just added to Buckminster so that I can express proper dependencies and prerequisites on the launch. It works just like the 'launch' command but can be specified in a cspec/cspex rather than in a command file.

I'm installing the bundle 'org.eclipse.emf.mwe2.launch' into my headless Buckminster. I've noticed that the error can be avoided by removing the following line from the launch configuration:

<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>

I don't really need that line since Buckminster does the refresh anyway so this is no longer a problem for me.

In general though, I think a design where UI and non-UI responsibilities are divided into separate bundles is worth enforcing at all times. Weird things happen when UI bundles are present in a headless build (workbench not started yet exceptions for instance) not to mention that downloading the full IDE when it's not needed for anything is less than ideal.
Re: UI required when launching mwe2 headlessly? [message #1404596 is a reply to message #1404475] Mon, 04 August 2014 11:29 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Thanks!
Re: UI required when launching mwe2 headlessly? [message #1404718 is a reply to message #1404594] Tue, 05 August 2014 09:18 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 04/08/2014 13:18, Thomas Hallgren wrote:
> Hi Lorenzo,
>
> I'm using a brand new 'launch' actor that I just added to Buckminster so
> that I can express proper dependencies and prerequisites on the launch.
> It works just like the 'launch' command but can be specified in a
> cspec/cspex rather than in a command file.
>

Hi Thomas

is this related to the 'postbind' action I see in the git repository?
So that it is possible, for instance, to automatically run the mwe2
workflows after a project is imported in the workspace?

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: UI required when launching mwe2 headlessly? [message #1404719 is a reply to message #1404718] Tue, 05 August 2014 09:21 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Quote:

is this related to the 'postbind' action I see in the git repository?
So that it is possible, for instance, to automatically run the mwe2
workflows after a project is imported in the workspace?

That's the idea, yes.
Re: UI required when launching mwe2 headlessly? [message #1404780 is a reply to message #1404719] Tue, 05 August 2014 17:09 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 05/08/2014 11:21, Thomas Hallgren wrote:
> Quote:
>> is this related to the 'postbind' action I see in the git repository?
>> So that it is possible, for instance, to automatically run the mwe2
>> workflows after a project is imported in the workspace?
>
> That's the idea, yes.

Uh! That's cool! :)
I'll have a look at what you do in geppetto then :)

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:Does your MWE2 workflow consume a lot of memory?
Next Topic:XtextResource out of sync after saving a XtextEditor
Goto Forum:
  


Current Time: Fri Apr 19 01:49:42 GMT 2024

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

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

Back to the top