JDK-8134470 : [WebView] UnsatisfiedLinkError calling getId on HTMLIFrameElement
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 8u60
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: x86
  • Submitted: 2015-08-25
  • Updated: 2020-01-31
  • Resolved: 2015-10-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u72Fixed 9Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Server VM (build 25.60-b23, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux ubuntu 3.19.0-26-generic #28-Ubuntu SMP Tue Aug 11 14:16:45 UTC 2015 i686 i686 i686 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
I'm trying to extract an iFrame's ID from a Document object from the WebEngine.  Here are the steps:

- Create a WebView and get the WebEngine.
- Load a URL into the WebEngine by calling WebEngine.load(URL)
- Get the Document object by calling WebEngine.getDocument()
- Get all iframe elements from Document object by calling getElementsByTagName("iframe")

- Loop through the returned NodeList and cast each item as HTMLIFrameElement
- Call method getId() on the HTMLIFrameElement will throw UnsatisfiedLinkError

REGRESSION.  Last worked in version 8u51

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It will return the ID of the iFrame set in the HTML
ACTUAL -
throws UnsatisfiedLinkError

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Remove the codes that try to get the iFrame ID


Comments
@Alexander: Can you please review and push it if it is ok?
09-10-2015

http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/33a2acb4ba86
09-10-2015

+1
09-10-2015

+1 Tested on Mac and Linux. Both the original IFrame.java test program and the newly added unit test fail without the fix and pass with the fix.
06-10-2015

I can test the patch on OS X and Linux and add my comment. Alexander Z will need to push this after he reviews it.
06-10-2015

Please find attached fix and regression test. Please review. I will need some help to push it.
05-10-2015

@Ilya: can you attach the partial patch you were working on for this bug?
03-10-2015

This is not surprising, since 8u60-b09 was when the new WebKit was integrated.
14-09-2015

stt-mac-44:~ gtee$ nm -gU /net/scanas412.us.oracle.com/export/java_re2/jdk/8u60/ea/b08/binaries/macosx-x86_64/jre/lib/libjfxwebkit.dylib | grep -i getIdImpl 0000000000303c40 T _Java_com_sun_webkit_dom_HTMLElementImpl_getIdImpl stt-mac-44:~ gtee$ nm -gU /net/scanas412.us.oracle.com/export/java_re2/jdk/8u60/ea/b09/binaries/macosx-x86_64/jre/lib/libjfxwebkit.dylib | grep -i getIdImpl stt-mac-44:~ gtee$ So regression introduced in b09
14-09-2015

Lowering to P3 given that the impact is limited to two methods in the DOM API.
14-09-2015

This issue is regression introduced by changes in revisions 8755 and 9030. As part of integrating the new webkit in revision 8755 _Java_com_sun_webkit_dom_HTMLElementImpl_getIdImpl was removed from modules\web\src\main\native\Source\WebCore\mapfile-macosx along with other changes (see below) As part of 9030 get id and set id were moved from HTMLElementImpl to base class ElementImpl. Neither of these revisions exported _Java_com_sun_webkit_dom_ElementImpl_getIdImpl and _Java_com_sun_webkit_dom_ElementImpl_setIdImpl (see mapfile-macosx and mapfile-vers) and hence attached IFrame.java compiles but does not link at runtime. > hg diff -r 8754 -r 8755 modules\web\src\main\native\Source\WebCore\mapfile-macosx > 8755 - RT-36726: Update to the Latest Version of WebKit + ... - _Java_com_sun_webkit_dom_DocumentImpl_getItemsImpl - _Java_com_sun_webkit_dom_HTMLElementImpl_getIdImpl - _Java_com_sun_webkit_dom_HTMLElementImpl_setIdImpl - _Java_com_sun_webkit_dom_HTMLElementImpl_getItemIdImpl - _Java_com_sun_webkit_dom_HTMLElementImpl_setItemIdImpl - _Java_com_sun_webkit_dom_HTMLElementImpl_getItemScopeImpl - _Java_com_sun_webkit_dom_HTMLElementImpl_setItemScopeImpl - _Java_com_sun_webkit_dom_HTMLIFrameElementImpl_getSeamlessImpl - _Java_com_sun_webkit_dom_HTMLIFrameElementImpl_setSeamlessImpl - _Java_com_sun_webkit_dom_ProcessingInstructionImpl_getDataImpl - _Java_com_sun_webkit_dom_ProcessingInstructionImpl_setDataImpl > hg diff -r 9029 -r 9030 modules\web\src\main\java-wrappers\com\sun\webkit\dom\HTMLElementImpl.java > hg diff -r 9029 -r 9030 modules\web\src\main\java-wrappers\com\sun\webkit\dom\ElementImpl.java > 9030 - summary: 8090062: Update java-wrappers for WebKit generated classes following WebKit update While looking at these methods in latest JDK 8 sources I found that: * getIdImpl/setIdImpl: get id and set id were moved to base class but are not exported in mapfile-macosx (hence code compiles but does not link) * setItemIdImpl: WHY Java_com_sun_webkit_dom_HTMLElementImpl_setItemIdImpl is still exported in mapfile-vers but not in mapfile-macosx while there is no such method in java class? I think it just needs to be removed. * setSeamlessImpl: WHY Java_com_sun_webkit_dom_HTMLIFrameElementImpl_setSeamlessImpl is still exported in mapfile-vers but not in mapfile-macosx while there is no such method in java class? I think it just needs to be removed. * getItemsImpl/getItemIdImpl/getItemScopeImpl/setItemScopeImpl/getSeamlessImpl/getDataImpl/setDataImpl: are not present anywhere in source Do you mind if I take over the CR?
12-09-2015

Reproducible on Mac 10.10.5 with 8u60 b27 java idergali$ java IFrame -cp . SUCCEEDED Exception in thread "JavaFX Application Thread" java.lang.UnsatisfiedLinkError: com.sun.webkit.dom.ElementImpl.getIdImpl(J)Ljava/lang/String; at com.sun.webkit.dom.ElementImpl.getIdImpl(Native Method) at com.sun.webkit.dom.ElementImpl.getId(ElementImpl.java:46) at IFrame.lambda$start$0(IFrame.java:30) at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182) at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81) at javafx.beans.property.ReadOnlyObjectWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyObjectWrapper.java:176) at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:142) at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112) at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146) at javafx.scene.web.WebEngine$LoadWorker.updateState(WebEngine.java:1260) at javafx.scene.web.WebEngine$LoadWorker.dispatchLoadEvent(WebEngine.java:1371) at javafx.scene.web.WebEngine$LoadWorker.access$1200(WebEngine.java:1253) at javafx.scene.web.WebEngine$PageLoadListener.dispatchLoadEvent(WebEngine.java:1240) at com.sun.webkit.WebPage.fireLoadEvent(WebPage.java:2400) at com.sun.webkit.WebPage.fwkFireLoadEvent(WebPage.java:2244) at com.sun.webkit.network.URLLoader.twkDidFinishLoading(Native Method) at com.sun.webkit.network.URLLoader.notifyDidFinishLoading(URLLoader.java:838) at com.sun.webkit.network.URLLoader.lambda$didFinishLoading$96(URLLoader.java:829) at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
09-09-2015

Actually, I was running on an 8u60 EA build on Windows when I said I could reproduce it. With the fcs buld (b27) I cannot reproduce it on 8u60. Since this is reported on Linux I will try there in case it is Linux-specific.
04-09-2015

I can reproduce this with JDK 8u60, but not with the latest EA build of JDK 9. I will try with 8u66.
04-09-2015

It looks like this issue was introduced by previous WebKit merge JDK-8098296, 8u60-b09.
27-08-2015

This will need to be backported to 8u-dev
26-08-2015