Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332350 - Binding Management raises AssertionError in pure e4 app
Summary: Binding Management raises AssertionError in pure e4 app
Status: RESOLVED INVALID
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 332352 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-10 17:54 EST by Brian de Alwis CLA
Modified: 2010-12-13 10:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2010-12-10 17:54:14 EST
BuildId: e4 M4 candidate (I20101209-1653, SDK I20101209-1744)

With my e4 app, I get an assertion error raised with a pure e4 app.  The assertion stems from  the BindingPersistence.readActiveScheme() trying to fetch the PlatformUI pref store (PlatformUI.getPreferenceStore()).  This call delegates to o.e.ui.i.PrefUtil which fails as its uiCallback has not been set -- it is only set by org.eclipse.ui's UIPlugin.

I think this *may* be relatively benign.  At least, execution mostly seems to work.  But the exception is  actually caught and reported by the injector, so much of the BindingToModelProcessor code isn't run.

Workaround: for now I've created a simple bundle that mimics UIPlugin's actions, and set it to auto-start at level 1.

Daemon Thread [Thread-0] (Suspended (exception AssertionFailedException))	
	Assert.isNotNull(Object, String) line: 85	
	Assert.isNotNull(Object) line: 73	
	PrefUtil.getAPIPreferenceStore() line: 64	
	PlatformUI.getPreferenceStore() line: 187	
	BindingPersistence.readActiveScheme(IConfigurationElement[], int, IMemento, BindingManager) line: 378	
	BindingPersistence.reRead() line: 1380	
	BindingPersistence.read() line: 1284	
	BindingToModelProcessor.process(MApplication) line: 60	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	MethodRequestor.execute() line: 52	
	InjectorImpl.invokeUsingClass(Object, Class<?>, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier, boolean) line: 226	
	InjectorImpl.invoke(Object, Class<Annotation>, PrimaryObjectSupplier) line: 196	
	ContextInjectionFactory.invoke(Object, Class<Annotation>, IEclipseContext) line: 86	
	ModelAssembler.runProcessor(IConfigurationElement) line: 219	
	ModelAssembler.processModel() line: 87	
	ResourceHandler.loadMostRecentModel() line: 233	
	E4Application.loadApplicationModel(IApplicationContext, IEclipseContext) line: 323	
	E4Application.createE4Workbench(IApplicationContext, Display) line: 191	
	E4Application.start(IApplicationContext) line: 116	
	EclipseAppHandle.run(Object) line: 196	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 369	
	EclipseStarter.run(String[], Runnable) line: 179	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Main.invokeFramework(String[], URL[]) line: 622	
	Main.basicRun(String[]) line: 577	
	Main.run(String[]) line: 1410	
	Main.main(String[]) line: 1386
Comment 1 Paul Webster CLA 2010-12-10 18:19:10 EST
BindingPersistence should only be running in a compat layer app. BindingToModelProcessor is the compat extension point to model translator.  That's being contributed from org.eclipse.ui.workbench (compat), is that included in your e4 app (or simply in your launch config)?


PW
Comment 2 Brian de Alwis CLA 2010-12-11 12:57:25 EST
(In reply to comment #1)
> BindingPersistence should only be running in a compat layer app.
> BindingToModelProcessor is the compat extension point to model translator. 
> That's being contributed from org.eclipse.ui.workbench (compat), is that
> included in your e4 app (or simply in your launch config)?

I am including org.eclipse.ui.workbench to pull in some useful classes.  But now that I look through the code, it seems it was just to pull in org.eclipse.ui.services.IDisposable (which I realize is used by old code that predates @PreDestroy), and org.eclipse.ui.preferences.ScopedPreferenceStore.

I've dropped all refs to o.e.ui.workbench and made a copy of ScopedPreferenceStore, and all is now well.
Comment 3 Paul Webster CLA 2010-12-13 09:55:59 EST
*** Bug 332352 has been marked as a duplicate of this bug. ***
Comment 4 Paul Webster CLA 2010-12-13 10:19:51 EST
You can only include o.e.ui.workbench if you are running the compatibility layer, as the extensions it contributes will be processed as soon as it is included.

PW