| Summary: | Exception when starting xtend.ui and xtend.check.ui plugins in head-less application | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] M2T | Reporter: | Ali AKAR <ali.akar82> | ||||
| Component: | Xpand | Assignee: | Sven Efftinge <sven.efftinge> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | karsten.thoms, r.sezestre, stephaneberle9 | ||||
| Version: | 1.0.1 | Flags: | karsten.thoms:
juno+
|
||||
| Target Milestone: | M2 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Hi Ali, when your application is head-less, why do you have to include UI plugins in your configuration? ~Karsten Hi Karsten, We have a tool based on Eclipse and the application (org.eclipse.equinox.app.IApplication) is shipped within the tool. I don't have any configuration file for the application, the configuration file is used for the whole tool (I don't know if we can have one configuration file per application shipped within the tool). To run the application the user point to myTool.exe and give the id of the application he want to launch (-application appId). Another issue is that I can't get ride from UI plugins since the plugin "org.eclipse.xtend.shared.ui" must be included in my configuration file and it required "org.eclipse.ui.ide" and "org.eclipse.ui.editors". I would like just to mention that my application don't have any dependency to both plugins. Below is the stack trace which show when is the CheckEditorPlugin is activated: The call to org.eclipse.xtend.shared.ui.Activator#getRegisteredResourceContributors() in org.eclipse.xtend.shared.ui.core.builder.XtendXpandBuilder.XtendXpandDeltaVisitor.XtendXpandDeltaVisitor(XtendXpandBuilder, IProgressMonitor) Thread [Worker-0] (Suspended (breakpoint at line 58 in CheckEditorPlugin)) CheckEditorPlugin.start(BundleContext) line: 58 BundleContextImpl$1.run() line: 783 AccessController.doPrivileged(PrivilegedExceptionAction<T>) line: not available [native method] BundleContextImpl.startActivator(BundleActivator) line: 774 BundleContextImpl.start() line: 755 BundleHost.startWorker(int) line: 370 BundleHost(AbstractBundle).start(int) line: 284 SecureAction.start(Bundle, int) line: 417 BundleLoader.setLazyTrigger() line: 265 EclipseLazyStarter.postFindLocalClass(String, Class, ClasspathManager) line: 106 ClasspathManager.findLocalClass(String) line: 453 DefaultClassLoader.findLocalClass(String) line: 216 BundleLoader.findLocalClass(String) line: 393 BundleLoader.findClassInternal(String, boolean, ClassLoader) line: 469 BundleLoader.findClass(String, boolean) line: 422 BundleLoader.findClass(String) line: 410 DefaultClassLoader.loadClass(String, boolean) line: 107 DefaultClassLoader(ClassLoader).loadClass(String) line: 247 BundleLoader.loadClass(String) line: 338 BundleHost.loadClass(String, boolean) line: 232 BundleHost(AbstractBundle).loadClass(String) line: 1197 EquinoxRegistryStrategy(RegistryStrategyOSGI).createExecutableExtension(RegistryContributor, String, String) line: 174 ExtensionRegistry.createExecutableExtension(RegistryContributor, String, String) line: 904 ConfigurationElement.createExecutableExtension(String) line: 243 ConfigurationElementHandle.createExecutableExtension(String) line: 55 Activator.getRegisteredResourceContributors() line: 189 XtendXpandBuilder$XtendXpandDeltaVisitor.<init>(XtendXpandBuilder, IProgressMonitor) line: 65 XtendXpandBuilder.fullBuild(IProgressMonitor) line: 300 XtendXpandBuilder.build(int, Map, IProgressMonitor) line: 158 BuildManager$2.run() line: 629 SafeRunner.run(ISafeRunnable) line: 42 BuildManager.basicBuild(int, IncrementalProjectBuilder, Map, MultiStatus, IProgressMonitor) line: 172 BuildManager.basicBuild(IProject, int, ICommand[], MultiStatus, IProgressMonitor) line: 203 BuildManager$1.run() line: 255 SafeRunner.run(ISafeRunnable) line: 42 BuildManager.basicBuild(IProject, int, MultiStatus, IProgressMonitor) line: 258 BuildManager.basicBuildLoop(IProject[], IProject[], int, MultiStatus, IProgressMonitor) line: 311 BuildManager.build(int, IProgressMonitor) line: 343 AutoBuildJob.doBuild(IProgressMonitor) line: 144 AutoBuildJob.run(IProgressMonitor) line: 242 Worker.run() line: 54 Created attachment 204006 [details] patch for bug 358071 this patch applies the changes described in the description to the codebase OK for the patch ! Applied and reviewed the patch. Thanks for submitting. Bug resolved before Xpand 1.2 release date => Closing |
In my head-less application, which use Xpand/Xtend/Check, when the framework attempt to start org.eclipse.xtend.ui and org.eclipse.xtend.check.ui an exception is thrown which prevent the plugin to start normally. In both start methods PreferencesConstants.initializeDefaultValues(getPreferenceStore()) is called which cause the exception. I fixed the problem by the above code in both methods: org.eclipse.xtend.check.ui.CheckEditorPlugin.start(BundleContext) org.eclipse.xtend.ui.XtendEditorPlugin.start(BundleContext) public void start(final BundleContext context) throws Exception { super.start(context); if(PlatformUI.isWorkbenchRunning()){ Activator.getDefault(); PreferencesConstants.initializeDefaultValues(getPreferenceStore()); } }