Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with importing several projects(When several projects are imported into our product, only the first project is built)
Problem with importing several projects [message #1737223] Wed, 06 July 2016 13:09 Go to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hy guys,

we have an interesting problem in our product:

We are using the Xtext-Framework. We have registered a BuilderParticipant to do some things when the project is built.

Now we have the following problem:

We are importing several projects into our product. If this is the first time that these projects are imported, then the method "build" of org.eclipse.xtext.builder.impl.RegistryBuilderParticipant is only called for the first project that is imported.

If the projects are imported a second time (into the same workspace), then the "build" method is called for all projects.


Is this a known bug, or are we doing anything wrong?

Thanks for your help & kind regards! =)
Re: Problem with importing several projects [message #1737228 is a reply to message #1737223] Wed, 06 July 2016 13:25 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I suspect this is related to the platform's failure to batch up major
changes[1], consequently the first project import starts a rebuild
before the rest of the projects are available. Loss of the subsequent
builds may be an Xtext or platform bug. Later, all projects are there so
that a sensible build happens.

Please raise an Xtext Bugzilla.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=453551

Regards

Ed Willink


On 06/07/2016 15:09, Alexander Fichtinger wrote:
> Hy guys,
>
> we have an interesting problem in our product:
>
> We are using the Xtext-Framework. We have registered a
> BuilderParticipant to do some things when the project is built.
>
> Now we have the following problem:
>
> We are importing several projects into our product. If this is the first
> time that these projects are imported, then the method "build" of
> org.eclipse.xtext.builder.impl.RegistryBuilderParticipant is only called
> for the first project that is imported.
> If the projects are imported a second time (into the same workspace),
> then the "build" method is called for all projects.
>
>
> Is this a known bug, or are we doing anything wrong?
>
> Thanks for your help & kind regards! =)
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Re: Problem with importing several projects [message #1737235 is a reply to message #1737228] Wed, 06 July 2016 13:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Which xtext version do you use?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem with importing several projects [message #1737238 is a reply to message #1737235] Wed, 06 July 2016 14:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
one issue could be that the xtext.ui.shared plugin is activated too late.
maybe you can ensure it is loaded before the user starts the import.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem with importing several projects [message #1737239 is a reply to message #1737238] Wed, 06 July 2016 14:13 Go to previous messageGo to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Thanks for the fast replies =) .

We are using Xtext 2.10.0.
We will try the suggestion with the xtext.ui.shared plugin.
Re: Problem with importing several projects [message #1737332 is a reply to message #1737239] Thu, 07 July 2016 11:07 Go to previous messageGo to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hy Christian,

your solution works fine if we set auto-start true und the start level to 4 for the xtext.ui.shared plugin. BUT it works ONLY if we do this in the launch config and run the product in Eclipse.

If we set the start level and auto-start in the product configuration, then the following errors occur after the product is built (with Maven):

!STACK 0
org.osgi.framework.BundleException: Ausnahme in org.eclipse.core.resources.ResourcesPlugin.start() von Bundle org.eclipse.core.resources.
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.IllegalStateException: The instance data location has not been specified yet.
at org.eclipse.core.internal.runtime.DataArea.assertLocationInitialized(DataArea.java:54)
at org.eclipse.core.internal.runtime.DataArea.getStateLocation(DataArea.java:124)
at org.eclipse.core.internal.runtime.InternalPlatform.getStateLocation(InternalPlatform.java:539)
at org.eclipse.core.runtime.Plugin.getStateLocation(Plugin.java:319)
at org.eclipse.core.internal.resources.LocalMetaArea.<init>(LocalMetaArea.java:57)
at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:455)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
... 12 more

org.osgi.framework.BundleException: Ausnahme in org.eclipse.xtext.ui.shared.internal.Activator.start() von Bundle org.eclipse.xtext.ui.shared.
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/core/resources/IncrementalProjectBuilder
at org.eclipse.xtext.ui.shared.internal.SharedModule.configure(SharedModule.java:114)
at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements.getElements(Elements.java:101)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.eclipse.xtext.ui.shared.internal.Activator.initializeInjector(Activator.java:75)
at org.eclipse.xtext.ui.shared.internal.Activator.start(Activator.java:114)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
... 12 more

What can we do to avoid this?
We already tried to set the start-level and auto-start of org.eclipse.core.resources (start-level 4 and auto-start true), but this did not help.

Thanks! =)

Alex



Re: Problem with importing several projects [message #1737334 is a reply to message #1737332] Thu, 07 July 2016 11:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
sry i am not familiar with eclipse core to give you an answer in that.
the activation should ideally happen after the resource plugin is started.

do you have a own IApplication or use a std. one?
afaik there is a phase that is called right after the workspace was create?

e.g. in IDEWOrkbenchAdvisior.postStartup


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 07 July 2016 11:40]

Report message to a moderator

Re: Problem with importing several projects [message #1737342 is a reply to message #1737334] Thu, 07 July 2016 11:45 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i have filed https://github.com/eclipse/xtext-eclipse/issues/12

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:xbaseCompiler methods
Next Topic:Xtext & Sirius Integrate Problems
Goto Forum:
  


Current Time: Sun Apr 21 08:58:44 GMT 2024

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

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

Back to the top