IStorage2UriMapperJdtExtensions unbound in Xtext 2.4 [message #1036448] |
Mon, 08 April 2013 07:57  |
Eclipse User |
|
|
|
While migrating a tool from Xtext 2.3 to 2.4, launching fails with this exception:
com.google.inject.ConfigurationException: Guice configuration errors:
1) No implementation for org.eclipse.xtext.ui.resource.IStorage2UriMapperJdtExtensions was bound.
while locating org.eclipse.xtext.ui.resource.IStorage2UriMapperJdtExtensions
for field at org.eclipse.xtext.ui.resource.XtextResourceSetProvider.storage2UriMapper(Unknown Source)
while locating org.eclipse.xtext.ui.resource.XtextResourceSetProvider
1 error
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:961)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
...
Where should I be getting the binding for IStorage2UriMapperJdtExtensions from?
thanks,
Stephan
PS: I would be quite relaxed about this migration, but due to https://bugs.eclipse.org/403888 I'm no longer able to use Xtext 2.3.
|
|
|
|
Re: IStorage2UriMapperJdtExtensions unbound in Xtext 2.4 [message #1036485 is a reply to message #1036472] |
Mon, 08 April 2013 08:49   |
Eclipse User |
|
|
|
Hi Sebastian,
while searching my 2.3-based implementation and how this ever found its depedencies, I don't even see how XtextResourceSetProvider is bound, ups?
The injector in question belongs to the headless language plug-in (from which the model plug-in has been separated), the injector has been created using the module that is derived from the generated module which in turn extends DefaultRuntimeModule, so indeed, I don't see any specific connection to JDT.
The code in question is part of a test plug-in, which *does* have xtext.ui in its dependencies, so could that plug-in dependency contribute the XtextResourceSetProvider to all injectors?
best,
Stephan
|
|
|
Re: IStorage2UriMapperJdtExtensions unbound in Xtext 2.4 [message #1036506 is a reply to message #1036485] |
Mon, 08 April 2013 09:18  |
Eclipse User |
|
|
|
OK, I seem to have a workaround:
Previously, this worked like a breeze:
myInjector = Guice.createInjector(new MyDslRuntimeModule());
With xtext 2.4 I need this instead:
CompoundModule mod = new CompoundModule();
mod.add(new MyDslRuntimeModule());
mod.add(new Module() {
@Override
public void configure(Binder binder) {
binder.bind(IStorage2UriMapperJdtExtensions.class).to(Storage2UriMapperJavaImpl.class);
binder.bind(IJdtHelper.class).to(JdtHelper.class);
}
});
myInjector = Guice.createInjector(mod);
This also pulls in an additional dependency to xtext.ui.shared, hmpf.
As you'll certainly wonder, why I'm manually creating the injector: its a plug-in for combined unit tests involving several DSLs, so there's no "natural" way for obtaining an injector with all desired capabilities. But all that shouldn't be the point, in 2.3 it perfectly worked, and in 2.4 it works with the above workaround.
best,
Stephan
|
|
|
Powered by
FUDForum. Page generated in 0.26427 seconds