Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Guice Error when Xtext builder runs in Eclipse Headless
Guice Error when Xtext builder runs in Eclipse Headless [message #535989] Wed, 26 May 2010 15:00 Go to next message
majid  is currently offline majid Friend
Messages: 72
Registered: November 2009
Member
Hi all,
while running my eclipse(3.5) in headless mode i get this error:
[main] ERROR org.eclipse.xtext.ui.shared.internal.Activator - Error initializing org.eclipse.xtext.ui.shared:Guice provision errors:

[exec] 1) null returned by binding at org.eclipse.xtext.ui.shared.internal.SharedModule.configure( SharedModule.java:58)
[exec] but org.eclipse.xtext.builder.builderState.EMFBasedPersister.wor kbench is not @Nullable
[exec] while locating org.eclipse.ui.IWorkbench
[exec] for field at org.eclipse.xtext.builder.builderState.EMFBasedPersister.wor kbench(EMFBasedPersister.java:37)
[exec] while locating org.eclipse.xtext.builder.builderState.EMFBasedPersister
[exec] while locating org.eclipse.xtext.builder.builderState.PersistableResourceDe scriptionsImpl$PersistedStateProvider
[exec] for field at org.eclipse.xtext.builder.builderState.PersistableResourceDe scriptionsImpl.persister(PersistableResourceDescriptionsImpl .java:148)
[exec] while locating org.eclipse.xtext.builder.builderState.PersistableResourceDe scriptionsImpl
[exec] while locating org.eclipse.xtext.builder.builderState.IBuilderState
[exec] for field at org.eclipse.xtext.builder.impl.ToBeBuiltComputer.builderStat e(ToBeBuiltComputer.java:36)
[exec] while locating org.eclipse.xtext.builder.impl.javasupport.JdtToBeBuiltCompu ter
[exec] while locating org.eclipse.xtext.builder.impl.ToBeBuiltComputer
[exec] for field at org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener .toBeBuiltComputer(ProjectOpenedOrClosedListener.java:39)
[exec] while locating org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener
[exec] while locating org.eclipse.core.resources.IResourceChangeListener annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.builde r.impl.ProjectOpenedOrClosedListener)
[exec] at org.eclipse.xtext.ui.shared.internal.ComposedResourceChangeL istener. <init>(ComposedResourceChangeListener.java:15)
[exec] while locating org.eclipse.xtext.ui.shared.internal.ComposedResourceChangeL istener
[exec] for field at org.eclipse.xtext.ui.shared.internal.Activator.resourceChang eListener(Activator.java:21)
[exec] while locating org.eclipse.xtext.ui.shared.internal.Activator

This error occurs when trying to open Xtext editor.

N.B i found this topic in https://bugs.eclipse.org/bugs/show_bug.cgi?id=304520 and even if it said that it was fixed , i'm having the problem in the 1.0.0M6 version of xtext.


Thank you In advance



Re: Guice Error when Xtext builder runs in Eclipse Headless [message #536224 is a reply to message #535989] Thu, 27 May 2010 12:40 Go to previous messageGo to next message
majid  is currently offline majid Friend
Messages: 72
Registered: November 2009
Member
No ideas?
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #536233 is a reply to message #536224] Thu, 27 May 2010 13:00 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
mjido schrieb:
> No ideas?

You should definitely provide the informtion you have in the mentioned
bugzilla.

Sven

--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #536282 is a reply to message #535989] Thu, 27 May 2010 14:37 Go to previous messageGo to next message
Zakarov is currently offline ZakarovFriend
Messages: 24
Registered: January 2010
Junior Member
Hi every body ,

i have a similar problem ; i run my eclipse in headless mode and the plugin executed contains the code :

IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
IEditorPart part = null;
try {
part = page.openEditor(editorInput, "com.myxtext.editor");
}...........

What is exactly the problem ?
P.S even in the headless , i gave the eclipse a workspace ..

Best Wishes.


Zakarov
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #536308 is a reply to message #536282] Thu, 27 May 2010 14:46 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Zakarov schrieb:
> Hi every body ,
>
> i have a similar problem ; i run my eclipse in headless mode and the
> plugin executed contains the code :
>
> IWorkbenchWindow
> window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> IWorkbenchPage page = window.getActivePage();
> IEditorPart part = null;
> try {
> part = page.openEditor(editorInput, "com.myxtext.editor");
> }...........
>

Running headless usually means without UI, so there's no Workbench
available.

What do you mean by headless? What do you want to do?

Sven


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #536330 is a reply to message #535989] Thu, 27 May 2010 16:42 Go to previous messageGo to next message
Zakarov is currently offline ZakarovFriend
Messages: 24
Registered: January 2010
Junior Member
running headless means runing some plugins or features

without launching eclipse ; we will invoke only the plugin

the equinox launcher . for more details :
http://www.eclipse.org/articles/Article-PDE-Automation/autom ation.html


Zakarov
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #536361 is a reply to message #536330] Thu, 27 May 2010 18:55 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Zakarov schrieb:
> running headless means runing some plugins or features
>
> without launching eclipse ; we will invoke only the plugin
> the equinox launcher . for more details :
> http://www.eclipse.org/articles/Article-PDE-Automation/autom ation.html

without launching eclipse means without the workbench (and the ui).
The code you showed used the workbench and opened an editor.
Does that code come from Xtext's builder infrastructure?

Sven

--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #537378 is a reply to message #535989] Wed, 02 June 2010 08:55 Go to previous messageGo to next message
Zakarov is currently offline ZakarovFriend
Messages: 24
Registered: January 2010
Junior Member
Hi Sven ,

first sorry for my late reply ,

even if i run the plugin without launching eclipse , i give it a workspace folder as an argument,

the code showed up , is a part of my plugin code .It reads a input from the workspace , and tries to open a xtext editor and then close it.

P.S opening and closing editor allows me to set some markers and references on my xtext file.

Thank you.


Zakarov
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #537593 is a reply to message #537378] Thu, 03 June 2010 04:33 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
As said before, the Workbench as well as any other UI things, such as
editors are not available in Eclipse Headless. IF you think you need all
that you'll have to start an IDE instance.

Sven


Zakarov schrieb:
> Hi Sven ,
>
> first sorry for my late reply ,
>
> even if i run the plugin without launching eclipse , i give it a
> workspace folder as an argument,
> the code showed up , is a part of my plugin code .It reads a input from
> the workspace , and tries to open a xtext editor and then close it.
>
> P.S opening and closing editor allows me to set some markers and
> references on my xtext file.
>
> Thank you.


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #545192 is a reply to message #537593] Wed, 07 July 2010 04:44 Go to previous messageGo to next message
Alex is currently offline AlexFriend
Messages: 114
Registered: June 2010
Senior Member
Hi,

I get the same error, when launching my plugin as a eclipse application.
0    [Start Level Event Dispatcher] ERROR org.eclipse.xtext.ui.shared.internal.Activator  - Error initializing org.eclipse.xtext.ui.shared:Guice provision errors:

1) null returned by binding at org.eclipse.xtext.ui.shared.internal.SharedModule.configure(SharedModule.java:61)
 but org.eclipse.xtext.builder.builderState.EMFBasedPersister.workbench is not @Nullable
  while locating org.eclipse.ui.IWorkbench
    for field at ...

1 error
com.google.inject.ProvisionException: Guice provision errors:

1) null returned by binding at org.eclipse.xtext.ui.shared.internal.SharedModule.configure(SharedModule.java:61)
 but org.eclipse.xtext.builder.builderState.EMFBasedPersister.workbench is not @Nullable
  while locating org.eclipse.ui.IWorkbench
    for field at ...

1 error
	at com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:370)
	at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:66)
	at ...


I just created a product configuration for exporting my editor as an eclipse product and wanted to (test) launch the product as an eclipse application. The new eclipse will start properly but there are errors (see above) in the console of the eclipse from where i launch the "product eclipse".

How could I avoid these errors?
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #545533 is a reply to message #545192] Thu, 08 July 2010 07:47 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
It looks like the error is raised, because your application doesn't
include org.eclipse.resources, which is required by the default
implementation of the builder infrastructure.

Sven


Am 7/7/10 6:44 AM, schrieb Alex:
> Hi,
>
> I get the same error, when launching my plugin as a eclipse application.
> 0 [Start Level Event Dispatcher] ERROR
> org.eclipse.xtext.ui.shared.internal.Activator - Error initializing
> org.eclipse.xtext.ui.shared:Guice provision errors:
>
> 1) null returned by binding at
> org.eclipse.xtext.ui.shared.internal.SharedModule.configure( SharedModule.java:61)
>
> but org.eclipse.xtext.builder.builderState.EMFBasedPersister.wor kbench
> is not @Nullable
> while locating org.eclipse.ui.IWorkbench
> for field at ...
>
> 1 error
> com.google.inject.ProvisionException: Guice provision errors:
>
> 1) null returned by binding at
> org.eclipse.xtext.ui.shared.internal.SharedModule.configure( SharedModule.java:61)
>
> but org.eclipse.xtext.builder.builderState.EMFBasedPersister.wor kbench
> is not @Nullable
> while locating org.eclipse.ui.IWorkbench
> for field at ...
>
> 1 error
> at
> com.google.inject.internal.Errors.throwProvisionExceptionIfE rrorsExist(Errors.java:370)
>
> at
> com.google.inject.MembersInjectorImpl.injectMembers(MembersI njectorImpl.java:66)
>
> at ...
>
>
> I just created a product configuration for exporting my editor as an
> eclipse product and wanted to (test) launch the product as an eclipse
> application. The new eclipse will start properly but there are errors
> (see above) in the console of the eclipse from where i launch the
> "product eclipse".
>
> How could I avoid these errors?


--
--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Guice Error when Xtext builder runs in Eclipse Headless [message #665022 is a reply to message #545533] Tue, 12 April 2011 21:11 Go to previous message
Mirko Raner is currently offline Mirko RanerFriend
Messages: 125
Registered: July 2009
Location: New York City, NY
Senior Member
Sven Efftinge wrote on Thu, 08 July 2010 00:47
It looks like the error is raised, because your application doesn't
include org.eclipse.resources, which is required by the default
implementation of the builder infrastructure.

Hi Sven,

we just ran into exactly the same problem that Alex reported, i.e. we are running as a regular Eclipse workbench, not in headless mode. The full stack trace is at the end of this post. I'd just like to better understand the fix that you proposed.
The stack trace suggests that there is a problem binding the IWorkbench implementation instance in SharedModule.java, line 61:
		bind(IWorkbench.class).toProvider(new Provider<IWorkbench>() {
			public IWorkbench get() {
				if (PlatformUI.isWorkbenchRunning())
					return PlatformUI.getWorkbench();
				return null;
			}
		});

So, it appears that the workbench is not running (or not running yet), though I have no idea how that could be because we are starting a workbench when we receive the stack trace. Our runtime includes about 15 custom plug-ins, most of them related to various Xtext grammars, which have certain dependencies between. Of the two plug-ins that seem to be in the path of this problem (com.intuit.interview.iedit.dialog.ui and com.intuit.eclipse.xtext.iunit.ui) neither one indeed declares a direct dependency on org.eclipse.core.resources (I haven't looked at transitive, re-exported dependencies yet).
I don't quite understand how to get from something that seems to be amiss with the UI set-up and workbench initialization to a missing org.eclipse.core.resources dependency. Unfortunately, I cannot immediately verify whether your suggested fix works, but I'd like to better understand how your suggestion relates to the problem.

Thanks for clarifying,

Mirko

Full stack trace below:
155  [Start Level Event Dispatcher] ERROR org.eclipse.xtext.ui.shared.internal.Activator  - Error initializing org.eclipse.xtext.ui.shared:Guice provision errors:
1) null returned by binding at org.eclipse.xtext.ui.shared.internal.SharedModule.configure(SharedModule.java:61)
 but org.eclipse.xtext.builder.builderState.EMFBasedPersister.workbench is not @Nullable
  while locating org.eclipse.ui.IWorkbench
    for field at org.eclipse.xtext.builder.builderState.EMFBasedPersister.workbench(EMFBasedPersister.java:39)
  while locating org.eclipse.xtext.builder.builderState.EMFBasedPersister
  while locating org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl$PersistedStateProvider
    for field at org.eclipse.xtext.builder.builderState.AbstractBuilderState.persister(AbstractBuilderState.java:94)
  while locating org.eclipse.xtext.builder.clustering.ClusteringBuilderState
  while locating org.eclipse.xtext.builder.builderState.IBuilderState
    for field at org.eclipse.xtext.builder.impl.ToBeBuiltComputer.builderState(ToBeBuiltComputer.java:33)
  while locating com.intuit.eclipse.xtext.iunit.ui.IUnitToBeBuiltComputer
  while locating org.eclipse.xtext.builder.impl.ToBeBuiltComputer
    for field at org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener.toBeBuiltComputer(ProjectOpenedOrClosedListener.java:41)
  while locating org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener
  while locating org.eclipse.core.resources.IResourceChangeListener annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener)
  at org.eclipse.xtext.ui.shared.internal.ComposedResourceChangeListener.<init>(ComposedResourceChangeListener.java:24)
  while locating org.eclipse.xtext.ui.shared.internal.ComposedResourceChangeListener
    for field at org.eclipse.xtext.ui.shared.internal.Activator.resourceChangeListener(Activator.java:27)
  while locating org.eclipse.xtext.ui.shared.internal.Activator
1 error
com.google.inject.ProvisionException: Guice provision errors:
1) null returned by binding at org.eclipse.xtext.ui.shared.internal.SharedModule.configure(SharedModule.java:61)
 but org.eclipse.xtext.builder.builderState.EMFBasedPersister.workbench is not @Nullable
  while locating org.eclipse.ui.IWorkbench
    for field at org.eclipse.xtext.builder.builderState.EMFBasedPersister.workbench(EMFBasedPersister.java:39)
  while locating org.eclipse.xtext.builder.builderState.EMFBasedPersister
  while locating org.eclipse.xtext.builder.builderState.PersistableResourceDescriptionsImpl$PersistedStateProvider
    for field at org.eclipse.xtext.builder.builderState.AbstractBuilderState.persister(AbstractBuilderState.java:94)
  while locating org.eclipse.xtext.builder.clustering.ClusteringBuilderState
  while locating org.eclipse.xtext.builder.builderState.IBuilderState
    for field at org.eclipse.xtext.builder.impl.ToBeBuiltComputer.builderState(ToBeBuiltComputer.java:33)
  while locating com.intuit.eclipse.xtext.iunit.ui.IUnitToBeBuiltComputer
  while locating org.eclipse.xtext.builder.impl.ToBeBuiltComputer
    for field at org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener.toBeBuiltComputer(ProjectOpenedOrClosedListener.java:41)
  while locating org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener
  while locating org.eclipse.core.resources.IResourceChangeListener annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener)
  at org.eclipse.xtext.ui.shared.internal.ComposedResourceChangeListener.<init>(ComposedResourceChangeListener.java:24)
  while locating org.eclipse.xtext.ui.shared.internal.ComposedResourceChangeListener
    for field at org.eclipse.xtext.ui.shared.internal.Activator.resourceChangeListener(Activator.java:27)
  while locating org.eclipse.xtext.ui.shared.internal.Activator
1 error
        at com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:370)
        at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:66)
        at com.google.inject.InjectorImpl.injectMembers(InjectorImpl.java:726)
        at org.eclipse.xtext.ui.shared.internal.Activator.initializeInjector(Activator.java:79)
        at org.eclipse.xtext.ui.shared.internal.Activator.start(Activator.java:98)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
        at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
        at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
        at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
        at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
        at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at com.intuit.interview.iedit.dialog.ui.internal.DialogActivator.getSharedStateModule(DialogActivator.java:70)
        at com.intuit.interview.iedit.dialog.ui.internal.DialogActivator.start(DialogActivator.java:39)
        at com.intuit.interview.iedit.dialog.ui.DialogUIActivator.start(DialogUIActivator.java:45)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
        at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
        at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
        at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
        at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
        at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
        at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)

Previous Topic:It is possible to validate an CrossReference in a String?
Next Topic:Run the text generation from my editor
Goto Forum:
  


Current Time: Thu Apr 25 08:32:02 GMT 2024

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

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

Back to the top