| Summary: | Hard requirement on JDT in Xtext 2.0 | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Henrik Lindberg <henrik.lindberg> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | CC: | clay, hendrik, Kenn.Hussey, mark.g.j.christiaens, pwebster, sebastian.zarnekow, sven.efftinge |
| Version: | 2.0.0 | Flags: | sebastian.zarnekow:
indigo+
|
| Target Milestone: | RC1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
I confirm this. I just encountered the same issue with 2.0 M4 So... any chance this can be address in the Indigo timeframe. A required dependency on JDT is somewhat of a non-starter when trying to build DSL tooling for a language that has nothing to do with Java... tested without jdt and enabled builder integration and it seems like all which has to be done here is changing the (currently) required dependency from ui.shared -> common.types.ui to optional (+ removing any generator fragments creating dependencies to jdt like TypesGeneratorFragment and GeneratorFragment) Ok, please go ahead and push the change. pushed to master I updated our build to Xtext 2.0 M7, but I still can't run my Xtext plugin without JDT. There seems to be a dependency on JDT's JavaModelException. This is the error I get: !ENTRY org.apache.log4j 2 0 2011-05-05 14:03:51.831 !MESSAGE org.eclipse.xtext.ui.shared.internal.Activator - Disabling JDT use. : org/eclipse/jdt/core/JavaCore [Guice] Module execution: 74ms [Guice] Interceptors creation: 2ms [Guice] TypeListeners creation: 2ms [Guice] Scopes creation: 2ms [Guice] Converters creation: 0ms [Guice] Binding creation: 5ms [Guice] Private environment creation: 1ms [Guice] Injector construction: 0ms [Guice] Binding initialization: 0ms [Guice] Binding indexing: 0ms [Guice] Collecting injection requests: 0ms [Guice] Creating a bridge ClassLoader for org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@245102ff [Guice] Loading class org.eclipse.xtext.ui.editor.validation.MarkerCreator FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Creating a bridge ClassLoader for org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@48b91881 [Guice] Loading class org.eclipse.xtext.builder.builderState.MarkerUpdaterImpl FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.builder.impl.BuildScheduler FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.builder.builderState.EMFBasedPersister FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.builder.clustering.ClusteringBuilderState FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.builder.impl.DirtyStateAwareResourceDescriptions FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Creating a bridge ClassLoader for org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@34de4588 [Guice] Loading class org.eclipse.xtext.resource.XtextResourceSet FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@7d94a8eb [Guice] Loading class org.eclipse.xtext.ui.resource.SimpleResourceSetProvider FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.ui.resource.UriValidator FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.builder.impl.ToBeBuiltComputer FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.builder.impl.QueuedBuildData FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.builder.impl.ProjectOpenedOrClosedListener FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.ui.editor.DirtyStateManager FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.ui.notification.StateChangeEventBroker FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.builder.impl.RegistryBuilderParticipant FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.builder.impl.XtextBuilder FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@650a2bb0 [Guice] Loading class org.eclipse.xtext.ui.resource.Storage2UriMapperImpl FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Binding validation: 162ms [Guice] Static validation: 1ms [Guice] Instance member validation: 0ms [Guice] Provider verification: 0ms [Guice] Static member injection: 1ms [Guice] Instance injection: 0ms [Guice] Preloading singletons: 0ms [Guice] Creating a bridge ClassLoader for org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@f4c7f77 [Guice] Loading class org.eclipse.xtext.ui.shared.internal.ComposedResourceChangeListener FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@371c1463 [Guice] Module execution: 200ms [Guice] Interceptors creation: 0ms [Guice] TypeListeners creation: 0ms [Guice] Scopes creation: 1ms [Guice] Converters creation: 0ms [Guice] Binding creation: 8ms [Guice] Private environment creation: 0ms [Guice] Injector construction: 0ms [Guice] Loading class org.eclipse.xtext.validation.AbstractInjectableValidator FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@7d94a8eb [Guice] Loading class org.eclipse.xtext.validation.CompositeEValidator$EValidatorEqualitySupport FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@7d94a8eb [Guice] Loading class org.eclipse.xtext.validation.CompositeEValidator FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@7d94a8eb [Guice] Loading class org.eclipse.xtext.validation.EValidatorRegistrar FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@7d94a8eb [Guice] Creating a bridge ClassLoader for org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@6c1961f4 [Guice] Loading class com.sigasi.hdt.vhdl.validation.VhdlJavaValidator FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@e582a85 [Guice] Binding initialization: 30ms [Guice] Binding indexing: 0ms [Guice] Collecting injection requests: 0ms [Guice] Creating a bridge ClassLoader for org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@18312737 [Guice] Loading class com.sigasi.hdt.vhdl.ui.GlobalLibraryMapper FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@4df090d [Guice] Loading class org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer$CompositeImpl FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer$CompositeImpl FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.ui.editor.preferences.PreferenceStoreAccessImpl FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.ui.editor.preferences.PreferenceStoreAccessImpl FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.ui.editor.syntaxcoloring.PreferenceStoreAccessor FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 [Guice] Loading class org.eclipse.xtext.ui.editor.syntaxcoloring.TextAttributeProvider FastClass with com.google.inject.internal.BytecodeGen$BridgeClassLoader@52eb46e9 57349 [main] ERROR com.sigasi.hdt.vhdl.ui.internal.VhdlUiActivator - com.google.inject.internal.ComputationException: com.google.inject.internal.ComputationException: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaModelException com.google.inject.internal.ComputationException: com.google.inject.internal.ComputationException: com.google.inject.internal.ComputationException: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaModelException at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553) at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419) at com.google.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041) at com.google.inject.internal.FailableCache.get(FailableCache.java:46) at com.google.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52) at com.google.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57) at com.google.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377) at com.google.inject.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:645) at com.google.inject.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:581) at com.google.inject.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:172) at com.google.inject.InjectorImpl.getBindingOrThrow(InjectorImpl.java:132) at com.google.inject.InjectorImpl.getInternalFactory(InjectorImpl.java:651) at com.google.inject.FactoryProxy.notify(FactoryProxy.java:48) at com.google.inject.BindingProcessor.runCreationListeners(BindingProcessor.java:230) at com.google.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:131) 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.sigasi.hdt.vhdl.ui.internal.VhdlActivator.registerInjectorFor(VhdlActivator.java:47) at com.sigasi.hdt.vhdl.ui.internal.VhdlActivator.start(VhdlActivator.java:38) at com.sigasi.hdt.vhdl.ui.internal.VhdlUiActivator.start(VhdlUiActivator.java:64) 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.BundleLoader.findClassInternal(BundleLoader.java:469) 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(ClassLoader.java:266) at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:338) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:232) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1197) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174) at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55) at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:267) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:263) at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:235) at org.eclipse.ui.internal.EditorManager.createPart(EditorManager.java:845) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:609) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:271) at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1429) at org.eclipse.ui.internal.EditorManager$5.runWithException(EditorManager.java:942) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3515) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3164) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803) at org.eclipse.ui.internal.Workbench$31.runWithException(Workbench.java:1567) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3515) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3164) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575) at org.eclipse.equinox.launcher.Main.run(Main.java:1408) at org.eclipse.equinox.launcher.Main.main(Main.java:1384) Caused by: com.google.inject.internal.ComputationException: com.google.inject.internal.ComputationException: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaModelException at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553) at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419) at com.google.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041) at com.google.inject.internal.FailableCache.get(FailableCache.java:46) at com.google.inject.MembersInjectorStore.get(MembersInjectorStore.java:66) at com.google.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69) at com.google.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31) at com.google.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39) at com.google.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35) at com.google.inject.internal.FailableCache$1.apply(FailableCache.java:35) at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549) ... 88 more Caused by: com.google.inject.internal.ComputationException: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaModelException at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553) at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419) at com.google.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041) at com.google.inject.internal.FailableCache.get(FailableCache.java:46) at com.google.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52) at com.google.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57) at com.google.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377) at com.google.inject.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:645) at com.google.inject.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:581) at com.google.inject.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:172) at com.google.inject.InjectorImpl.getBindingOrThrow(InjectorImpl.java:132) at com.google.inject.InjectorImpl.createProviderBinding(InjectorImpl.java:225) at com.google.inject.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:610) at com.google.inject.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:581) at com.google.inject.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:172) at com.google.inject.InjectorImpl.getBindingOrThrow(InjectorImpl.java:132) at com.google.inject.InjectorImpl.getInternalFactory(InjectorImpl.java:651) at com.google.inject.SingleFieldInjector.<init>(SingleFieldInjector.java:44) at com.google.inject.MembersInjectorStore.getInjectors(MembersInjectorStore.java:113) at com.google.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:83) at com.google.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35) at com.google.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43) at com.google.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40) at com.google.inject.internal.FailableCache$1.apply(FailableCache.java:35) at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549) ... 98 more Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaModelException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2406) at java.lang.Class.getDeclaredConstructors(Class.java:1853) at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:185) at com.google.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:61) at com.google.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31) at com.google.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39) at com.google.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35) at com.google.inject.internal.FailableCache$1.apply(FailableCache.java:35) at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549) ... 122 more Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.core.JavaModelException at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506) 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(ClassLoader.java:266) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334) ... 132 more see last comment Hendrik, could you please provide some details on the configuration of your UI- and AbstractUIModule? Thanks. Hi Sebastian, I have overridden all bindings as stated in the documentation. What other details do you need? Hendrik. (In reply to comment #8) > Hendrik, could you please provide some details on the configuration of your UI- > and AbstractUIModule? Thanks. (In reply to comment #9) > Hi Sebastian, > > I have overridden all bindings as stated in the documentation. > What other details do you need? > > Hendrik. > Hi Hendrik, that information should be sufficient. If we cannot reproduce it on our site, we'll ask for more details. Thanks for the fast answer. I added these bindings to a newly created Xtext project (see comment #0): @Override public Class<? extends IResourceForEditorInputFactory> bindIResourceForEditorInputFactory() { return ResourceForIEditorInputFactory.class; } @Override public Class<? extends IResourceSetProvider> bindIResourceSetProvider() { return SimpleResourceSetProvider.class; } @Override public com.google.inject.Provider<org.eclipse.xtext.resource.containers.IAllContainersState> provideIAllContainersState() {return org.eclipse.xtext.ui.shared.Access.getWorkspaceProjectsState();} Afterwards, I had to remove the TypesGeneratorFragment, the XbaseGeneratorFragment and the CodeTemplatesGeneratorFragment from the mwe2 configuration to make sure that the project does not depend on JDT aware components. After running the mwe2 workflow, the editor showed up without any errors in the log - all plugins that matched *.jdt were removed from the launch config. Content assist worked as expected, the outline was present. "Open model element" worked, too. If the problem is still present for you, it'll be more than helpful if you could set a breakpoint in the classloader and dig into the transitive dependency that caused the JavaModelException to be requested. Hi Sebastian I carefully went through all steps in your comment #11 and something unexpected happened when launching Eclipse with our plugin. I first deselected all plugins in the run configuration, next enabled our UI plugin and next clicked 'add required plugins' (with "Include optional..." disabled). I can confirm that no JDT plugins are required. However why I clicked run, JDT is unexpectedly available in the launched Eclipse. (Help > About Eclipse > Installation Details > Plugins) Can you confirm that this is not the case in your test? If I use a target definition without JDT in it, it goes wrong as in comment #6 Hi Hendrik, I see this log message '.. Disabling JDT use. : org/eclipse/jdt/core/JavaCore', no ui contributions and nothing in the plugin registry. I deselected all the *.jdt plugins in my launch configuration manually. Could you please list the *.xtext.* plugins that you use in your launch config? I have: org.eclipse.xpand org.eclipse.xtend org.eclipse.xtend.profiler org.eclipse.xtend.typesystem.emf org.eclipse.xtend.typesystem.emf.ui org.eclipse.xtext org.eclipse.xtext.builder org.eclipse.xtext.common.types org.eclipse.xtext.common.types.shared org.eclipse.xtext.common.types.ui org.eclipse.xtext.ecore org.eclipse.xtext.generator org.eclipse.xtext.logging org.eclipse.xtext.ui org.eclipse.xtext.ui.codetemplates org.eclipse.xtext.ui.codetemplates.ui org.eclipse.xtext.ui.ecore org.eclipse.xtext.ui.shared org.eclipse.xtext.util Does it help if your remove org.eclipse.xtext.common.types org.eclipse.xtext.common.types.shared org.eclipse.xtext.common.types.ui and org.eclipse.xtext.ui.codetemplates org.eclipse.xtext.ui.codetemplates.ui ? This does not help. I still get : 493 [main] ERROR com.sigasi.hdt.vhdl.ui.internal.VhdlUiActivator - com.google.inject.internal.ComputationException: com.google.inject.internal.ComputationException: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaModelException Would you please be so kind and try to set a (conditional) breakpoint in the NoClassDefFoundError in order to tackle the class that defines a dependency to the JavaModelException? A breakpoint in NoClassDefFoundError revealed that the exception occurs while loading org.eclipse.xtext.ui.util.PluginProjectFactory which depends on JDT We depend on this plugin because our project creator extends org.eclipse.xtext.ui.wizard.AbstractPluginProjectCreator which depends on JDT via it superclass org.eclipse.xtext.ui.wizard.AbstractProjectCreator. If I remove the project creator from our product, it works without JDT. Aren't we allowed to reuse the AbstractProjectCreator or is this a dependency that still has to be removed? Hendrik, a plugin project as it is created by the PluginProjectFactory is always a JavaProject. So it is valid to assume that the JDT is required if you bind this implementation. However, you could use your own org.eclipse.xtext.ui.wizard.AbstractProjectCreator that does not extend the org.eclipse.xtext.ui.wizard.AbstractPluginProjectCreator in order to get rid of the JDT dependencies. Sebastian, I'd prefer to not re-implement AbstractProjectCreator to avoid code duplication and license-issues. AbstractProjectCreator only depends on JDT because it adds the JDT nature and builder via the JavaCore.NATURE_ID and JavaCore.BUILDER_ID constants. If the string literals ( "org.eclipse.jdt.core.javanature" and "org.eclipse.jdt.core.javabuilder") were used instead, there would be no hard dependency on JDT. This is the approach that was used for the PDE builders in the same class. Subclasses can easily override getProjectNatures and getBuilders to get rid of the dependencies. If this is not an option, I propose to add an extra superclass on top of AbstractProjectCreator without JDT and PDE in the getProjectNatures and getBuilders methods. This would also allow easy implementation of new Project Wizards in languages independent of JDT. What do you think? Hendrik Hi Hendrik, string constants will be inlined by the compiler thus not lead to a dependency. Furthermore you could override #getProjectNatures and #getBuilders to get rid of the compile time dependency and to make sure only the desired natures / builders will be configured. Does that make sense? Regards, Sebastian I wrongfully assumed that JavaCore.BUILDER_ID caused the dependency and that the project was created through some string magic. The real JDT dependency comes through the PluginProjectFactory injection. I digged a little deeper, and it seems like the workaround is to add "pluginProject = false" in the SimpleProjectWizardFragment in the workflow. I will retry this from a clean workspace and confirm when this indeed is the solution. Adding "pluginProject = false" in the SimpleProjectWizardFragment in the workflow indeed removes the JDT dependency for the project setup wizard. I wanted to file a documentation request, but I found out it already exits; see bug 329992 Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
In Xtext 1.0 it is possible to remove the dependecy on JDT. With the same configuration for Xtext 2.0 JDT must be included. In 1.0 I added these to the ui module: @Override public Class<? extends IResourceForEditorInputFactory> bindIResourceForEditorInputFactory() { return ResourceForIEditorInputFactory.class; } @Override public Class<? extends IResourceSetProvider> bindIResourceSetProvider() { return SimpleResourceSetProvider.class; } @Override public com.google.inject.Provider<org.eclipse.xtext.resource.containers.IAllContainersState> provideIAllContainersState() {return org.eclipse.xtext.ui.shared.Access.getWorkspaceProjectsState();} In 2.0, the org.eclipse.xtext.ui.shared has a dependency on common.types.ui, which requires jdt.