Bug 538335 - webkit2_BrowserProblem
Summary: webkit2_BrowserProblem
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.12 RC1   Edit
Assignee: Nikita Nemkin CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-08-28 06:29 EDT by Thomas Behr CLA
Modified: 2019-05-27 03:34 EDT (History)
3 users (show)

See Also:


Attachments
Test case for reproducing the above exception (1.20 KB, text/x-java)
2018-08-28 06:29 EDT, Thomas Behr CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Behr CLA 2018-08-28 06:29:14 EDT
Created attachment 275583 [details]
Test case for reproducing the above exception

java.lang.Throwable: 
	at org.eclipse.swt.browser.WebKit.getStackTrace(WebKit.java:437)
	at org.eclipse.swt.browser.WebKit.getInternalErrorMsg(WebKit.java:430)
	at org.eclipse.swt.browser.WebKit.access$200(WebKit.java:123)
	at org.eclipse.swt.browser.WebKit$Webkit2Extension.initializeWebExtensions_callback(WebKit.java:532)
	at org.eclipse.swt.internal.webkit.WebKitGTK._webkit_web_view_new(Native Method)
	at org.eclipse.swt.internal.webkit.WebKitGTK.webkit_web_view_new(WebKitGTK.java:1878)
	at org.eclipse.swt.browser.WebKit.create(WebKit.java:1079)
	at org.eclipse.swt.browser.Browser.<init>(Browser.java:99)
	at interoperability.swt.PureSwtTest.initializeSwt(PureSwtTest.java:43)
	at interoperability.swt.PureSwtTest.initialize(PureSwtTest.java:22)
	at interoperability.swt.PureSwtTest.main(PureSwtTest.java:50)

Steps to reproduce:
1. Compile and run the attached test case with Java 10.0.2

Operating system is Ubuntu 16.04 with GTK 3.18.9-1 / 2.24.30-1.
Does NOT happen with environment variable SWT_GTK3=0 set.

Additional console output:
Aug 28, 2018 12:10:04 PM com.sun.glass.ui.gtk.GtkApplication <clinit>
WARNING: SWT-GTK uses unsupported major GTK version 0. GTK3 will be used as default.
SWT Webkit.java Error: Could not find webkit extension. BrowserFunction functionality will not be available. 
(swt version: 4880) SWT Glue code version: 54.0 info: +BrowserFunction/GDBus, +WebkitExtension Folder versioning, +WebKitExtension OSGI support, +setUrl(..postData..), -setCookie(), -getCookie +mouseDown/Focus
WebKit2Gtk version 2.20.5
Comment 1 Eric Williams CLA 2019-02-01 14:00:20 EST
Do you still experience the issue with SWT 4.10? What about on Ubuntu 18.04?

Also the snippet attached uses Java FX, is it reproducible with a regular SWT Canvas?
Comment 2 Arseniy Skvortsov CLA 2019-02-21 03:03:48 EST
Wanted to look how does SWT perform under GNOME 3.30 with fractional scaling.
For this I've downloaded swt-4.10-gtk-linux-x86_64.zip and org.eclipse.sdk.examples.source-4.10.zip, unpacked these and launched
java -classpath swt.jar:plugins/org.eclipse.swt.examples_3.106.300.v20181018-1329.jar org.eclipse.swt.examples.controlexample.ControlExample

Looks very nice (except for double-wide square border in canvas example), but it just asked me to fill a bug like this one. :)

My environment:
Arch Linux
gnome-shell 3.30.2
gtk3 3.24.5
webkit2gtk 2.22.5


(swt version: 4922r32) SWT Glue code version: 54.0 info: +BrowserFunction/GDBus, +WebkitExtension Folder versioning, +WebKitExtension OSGI support, +setUrl(..postData..), -setCookie(), -getCookie +mouseDown/Focus

Stacktrace is almost the same, just line numbers are different:
java.lang.Throwable: 
	at org.eclipse.swt.browser.WebKit.getStackTrace(WebKit.java:489)
	at org.eclipse.swt.browser.WebKit.getInternalErrorMsg(WebKit.java:482)
	at org.eclipse.swt.browser.WebKit.access$200(WebKit.java:124)
	at org.eclipse.swt.browser.WebKit$Webkit2Extension.initializeWebExtensions_callback(WebKit.java:594)
	at org.eclipse.swt.internal.webkit.WebKitGTK._webkit_web_view_new(Native Method)
	at org.eclipse.swt.internal.webkit.WebKitGTK.webkit_web_view_new(WebKitGTK.java:1928)
	at org.eclipse.swt.browser.WebKit.create(WebKit.java:1142)
	at org.eclipse.swt.browser.Browser.<init>(Browser.java:102)
	at org.eclipse.swt.examples.controlexample.BrowserTab.createExampleWidgets(BrowserTab.java:98)
	at org.eclipse.swt.examples.controlexample.Tab.createTabFolderPage(Tab.java:1264)
	at org.eclipse.swt.examples.controlexample.BrowserTab.createTabFolderPage(BrowserTab.java:179)
	at org.eclipse.swt.examples.controlexample.ControlExample.<init>(ControlExample.java:71)
	at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlExample.java:225)
Comment 3 Arseniy Skvortsov CLA 2019-02-21 03:29:04 EST
Forgot about JDK:
Exactly the same under OpenJDK Runtime Environment (build 11.0.2+7) and OpenJDK Runtime Environment (build 1.8.0_202-b26).
Comment 4 Eric Williams CLA 2019-03-28 09:50:39 EDT
(In reply to Arseniy Skvortsov from comment #2)
> Wanted to look how does SWT perform under GNOME 3.30 with fractional scaling.
> For this I've downloaded swt-4.10-gtk-linux-x86_64.zip and
> org.eclipse.sdk.examples.source-4.10.zip, unpacked these and launched
> java -classpath
> swt.jar:plugins/org.eclipse.swt.examples_3.106.300.v20181018-1329.jar
> org.eclipse.swt.examples.controlexample.ControlExample
> 
> Looks very nice (except for double-wide square border in canvas example),
> but it just asked me to fill a bug like this one. :)
> 
> My environment:
> Arch Linux
> gnome-shell 3.30.2
> gtk3 3.24.5
> webkit2gtk 2.22.5
> 
> 
> (swt version: 4922r32) SWT Glue code version: 54.0 info:
> +BrowserFunction/GDBus, +WebkitExtension Folder versioning, +WebKitExtension
> OSGI support, +setUrl(..postData..), -setCookie(), -getCookie
> +mouseDown/Focus
> 
> Stacktrace is almost the same, just line numbers are different:
> java.lang.Throwable: 
> 	at org.eclipse.swt.browser.WebKit.getStackTrace(WebKit.java:489)
> 	at org.eclipse.swt.browser.WebKit.getInternalErrorMsg(WebKit.java:482)
> 	at org.eclipse.swt.browser.WebKit.access$200(WebKit.java:124)
> 	at
> org.eclipse.swt.browser.WebKit$Webkit2Extension.
> initializeWebExtensions_callback(WebKit.java:594)
> 	at org.eclipse.swt.internal.webkit.WebKitGTK._webkit_web_view_new(Native
> Method)
> 	at
> org.eclipse.swt.internal.webkit.WebKitGTK.webkit_web_view_new(WebKitGTK.java:
> 1928)
> 	at org.eclipse.swt.browser.WebKit.create(WebKit.java:1142)
> 	at org.eclipse.swt.browser.Browser.<init>(Browser.java:102)
> 	at
> org.eclipse.swt.examples.controlexample.BrowserTab.
> createExampleWidgets(BrowserTab.java:98)
> 	at
> org.eclipse.swt.examples.controlexample.Tab.createTabFolderPage(Tab.java:
> 1264)
> 	at
> org.eclipse.swt.examples.controlexample.BrowserTab.
> createTabFolderPage(BrowserTab.java:179)
> 	at
> org.eclipse.swt.examples.controlexample.ControlExample.<init>(ControlExample.
> java:71)
> 	at
> org.eclipse.swt.examples.controlexample.ControlExample.main(ControlExample.
> java:225)

Hmm this would indicate that WebKit2 isn't loading properly, likely because it can't the extension library. How are you running ControlExample in this case? Do you have the SWT binaries set up and linked properly?
Comment 5 Arseniy Skvortsov CLA 2019-03-28 10:06:49 EDT
I've downloaded swt-4.10-gtk-linux-x86_64.zip and
org.eclipse.sdk.examples.source-4.10.zip, unpacked these and launched

java -classpath swt.jar:plugins/org.eclipse.swt.examples_3.106.300.v20181018-1329.jar org.eclipse.swt.examples.controlexample.ControlExample

No specific environment variables.

I've unpacked native libraries from swt.jar and checked them with ldd. All references are resolved except for libjawt.so.

Strange thing is that no library doesn't want libwebkit2gtk.
Comment 6 Eric Williams CLA 2019-03-28 10:11:39 EDT
(In reply to Arseniy Skvortsov from comment #5)
> I've downloaded swt-4.10-gtk-linux-x86_64.zip and
> org.eclipse.sdk.examples.source-4.10.zip, unpacked these and launched
> 
> java -classpath
> swt.jar:plugins/org.eclipse.swt.examples_3.106.300.v20181018-1329.jar
> org.eclipse.swt.examples.controlexample.ControlExample
> 
> No specific environment variables.
> 
> I've unpacked native libraries from swt.jar and checked them with ldd. All
> references are resolved except for libjawt.so.
> 
> Strange thing is that no library doesn't want libwebkit2gtk.

Does it show the extension library? The name should be libswt-webkit2extension-gtk-4*.so.
Comment 7 Arseniy Skvortsov CLA 2019-03-28 10:29:52 EDT
No, this library is not present in the swt.jar I've downloaded.
Comment 8 Eclipse Genie CLA 2019-05-26 16:06:44 EDT
New Gerrit change created: https://git.eclipse.org/r/142833
Comment 10 Alexander Kurtakov CLA 2019-05-27 03:34:09 EDT
Thanks for fixing it Nikita!