eclipse-capella / capella

Open Source Solution for Model-Based Systems Engineering
https://mbse-capella.org
Eclipse Public License 2.0
236 stars 96 forks source link

Richtext editor fails to open with message "Failed to evaluate javascript expression" #2866

Open Kellindil opened 4 months ago

Kellindil commented 4 months ago

This happens by simply installing Capella (version irrelevant as far as I could see, but happened in 5.2 and 6.1), creating a new project and opening the "description" property tab on any element. Full stack trace copied below.

As far as I've analyzed, this is due to security policies on the user's machine, preventing eclipse from knowing the IE version it should use? This can be reproduced by creating a value named "Security_HKLM_only" in registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" and setting it to "1".

This can be solved by either of the following:

  1. Unset the "Security_HKLM_only" value within the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings"
  2. Manually create a DWORD value named "capella.exe" within registry key "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" and set it to 0x2af9 (11001, meaning "IE 11")

The "capella.exe" value does exist in HKCU, same path, but "Security_HKLM_only" prevents that value from being read by Capella, and Capella probably doesn't have write access in HKLM to create the needed value.

Ultimately, this should be an issue of the SWT browser (the embedded browser view and the eclipse help content won't work either if "Security_HKLM_only" is set to 1 without the corresponding "capella.exe" value in HKLM), but I believe it would be a nice to have in a Capella troubleshooting guide, such as what has been done for the "template.html" blocking issue some users encounter (https://github.com/eclipse-capella/capella/commit/dd742de317e95bb2626a1ac4386e2828de63e7ec).

More details about these registry values can be found from the IBM support pages at https://www.ibm.com/support/pages/node/6342891 and details on the security zones on the Microsoft forum at https://learn.microsoft.com/en-us/troubleshoot/developer/browsers/security-privacy/ie-security-zones-registry-entries .

org.eclipse.swt.SWTException: Failed to evaluate javascript expression at org.eclipse.swt.browser.WebBrowser$EvaluateFunction.function(WebBrowser.java:195) at org.eclipse.swt.browser.WebSite.Invoke(WebSite.java:809) at org.eclipse.swt.browser.WebSite$7.method6(WebSite.java:182) at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:120) at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method) at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:65) at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:575) at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:538) at org.eclipse.swt.browser.IE.execute(IE.java:1202) at org.eclipse.swt.browser.WebBrowser.nonBlockingExecute(WebBrowser.java:400) at org.eclipse.swt.browser.WebBrowser.evaluate(WebBrowser.java:450) at org.eclipse.swt.browser.WebBrowser.evaluate(WebBrowser.java:406) at org.eclipse.swt.browser.Browser.evaluate(Browser.java:670) at org.eclipse.swt.browser.Browser.evaluate(Browser.java:619) at org.eclipse.nebula.widgets.richtext.RichTextEditor$3.completed(RichTextEditor.java:297) at org.eclipse.swt.browser.IE.lambda$6(IE.java:656) at org.eclipse.swt.ole.win32.OleEventTable.sendEvent(OleEventTable.java:58) at org.eclipse.swt.ole.win32.OleEventSink.notifyListener(OleEventSink.java:160) at org.eclipse.swt.ole.win32.OleEventSink.Invoke(OleEventSink.java:128) at org.eclipse.swt.ole.win32.OleEventSink.access$1(OleEventSink.java:105) at org.eclipse.swt.ole.win32.OleEventSink$1.method6(OleEventSink.java:79) at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:120) at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3628) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1158) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1047) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154) at org.polarsys.capella.core.platform.sirius.ui.app.CapellaApplication.start(CapellaApplication.java:117) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) at org.eclipse.equinox.launcher.Main.run(Main.java:1447)