Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Google Guice Exception starting my modelproject with XText2.0
Google Guice Exception starting my modelproject with XText2.0 [message #706758] Sun, 31 July 2011 21:18 Go to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 257
Registered: July 2009
Location: Germany
Senior Member
Hi to anyone,

since migrated my project to XText 2.0.0 I get an error at startup:
1) No implementation for org.eclipse.xtext.parser.antlr.ITokenDefProvider annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer.HIGHLIGHTING) was bound.
while locating org.eclipse.xtext.parser.antlr.ITokenDefProvider annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer.HIGHLIGHTING)
for parameter 0 at org.eclipse.xtext.ui.editor.model.TokenTypeToStringMapper.setTokenDefProvider(TokenTypeToStringMapper.java:30)
at org.eclipse.xtext.ui.editor.model.TokenTypeToStringMapper.setTokenDefProvider(TokenTypeToStringMapper.java:30)
while locating org.eclipse.xtext.ui.editor.model.ITokenTypeToPartitionTypeMapper
for parameter 1 at org.eclipse.xtext.ui.editor.model.DocumentPartitioner.<init>(DocumentPartitioner.java:22)
at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)

Could you please tell me, what concrete class I have to bind to the interface?


Thank you
Best regards

Markus

[Updated on: Sun, 31 July 2011 21:29]

Report message to a moderator

Re: Google Guice Exception starting my modelproject with XText2.0 [message #706764 is a reply to message #706758] Sun, 31 July 2011 21:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6543
Registered: July 2009
Senior Member
Hi,

your previous post and my answer on this somehow got lost

from a fresh created project

	// contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment
	public void configureHighlightingTokenDefProvider(com.google.inject.Binder binder) {
		binder.bind(org.eclipse.xtext.parser.antlr.ITokenDefProvider.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING)).to(org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class);
	}


~Christian
Re: Google Guice Exception starting my modelproject with XText2.0 [message #706803 is a reply to message #706764] Sun, 31 July 2011 22:39 Go to previous messageGo to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 257
Registered: July 2009
Location: Germany
Senior Member
OK, thank you for your fast answer....

guess this was.

Regards
Markus
Re: Google Guice Exception starting my modelproject with XText2.0 [message #706822 is a reply to message #706803] Sun, 31 July 2011 23:14 Go to previous messageGo to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 257
Registered: July 2009
Location: Germany
Senior Member
Hi,

Sorry, me again,

Once Guice Error more Sad

1) No implementation for org.eclipse.xtext.resource.IResourceDescriptions annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.LIVE_SCOPE) was bound.
while locating com.google.inject.Provider<org.eclipse.xtext.resource.IResourceDescriptions> annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.LIVE_SCOPE)
for field at org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.liveScopeResourceDescriptions(ResourceDescriptionsProvider.java:23)
while locating org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider
for field at org.eclipse.xtext.scoping.impl.AbstractGlobalScopeProvider.provider(AbstractGlobalScopeProvider.java:40)
at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)

What is this LIVE_SCOPE for? Do I need it, because I use the following currently:

// contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment
public void configureIResourceDescriptionsBuilderScope(com.google.inject.Binder binder) {
binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.scoping.impl.AbstractGlobalScopeProvider.NAMED_BUILDER_SCOPE)).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.class);
}

Is there somewhere a documentation for this configuration?

Thanks for all,
Best regards
Markus


Re: Google Guice Exception starting my modelproject with XText2.0 [message #707018 is a reply to message #706822] Mon, 01 August 2011 06:04 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 2961
Registered: July 2009
Senior Member
Hi Markus,

the LIVE_SCOPE is necessary for refactorings in the UI. It is save to
use the ResourceSetBasedResourceDescriptions there.

I wonder where all these Guice Errors come from. Is your workflow
properly configured? Are you sure that you do not mix Xtext 1.0 and
Xtext 2.0 dependencies?

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

On 01.08.11 01:14, Markus Oley wrote:
> Hi,
> Sorry, me again,
>
> Once Guice Error more :(
>
> 1) No implementation for
> org.eclipse.xtext.resource.IResourceDescriptions annotated with
> @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.LIVE_SCOPE) was
> bound.
> while locating
> com.google.inject.Provider<org.eclipse.xtext.resource.IResourceDescriptions>
> annotated with
> @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.LIVE_SCOPE)
> for field at
> org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.liveScopeResourceDescriptions(ResourceDescriptionsProvider.java:23)
>
> while locating org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider
> for field at
> org.eclipse.xtext.scoping.impl.AbstractGlobalScopeProvider.provider(AbstractGlobalScopeProvider.java:40)
>
> at
> org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)
>
>
> What is this LIVE_SCOPE for? Do I need it, because I use the following
> currently:
> // contributed by
> org.eclipse.xtext.generator.builder.BuilderIntegrationFragment
> public void
> configureIResourceDescriptionsBuilderScope(com.google.inject.Binder
> binder) {
> binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.scoping.impl.AbstractGlobalScopeProvider.NAMED_BUILDER_SCOPE)).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.class);
>
> }
>
> Is there somewhere a documentation for this configuration?
> Thanks for all, Best regards
> Markus
>
>
>
Re: Google Guice Exception starting my modelproject with XText2.0 [message #709841 is a reply to message #707018] Thu, 04 August 2011 11:18 Go to previous messageGo to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 257
Registered: July 2009
Location: Germany
Senior Member
Hi Sebastian,

I think we don't use any xtext 1.0 libs anymore.
We define our xtext-generator in a mwe-workflow like:
<compose class="org.eclipse.xtext.generator.CompositeGeneratorFragment">
<property name="genModels" value=""/>
<property name="basePackage" value=""/>
<property name="javaModelDirectory" value=""/>
<property name="xmiModelDirectory" value=""/>
<property name="generateDotDiagram" value=""/>
<property name="graphvizCommand" value=""/>
<property name="antlrBacktrack" value="false"/>

<!-- OM - 2010-07-20: Added Quickfix-support-->
<fragment class="org.eclipse.xtext.ui.generator.quickfix.QuickfixProviderFragment" />

<!-- Java API to access grammar elements (required by several other fragments) -->
<fragment class="org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment">
<xmlVersion value="1.0"/>
</fragment>

<!-- generates Java API for the generated EPackages -->
<!--
<fragment class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment"
genModels="${genModels}"
basePackage="${basePackage}"
javaModelDirectory="${javaModelDirectory}"
xmiModelDirectory="${xmiModelDirectory}"/>
-->

<!-- the serialization component -->
<fragment class="org.eclipse.xtext.generator.parseTreeConstructor.ParseTreeConstructorFragment"
generateDotDiagram="${generateDotDiagram}"
graphvizCommand="${graphvizCommand}" />

<!-- a custom ResourceFactory for use with EMF -->
<fragment class="org.eclipse.xtext.generator.resourceFactory.ResourceFactoryFragment"
fileExtensions="${fileExtensions}"/>

<!-- the following fragment tries to use the Antlr Generator fragment which can be downloaded from http://www.itemis.com
and falls back to the packrat parser if it's not available. -->
<fragment class="org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment">
<options backtrack="${antlrBacktrack}"/>
</fragment>


<!-- java-based API for validation -->
<fragment class="org.eclipse.xtext.generator.validation.JavaValidatorFragment" />

<!-- scoping API -->
<!-- <fragment class="org.eclipse.xtext.generator.scoping.JavaScopingFragment"/> -->

<fragment class="org.eclipse.xtext.generator.types.TypesGeneratorFragment"/>

<!-- formatter API -->
<fragment class="org.eclipse.xtext.generator.formatting.FormatterFragment"/>

<!-- labeling API -->
<fragment class="org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment"/>

<!-- outline API -->
<fragment class="org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment"/>
<fragment class="org.eclipse.xtext.ui.generator.outline.QuickOutlineFragment"/>

<fragment class="org.eclipse.xtext.generator.scoping.ImportNamespacesScopingFragment"/>
<fragment class="org.eclipse.xtext.generator.builder.BuilderIntegrationFragment"/>

<!-- java-based API for content assistance -->
<fragment class="org.eclipse.xtext.ui.generator.contentAssist.JavaBasedContentAssistFragment"/>
<!-- the following fragment tries to use the Antlr based content assist fragment which can be downloaded from http://www.itemis.com
and will be ignored if it's not available. -->
<fragment class="org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment">
<options backtrack="${antlrBacktrack}"/>
</fragment>
</compose>


for the concrete grammars.
We also have a common-grammar that isn't used itself but should only hold the things, the concrete grammars have in common.
This is defined so:
<compose class="org.eclipse.xtext.generator.CompositeGeneratorFragment">
<property name="generateDotDiagram" value=""/>
<property name="graphvizCommand" value=""/>
<property name="antlrBacktrack" value="false"/>

<!-- Java API to access grammar elements (required by several other fragments) -->
<fragment class="org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment">
<xmlVersion value="1.0"/>
</fragment>

<!-- java-based API for content assistance -->
<fragment class="org.eclipse.xtext.ui.generator.contentAssist.JavaBasedContentAssistFragment"/>

<fragment class="org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment">
<options backtrack="${antlrBacktrack}"/>
</fragment>

<!-- the serialization component -->
<fragment class="org.eclipse.xtext.generator.parseTreeConstructor.ParseTreeConstructorFragment"
generateDotDiagram="${generateDotDiagram}"
graphvizCommand="${graphvizCommand}" />
</compose>


For XText 1.0 this worked, but could it be, that the google-guice-errors come from this contruct?

Thanks for helping,

Best regards
Markus
Re: Google Guice Exception starting my modelproject with XText2.0 [message #710220 is a reply to message #709841] Thu, 04 August 2011 20:34 Go to previous messageGo to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 257
Registered: July 2009
Location: Germany
Senior Member
Hi Sebastian,

we have GMFeditors in our configuration. The UIModule of this plugin didn't extend any DefaultRuntimeModule and so I had to bind this by myself, so it didn't work out of the box.

But with your hint I got the binding working

Thanxs

Bye
Markus

Re: Google Guice Exception starting my modelproject with XText2.0 [message #715881 is a reply to message #710220] Mon, 15 August 2011 20:55 Go to previous messageGo to next message
Chetan Kumar is currently offline Chetan KumarFriend
Messages: 44
Registered: July 2009
Member
folks,

I have an xtext based editor developed on xtext 1.0.2. To migrate to xtext 2.0.0, I followed the instructions listed on xtext help. Added a couple of cosmetic additions to the outline tree. When I use the editor by launching plug-ins as an eclipse application the editor works fine. However, If I export it as a feature and install through an update-site the editor fails to open. Guice related exceptions are thrown like so:
Caused by: com.google.inject.CreationException: Guice creation errors:

1) No implementation for org.eclipse.jface.text.rules.ITokenScanner was bound.
  while locating org.eclipse.jface.text.rules.ITokenScanner
    for parameter 0 at org.eclipse.xtext.ui.editor.syntaxcoloring.PresentationRepairer.<init>(PresentationRepairer.java:22)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)

2) No implementation for org.eclipse.xtext.resource.IResourceDescriptions annotated with @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.namespaces.DefaultGlobalScopeProvider.BUILDER_SCOPE) was bound.
  at com.netapp.autozapi.eclipse.ui.AbstractZapidocUiModule.configureIResourceDescriptionsBuilderScope(AbstractZapidocUiModule.java:58)

2 errors
	at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
	at com.google.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:152)
	at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:105)
	at com.google.inject.Guice.createInjector(Guice.java:92)
	at com.google.inject.Guice.createInjector(Guice.java:69)
	at com.google.inject.Guice.createInjector(Guice.java:59)
	at com.netapp.autozapi.eclipse.ui.internal.ZapidocActivator.start(ZapidocActivator.java:38)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
	... 47 more


I am sure that I don't have any xtext 1.0.x dependencies in target platform. Target platform has Xtext 2.0.0, EMF 2.7.0, Eclipse 3.7.0, MWE 2.0.0. What can the problem be ?

+ Chetan

Re: Google Guice Exception starting my modelproject with XText2.0 [message #715887 is a reply to message #715881] Mon, 15 August 2011 21:05 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2501
Registered: July 2009
Senior Member
Maybe you forgot to set a min version for some of the dependencies in
your bundles? When installed elsewhere the dependencies will be
satisfied with xtext bundles that are too old.

It works in self hosted mode because (unless you change the defaults),
the running Eclipse will have all bundles from the TP as well as all in
your workspace.

- henrik

On 8/15/11 10:55 PM, Chetan Kumar wrote:
> folks,
>
> I have an xtext based editor developed on xtext 1.0.2. To migrate to
> xtext 2.0.0, I followed the instructions listed on xtext help. Added a
> couple of cosmetic additions to the outline tree. When I use the editor
> by launching plug-ins as an eclipse application the editor works fine.
> However, If I export it as a feature and install through an update-site
> the editor fails to open. Guice related exceptions are thrown like so:
> Caused by: com.google.inject.CreationException: Guice creation errors:
>
> 1) No implementation for org.eclipse.jface.text.rules.ITokenScanner was
> bound.
> while locating org.eclipse.jface.text.rules.ITokenScanner
> for parameter 0 at
> org.eclipse.xtext.ui.editor.syntaxcoloring.PresentationRepairer.<init>(PresentationRepairer.java:22)
>
> at
> org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)
>
>
> 2) No implementation for
> org.eclipse.xtext.resource.IResourceDescriptions annotated with
> @com.google.inject.name.Named(value=org.eclipse.xtext.scoping.namespaces.DefaultGlobalScopeProvider.BUILDER_SCOPE)
> was bound.
> at
> com.netapp.autozapi.eclipse.ui.AbstractZapidocUiModule.configureIResourceDescriptionsBuilderScope(AbstractZapidocUiModule.java:58)
>
>
> 2 errors
> at
> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
>
> at
> com.google.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:152)
>
> at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:105)
> at com.google.inject.Guice.createInjector(Guice.java:92)
> at com.google.inject.Guice.createInjector(Guice.java:69)
> at com.google.inject.Guice.createInjector(Guice.java:59)
> at
> com.netapp.autozapi.eclipse.ui.internal.ZapidocActivator.start(ZapidocActivator.java:38)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
>
> ... 47 more
>
> I am sure that I don't have any xtext 1.0.x dependencies in target
> platform. Target platform has Xtext 2.0.0, EMF 2.7.0, Eclipse 3.7.0, MWE
> 2.0.0. What can the problem be ?
>
> + Chetan
>
>
Re: Google Guice Exception starting my modelproject with XText2.0 [message #716104 is a reply to message #715887] Tue, 16 August 2011 13:17 Go to previous message
Chetan Kumar is currently offline Chetan KumarFriend
Messages: 44
Registered: July 2009
Member
Hello Henrik,

That was the problem. setting min version to dependencies solved the problem.
Thanks!

+ Chetan
Previous Topic:best way to handle conditional quickfixes
Next Topic:Problem with grammar Terminal element
Goto Forum:
  


Current Time: Thu Dec 18 17:29:17 GMT 2014

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

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