|
Re: Possible to suppress UI elements in Xtext for batch mode execution of xtext? [message #1433785 is a reply to message #1431076] |
Mon, 29 September 2014 08:32 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Rohit,
if you run within Eclipse / Equinox, you have to be very careful to not
use a second Injector besides the one that is part of the UI plugin.
Please note that the UI plugin - even though it is called UI plugin -
does not necessarily need a UI. The bundle usually works fine in
headless mode. Thus I recommend the use the injector that is provided by
the UI plugins' activator in your batch application.
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 25.09.14 09:11, schrieb rohit ahuja:
> Hi All,
>
> I have a xtext based grammar, that I want to use in batch mode in Linux.
> The problem i am facing is that if the DISPLAY is not set, the grammar
> fails giving exceptions for NoClassDefFoundErr on some UI plugins.
>
> I would want to have no dependency to GUI when running in batch. I use
> the Guice.createInjector() to get the runtime module of the DSL, and
> apparently that is the problem area, so when the xtext parser is
> injected it probably enables some UI classes for editor.
> Is there a way to disable the GUI elements when we inject the parser?
>
>
> Below is the stack trace(not full):
>
> Disabling JDT use. : org/eclipse/jdt/ui/JavaUI
> Disabling JDT use. : org/eclipse/jdt/ui/JavaUI
> Failed to create injector for com.qualcomm.qti.csr.xtext.mydsl.MyDSL
> com.google.inject.internal.util.$ComputationException:
> java.lang.NoClassDefFoundError:
> org/eclipse/ui/actions/WorkspaceModifyOperation
> com.google.inject.internal.util.$ComputationException:
> com.google.inject.internal.util.$ComputationException:
> java.lang.NoClassDefFoundError:
> org/eclipse/ui/actions/WorkspaceModifyOperation
> at
> com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
>
> at
> com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
>
> at
> com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
>
> at com.google.inject.internal.FailableCache.get(FailableCache.java:50)
> at
> com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49)
>
> at
> com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:125)
>
> at
> com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:521)
>
> at
> com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:847)
>
> at
> com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:772)
>
> at
> com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:256)
>
> at
> com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
>
> at
> com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:853)
>
> at
> com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
> at
> com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
>
> at
> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:133)
>
> 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)
>
>
> Thanks,
> Rohit Ahuja
|
|
|
Re: Possible to suppress UI elements in Xtext for batch mode execution of xtext? [message #1434715 is a reply to message #1433785] |
Tue, 30 September 2014 13:29 |
rohit ahuja Messages: 27 Registered: February 2013 |
Junior Member |
|
|
Hi Sebastian,
Thanks for your reply.
Based on your suggestion i changed my injector, to use the Injector of the Activator in the UI Plugin like below
Injector injector = DSLActivator.getInstance().getInjector(DSLActivator.DSLName);
I also noticed that the Activator internally, calls Guice to create the Injector itself in the createInjector method, like below.
Module runtimeModule = getRuntimeModule(language);
Module sharedStateModule = getSharedStateModule();
Module uiModule = getUiModule(language);
Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule, uiModule);
return Guice.createInjector(mergedModule);
At the point of Guice.createInjector(), i get NoClassDefFoundErr, log below , Any suggestions??
com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: java.lang.NoClassDefFoundError: org/eclipse/ui/actions/WorkspaceModifyOperation
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
at com.google.inject.internal.FailableCache.get(FailableCache.java:50)
at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49)
at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:125)
at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:521)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:847)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:772) at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:256)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:853)
at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:133)
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)
...
Thanks,
Rohit Ahuja
|
|
|
Re: Possible to suppress UI elements in Xtext for batch mode execution of xtext? [message #1434729 is a reply to message #1434715] |
Tue, 30 September 2014 13:49 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Rohit,
you have to make sure that the bundle with the missing class is
contained in your product. PLease note that a bundle name with *.ui does
not necessarily mean that the bundle is not capable of working headless.
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 30.09.14 15:29, schrieb rohit ahuja:
> Hi Sebastian,
>
> Thanks for your reply.
>
> Based on your suggestion i changed my injector, to use the Injector of
> the Activator in the UI Plugin like below
>
> Injector injector =
> DSLActivator.getInstance().getInjector(DSLActivator.DSLName);
>
>
> I also noticed that the Activator internally, calls Guice to create the
> Injector itself in the createInjector method, like below.
>
>
> Module runtimeModule = getRuntimeModule(language);
> Module sharedStateModule = getSharedStateModule();
> Module uiModule = getUiModule(language);
> Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule,
> uiModule);
> return Guice.createInjector(mergedModule);
>
> At the point of Guice.createInjector(), i get NoClassDefFoundErr, log
> below , Any suggestions??
>
> com.google.inject.internal.util.$ComputationException:
> com.google.inject.internal.util.$ComputationException:
> java.lang.NoClassDefFoundError:
> org/eclipse/ui/actions/WorkspaceModifyOperation
> at
> com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
>
> at
> com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
>
> at
> com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
>
> at
> com.google.inject.internal.FailableCache.get(FailableCache.java:50)
> at
> com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49)
>
> at
> com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:125)
>
> at
> com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:521)
>
> at
> com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:847)
>
> at
> com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:772)
> at
> com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:256)
>
> at
> com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
>
> at
> com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:853)
>
> at
> com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
> at
> com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
>
> at
> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:133)
>
> 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)
> ..
>
>
> Thanks,
> Rohit Ahuja
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03148 seconds