Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Upgrade from 2.4.3 to 2.6.2 Problem(1) No implementation for org.eclipse.xtext.ui.shared.contribution.ISharedStateContributionRegistry was bound.)
Upgrade from 2.4.3 to 2.6.2 Problem [message #1393858] Fri, 04 July 2014 11:32 Go to next message
Frank Baier is currently offline Frank BaierFriend
Messages: 7
Registered: July 2014
Junior Member
We ran xText 2.4.3 with Eclipse 3.7.1 and it worked well.

Running the same xText Project with Eclipse 4.3.1 and the latest xText Version (2.6.2.) results in an error:

com.google.inject.CreationException: Guice creation errors:

1) No implementation for org.eclipse.xtext.ui.shared.contribution.ISharedStateContributionRegistry was bound.
  while locating org.eclipse.xtext.ui.shared.contribution.ISharedStateContributionRegistry
    for parameter 0 at org.eclipse.xtext.builder.trace.StorageAwareTrace.initializeContributions(Unknown Source)
  at org.eclipse.xtext.builder.trace.StorageAwareTrace.initializeContributions(Unknown Source)
  while locating com.google.inject.Provider<org.eclipse.xtext.builder.trace.StorageAwareTrace>
    for field at org.eclipse.xtext.builder.trace.TraceForStorageProvider.traceToSourceProvider(Unknown Source)
  while locating org.eclipse.xtext.builder.trace.TraceForStorageProvider
    for field at org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2.fileBasedTraceInformation(Unknown Source)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)

2) No implementation for org.eclipse.xtext.ui.shared.contribution.ISharedStateContributionRegistry was bound.
  while locating org.eclipse.xtext.ui.shared.contribution.ISharedStateContributionRegistry
    for parameter 0 at org.eclipse.xtext.ui.resource.Storage2UriMapperImpl.initializeContributions(Unknown Source)
  at org.eclipse.xtext.ui.resource.Storage2UriMapperImpl.initializeContributions(Unknown Source)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)

2 errors
	at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
	at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:154)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
	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 ch.basler.service.dsl.ServiceDSLStandaloneSetupGenerated.createInjector(ServiceDSLStandaloneSetupGenerated.java:28)
	at ch.basler.service.dsl.ServiceDSLStandaloneSetupGenerated.createInjectorAndDoEMFRegistration(ServiceDSLStandaloneSetupGenerated.java:22)
	at ch.basler.service.dsl.ServiceDSLInjectorProvider.internalCreateInjector(ServiceDSLInjectorProvider.java:34)
	at ch.basler.service.dsl.ServiceDSLInjectorProvider.getInjector(ServiceDSLInjectorProvider.java:27)
	at ch.basler.service.dsl.ServiceDSLInjectorProvider.setupRegistry(ServiceDSLInjectorProvider.java:42)
	at org.eclipse.xtext.junit4.XtextRunner.methodBlock(XtextRunner.java:43)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)



Actions taken to solve the problem:
rebuild all, regenerate xText Artifacts, check the release note

Any hints, how to solve that?

Thanks a lot for your help
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1393983 is a reply to message #1393858] Fri, 04 July 2014 15:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
sure you updated org.eclipse.ui.shared as well.
there SharedModule class should contain the binding


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1395845 is a reply to message #1393983] Mon, 07 July 2014 13:38 Go to previous messageGo to next message
Frank Baier is currently offline Frank BaierFriend
Messages: 7
Registered: July 2014
Junior Member
Hi Christian,

thanks for the answer.
I suppose you mean

org.eclipse.xtext.ui.shared

which should be replaced.

Yes org.eclipse.xtext.ui.shared is upgraded as well.

I tried something differrent to be sure to exclude all the update problems:
I downloaded the whole bundle (Eclipse and xText together) but the problem persists

Furthermore I generated a new xText Project, included some xtend code - and it worked.
It seems that this is an upgrade issue for existing projects younger that 2.5

Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1395861 is a reply to message #1395845] Mon, 07 July 2014 13:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
did you compare the 2 projects?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1395874 is a reply to message #1395861] Mon, 07 July 2014 14:23 Go to previous messageGo to next message
Frank Baier is currently offline Frank BaierFriend
Messages: 7
Registered: July 2014
Junior Member
yes, I did and found a lot of differences - due to the different DSL naming. But no hint which led me to a solution.

should there be a classpath dependency between the plugin, and org.eclipse.xtext.ui.shared?
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1395875 is a reply to message #1395874] Mon, 07 July 2014 14:24 Go to previous messageGo to next message
Frank Baier is currently offline Frank BaierFriend
Messages: 7
Registered: July 2014
Junior Member
or do you have a hint for what to search?
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1395911 is a reply to message #1395875] Mon, 07 July 2014 15:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
You could do a breakpoint in the corresponding line of the Module that does the binding. is it ever called?
if you want to nail down the comparison then compare the activator classes


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1396527 is a reply to message #1395911] Tue, 08 July 2014 12:29 Go to previous messageGo to next message
Frank Baier is currently offline Frank BaierFriend
Messages: 7
Registered: July 2014
Junior Member
do you have a hint, at which point exactly the injection of the ISharedStateContributionRegistry is expected?
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1396554 is a reply to message #1396527] Tue, 08 July 2014 13:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
das i said: the class SharedModule should provide the binding

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1396557 is a reply to message #1396554] Tue, 08 July 2014 13:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
P.S: do you use mydslinjectorprovider to run a Ui Test?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1396581 is a reply to message #1396557] Tue, 08 July 2014 14:07 Go to previous messageGo to next message
Frank Baier is currently offline Frank BaierFriend
Messages: 7
Registered: July 2014
Junior Member
yes I use the injectorprovider. Our DSL is called ServiceDSL

Declartion of the unit test class:

import ch.basler.service.dsl.ServiceDSLInjectorProvider
import ch.basler.service.dsl.serviceDSL.ComplexTypeDef
import ch.basler.service.dsl.serviceDSL.Model
import com.google.inject.Inject
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.eclipse.xtext.junit4.util.ParseHelper
import org.junit.Test
import org.junit.runner.RunWith

import static org.junit.Assert.*

@InjectWith(typeof(ServiceDSLInjectorProvider))
@RunWith(typeof(XtextRunner))
class ITypeBaseTest {


SharedModule: neither configure() nor the constructor is called when I execute the unit test.

But: if i run ServiceDSL in runtimeEclipseMode SharedModule gets called (configure()), i can see in the debugger the execution of the line:
bind(ISharedStateContributionRegistry.class).to(SharedStateContributionRegistryImpl.class);
gets called - but the problem persists.


Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1396690 is a reply to message #1396581] Tue, 08 July 2014 16:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
why dont you use the uiinjectorprovider then?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1398022 is a reply to message #1396690] Thu, 10 July 2014 13:45 Go to previous messageGo to next message
Frank Baier is currently offline Frank BaierFriend
Messages: 7
Registered: July 2014
Junior Member
we found the originator of the problem:

in the DSLModule declaration we override like the following:
public class ServiceDSLRuntimeModule extends ch.basler.service.dsl.AbstractServiceDSLRuntimeModule {

 public Class<? extends EclipseResourceFileSystemAccess2> bindEclipseFSA() {
   return UTF8EclipseFilesSystemAccess.class;
   }


we need this as otherwise the generated sourcecode does not understand german umlauts.

UTF8EclipseFilesSystemAccess:

public class UTF8EclipseFilesSystemAccess extends EclipseResourceFileSystemAccess2 {

  private IProject project;
  private File projectFolder;

  @Override
  protected StringInputStream getInputStream(String contentsAsString, String encoding) {
    return super.getInputStream(contentsAsString, "UTF-8"); 
  }

  @Override
  public void setProject(IProject project) {
    this.project = project;
    IFile dotProject = project.getFile(".project");
    URI dotProjectURI = dotProject.getRawLocationURI();
    File dotProjectFile = new File(dotProjectURI);
    projectFolder = dotProjectFile.getParentFile();
    super.setProject(project);
  }

  public IProject getProject() {
    return project;
  }

  public File getProjectFolder() {
    return projectFolder;
  }

  public File getJavaIOFile(String path) {
    return getJavaIOFile(path, DEFAULT_OUTPUT);
  }

  private File getJavaIOFile(String path, String outputConfiguration) {
    org.eclipse.emf.common.util.URI uri = getURI(path, outputConfiguration);
    List<String> segmentsList = uri.segmentsList();
    List<String> subList = segmentsList.subList(2, segmentsList.size());
    File ret = getProjectFolder();
    for (String segment : subList) {
      ret = new File(ret, segment);
    }
    return ret;
  }
}


if I remove the binding, the generation works fine - but the umlauts don't work.

Any ideas, what's wrong with the implementation?

Cheers
Frank

Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1398042 is a reply to message #1398022] Thu, 10 July 2014 14:19 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
Hi,

the EclipseFilesSystemAccess is meant to be used in eclipse and not at runtime (standalone)
so the binding should be in the uimodule.

in the runtime module you should bind a subclass off JavaIoFileSystemaccess


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:clean temp folders created by xtext-maven-plugin
Next Topic:new run configuration eclipse from web
Goto Forum:
  


Current Time: Thu Dec 05 18:27:11 GMT 2019

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

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

Back to the top