Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Possible conflict with RCP in workbench styling support(java.lang.NoSuchMethodException: org.eclipse.e4.ui.css.swt.internal.theme.BootstrapTheme3x.<init>(org.eclipse.swt.widgets.Display))
icon4.gif  Possible conflict with RCP in workbench styling support [message #1428720] Mon, 22 September 2014 08:31
Jonathan Zhang is currently offline Jonathan ZhangFriend
Messages: 1
Registered: September 2014
Junior Member
I was trying to develop a RAP application based on a set of RCP plugins. Some of them depend on the RCP workbench, and e4 css styling stuff. When my entry point is hit, I got the following exception(less important messages are omitted):
!ENTRY org.eclipse.rap.ui 2 2 2014-09-22 10:31:14.516
!MESSAGE Could not start styling support.
java.lang.NoSuchMethodException: org.eclipse.e4.ui.css.swt.internal.theme.BootstrapTheme3x.<init>(org.eclipse.swt.widgets.Display)
	at java.lang.Class.getConstructor0(
	at java.lang.Class.getConstructor(
	at org.eclipse.ui.internal.Workbench.runUI(
	at org.eclipse.ui.internal.Workbench.access$5(
	at org.eclipse.ui.internal.Workbench$
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
	at com.bocsoft.blade.ui.workbench.DefaultWorkbench.createUI(
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$

As I investigated the Workbench.runUI() method according to the stack trace, I found that it is trying to instantiate the BootstrapTheme3x class using reflection:
try {
				Class c = stylingBundle
						.loadClass("org.eclipse.e4.ui.css.swt.internal.theme.BootstrapTheme3x"); //$NON-NLS-1$
				Constructor constructor = c.getConstructor(new Class[] { Display.class });
				constructor.newInstance(new Object[] { display });
			} catch (Exception ex) {
						"Could not start styling support.", //$NON-NLS-1$

It is trying to get a constructor with a parameter of type Display (the one defined in the org.eclipse.rap.rwt plugin rather than the one in RCP swt plugin, I supposed). But the bundle "org.eclipse.e4.ui.css.swt.internal.theme.BootstrapTheme3x" is compiled using the Display class defined in the RCP swt plugin, I assumed that's what caused the issue.
I found some other guys have already encountered this issue before:
although they could work around it by not including the e4 styling plugin in the launch configuration, I can't because my existing RCP plugins need it and it can't be easily refactored. What can I do? Is it possible to improve the code in the mentioned Workbench.runUI() so that it can be compatible with RCP plugins? Or can I work around this issue?
Previous Topic:No images after emptying a tableviewer
Next Topic:CTabItems style broken in IE9 on RAP 2.2
Goto Forum:

Current Time: Sat Feb 22 23:40:15 GMT 2020

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

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

Back to the top