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.
!STACK 0
java.lang.NoSuchMethodException: org.eclipse.e4.ui.css.swt.internal.theme.BootstrapTheme3x.<init>(org.eclipse.swt.widgets.Display)
	at java.lang.Class.getConstructor0(Class.java:2706)
	at java.lang.Class.getConstructor(Class.java:1657)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2568)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:701)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:684)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at com.bocsoft.blade.ui.workbench.DefaultWorkbench.createUI(DefaultWorkbench.java:15)
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:172)
	at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:284)
	at java.lang.Thread.run(Thread.java:662)
	at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:105)

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) {
				WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING,
						"Could not start styling support.", //$NON-NLS-1$
						ex));
			}
...

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:
http://www.eclipse.org/forums/index.php/t/452925/
http://www.eclipse.org/forums/index.php/t/647527/
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