Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-3140

Fix App Manager problem with Zulu Java8 JDK

    Details

    • Story Points:
      5
    • Sprint:
      Summer 4 2022 July 4, Summer 5 2022 July 18, Summer 6 2022 Aug 1

      Description

      As noted in a linked issue, the IGB App Manager "install" button fails when IGB runs under the "Zulu" build of the Java8 OpenJDK which supposedly includes JavaFX, a collection of libraries and a run-time for implementing graphical user interfaces separate from Swing.

      (The "Zulu" build is from a company called Azul. See https://www.azul.com/downloads/?package=jdk for download information.)

      Within the App Manager, the "install" button is using javascript, running within a javascript interpreter included with JavaFX. (For an example issue, see: IGBF-1244, "App Manager can't install apps")

      It is possible that this javascript interpreter is not working properly due to a bug in the JavaFX implementation being used. Or, the problem could instead be due to some type of hack the IGB codebase contains in order to overcome a bug in the JavaFX version included within older versions of the JDK.

      For this task, identify and explain the problem that is causing the IGB App Manager to fail when run using the Zulu build of OpenJDK, which includes

        Attachments

          Issue Links

            Activity

            Hide
            ann.loraine Ann Loraine added a comment - - edited

            Some research:

            Oracle's JDK version 8 included JavaFX version 8, according to what is written in this StackOverflow article:

            Title: "JavaFx in oracle JDK 8 is same as openjfx 8 versions or not? what is the relationship between javafx in oracle jdk 8 and openjfx8?"

            Link: https://stackoverflow.com/questions/69111336/javafx-in-oracle-jdk-8-is-same-as-openjfx-8-versions-or-not-what-is-the-relatio

            Show
            ann.loraine Ann Loraine added a comment - - edited Some research: Oracle's JDK version 8 included JavaFX version 8, according to what is written in this StackOverflow article: Title: "JavaFx in oracle JDK 8 is same as openjfx 8 versions or not? what is the relationship between javafx in oracle jdk 8 and openjfx8?" Link: https://stackoverflow.com/questions/69111336/javafx-in-oracle-jdk-8-is-same-as-openjfx-8-versions-or-not-what-is-the-relatio
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            Looking at:

            plugins/plugin-manager/src/main/java/org/lorainelab/igb/plugin/manager/AppManagerFxPanel.java

            Probably there is some problem with how the panel is intercepting user click events.

            Show
            ann.loraine Ann Loraine added a comment - - edited Looking at: plugins/plugin-manager/src/main/java/org/lorainelab/igb/plugin/manager/AppManagerFxPanel.java Probably there is some problem with how the panel is intercepting user click events.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Notes on installing Zulu on Mac:

            1. Downloaded Azul Zulu version 8.62.0.19 (zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64.zip).
            2. Unzipped the file.
            3. Moved the entire folder (zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64) to /Library/Java/JavaVirtualMachines/
            4. Updated netbeans.conf (located in /Applications/NetBeans/Apache NetBeans 14.app/Contents/Resources/NetBeans/netbeans/etc) to point to the zulu JDK
              netbeans_jdkhome="/Library/Java/JavaVirtualMachines/zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64/zulu-8.jdk/Contents/Home"
            5. In Netbeans, set the Maven Home to /Users/lorainelab/utils/apache-maven-3.8.6

            I was able to clean and build IGB and successfully run the debugger in Netbeans 14.

            Show
            nfreese Nowlan Freese added a comment - - edited Notes on installing Zulu on Mac: Downloaded Azul Zulu version 8.62.0.19 (zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64.zip). Unzipped the file. Moved the entire folder (zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64) to /Library/Java/JavaVirtualMachines/ Updated netbeans.conf (located in /Applications/NetBeans/Apache NetBeans 14.app/Contents/Resources/NetBeans/netbeans/etc) to point to the zulu JDK netbeans_jdkhome= "/Library/Java/JavaVirtualMachines/zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64/zulu-8.jdk/Contents/Home" In Netbeans, set the Maven Home to /Users/lorainelab/utils/apache-maven-3.8.6 I was able to clean and build IGB and successfully run the debugger in Netbeans 14.
            Hide
            nfreese Nowlan Freese added a comment -

            Initial investigation of AppManagerFXPanel.java.

            Using the debugger I am unable to hit a breakpoint located in the installPlugin() method when I click the Install button in the IGB App Manager. This indicates that the button is not connected to the underlying logic.

            Continuing investigation.

            Show
            nfreese Nowlan Freese added a comment - Initial investigation of AppManagerFXPanel.java. Using the debugger I am unable to hit a breakpoint located in the installPlugin() method when I click the Install button in the IGB App Manager. This indicates that the button is not connected to the underlying logic. Continuing investigation.
            Hide
            nfreese Nowlan Freese added a comment -

            Looking into how the pluginInfoTemplate.html connects with AppManagerFxPanel.java through Bridge.

            There may be an issue with older versions of React or the JXSTransformer, however, updating to the newest versions did not correct the issue.

            • Updating the react-dom.js and react.min.js to 0.14.3 did not fix the issue.
            • Updating the JXSTransformer.js to v0.14.0-beta3 did not fix the issue.
            Show
            nfreese Nowlan Freese added a comment - Looking into how the pluginInfoTemplate.html connects with AppManagerFxPanel.java through Bridge. There may be an issue with older versions of React or the JXSTransformer, however, updating to the newest versions did not correct the issue. Updating the react-dom.js and react.min.js to 0.14.3 did not fix the issue. Updating the JXSTransformer.js to v0.14.0-beta3 did not fix the issue.
            Hide
            nfreese Nowlan Freese added a comment -

            Updating the xmlns versions within the PluginConfigurationPanel.fxml does not fix the issue.

            Adding console logging to the pluginInfoTemplate.html breaks the appearance of the plugin information. However, the console logging works properly on the previous 1.8 JDK. The appearance of buttons and text can be altered successfully in the pluginInfoTemplate.html on the Zulu JDK, but it appears that any call to the logger breaks something causing all text and buttons to disappear.

            Show
            nfreese Nowlan Freese added a comment - Updating the xmlns versions within the PluginConfigurationPanel.fxml does not fix the issue. Adding console logging to the pluginInfoTemplate.html breaks the appearance of the plugin information. However, the console logging works properly on the previous 1.8 JDK. The appearance of buttons and text can be altered successfully in the pluginInfoTemplate.html on the Zulu JDK, but it appears that any call to the logger breaks something causing all text and buttons to disappear.
            Hide
            nfreese Nowlan Freese added a comment -

            Reading about the Bridge being used in the pluginInfoTemplate.html file.

            I'm also unsure of whether the deprecation of JSTransform would have an affect: https://reactjs.org/blog/2015/06/12/deprecating-jstransform-and-react-tools.html

            Show
            nfreese Nowlan Freese added a comment - Reading about the Bridge being used in the pluginInfoTemplate.html file. I'm also unsure of whether the deprecation of JSTransform would have an affect: https://reactjs.org/blog/2015/06/12/deprecating-jstransform-and-react-tools.html
            Hide
            nfreese Nowlan Freese added a comment -

            This line in AppManagerFxPanel.java creates a JSObject using webEngine.

            JSObject jsobj = (JSObject) webEngine.executeScript("window");

            Reading the webEngine documentation for Java 9 there is a slight difference between Java 9 and Java 8 documentation in how the instance is created in order to avoid garbage collection that would lead to the page becoming unresponsive. IGBF-1244 describes a very similar situation to what we are currently encountering (install not working), however, it was potentially fixed by following the Java 9 implementation (i.e., this fix is already in the IGB code). This stackoverflow discusses the issue further: https://stackoverflow.com/questions/41903154/javafx-webview-callback-from-javascript-failing-after-garbage-collection

            Azul may be including a version of OpenJFX along with their Zulu JDK8. The OpenJFX may be different than the JavaFX included with the Oracle JDK, however, it is unclear to me as they should in theory be very close/the same.

            Additional reading:

            Talks a little bit about the jsobj: https://stackoverflow.com/questions/36599484/does-javafx8-webengines-executescriptwindow-method-refer-to-the-javascript

            Blog on JavaFX/OpenJFX: https://stackoverflow.com/questions/69111336/javafx-in-oracle-jdk-8-is-same-as-openjfx-8-versions-or-not-what-is-the-relatio/69125593#69125593

            Another blog on JavaFX/OpenJFX:https://stackoverflow.com/questions/18547362/javafx-and-openjdk

            Show
            nfreese Nowlan Freese added a comment - This line in AppManagerFxPanel.java creates a JSObject using webEngine. JSObject jsobj = (JSObject) webEngine.executeScript( "window" ); Reading the webEngine documentation for Java 9 there is a slight difference between Java 9 and Java 8 documentation in how the instance is created in order to avoid garbage collection that would lead to the page becoming unresponsive. IGBF-1244 describes a very similar situation to what we are currently encountering (install not working), however, it was potentially fixed by following the Java 9 implementation (i.e., this fix is already in the IGB code). This stackoverflow discusses the issue further: https://stackoverflow.com/questions/41903154/javafx-webview-callback-from-javascript-failing-after-garbage-collection Azul may be including a version of OpenJFX along with their Zulu JDK8. The OpenJFX may be different than the JavaFX included with the Oracle JDK, however, it is unclear to me as they should in theory be very close/the same. Additional reading: Talks a little bit about the jsobj: https://stackoverflow.com/questions/36599484/does-javafx8-webengines-executescriptwindow-method-refer-to-the-javascript Blog on JavaFX/OpenJFX: https://stackoverflow.com/questions/69111336/javafx-in-oracle-jdk-8-is-same-as-openjfx-8-versions-or-not-what-is-the-relatio/69125593#69125593 Another blog on JavaFX/OpenJFX: https://stackoverflow.com/questions/18547362/javafx-and-openjdk
            Hide
            nfreese Nowlan Freese added a comment - - edited

            jdk1.8.0_301.jdk from oracle worked fine
            jdk1.8.0_311.jdk from oracle does not work
            jdk1.8.0_321.jdk from oracle does not work
            jdk1.8.0_331.jdk from oracle does not work
            jdk1.8.0_333.jdk from oracle does not work

            Trying to determine what changed between 301 and 311

            311 release notes: https://www.oracle.com/java/technologies/javase/8u311-relnotes.html
            311 bug fixes: https://www.oracle.com/java/technologies/javase/8u311-bugfixes.html

            This bug seems interesting: https://bugs.openjdk.org/browse/JDK-8269131

            Show
            nfreese Nowlan Freese added a comment - - edited jdk1.8.0_301.jdk from oracle worked fine jdk1.8.0_311.jdk from oracle does not work jdk1.8.0_321.jdk from oracle does not work jdk1.8.0_331.jdk from oracle does not work jdk1.8.0_333.jdk from oracle does not work Trying to determine what changed between 301 and 311 311 release notes: https://www.oracle.com/java/technologies/javase/8u311-relnotes.html 311 bug fixes: https://www.oracle.com/java/technologies/javase/8u311-bugfixes.html This bug seems interesting: https://bugs.openjdk.org/browse/JDK-8269131
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Upgraded the jsx transformer to use babel (see this post about the deprecation of JSTransform), but this did not fix the issue.

            I'm working on pluginInfoTemplate.html to see if I can get any kind of response from AppManagerFxPanel.java

            Show
            nfreese Nowlan Freese added a comment - - edited Upgraded the jsx transformer to use babel (see this post about the deprecation of JSTransform ), but this did not fix the issue. I'm working on pluginInfoTemplate.html to see if I can get any kind of response from AppManagerFxPanel.java
            Hide
            nfreese Nowlan Freese added a comment - - edited

            I created a simplified newpluginInfoTemplate.html file that only contains a single button using HTML and JavaScript (no React/JSX/etc). When clicked the button changes text and is supposed to use the Java bridge to call a method in AppManagerFXPanel.java that writes out a message in the logs. The button works correctly in JDK 1.8.0_301 by both changing text and calling the method in AppManagerFXPanel. However, in JDK 1.8.0_311 the button will change text, but it will not call the method in AppManagerFXPanel. So this would seem to rule out issues with the HTML/JavaScript.

            I also created a HelloWorld to test whether the webEngine bridge is fundamentally broken in the JDK 1.8.0_311. The HelloWorld example is from StackOverflow. The app is attached as HelloWorldApp.zip. The webEngine bridge successfully worked with JDK 1.8.0_311.

            These results indicate that the webEngine bridge does work with JDK 1.8.0_311 and that the issue is not related to the use of JSXTransform or React.

            Show
            nfreese Nowlan Freese added a comment - - edited I created a simplified newpluginInfoTemplate.html file that only contains a single button using HTML and JavaScript (no React/JSX/etc). When clicked the button changes text and is supposed to use the Java bridge to call a method in AppManagerFXPanel.java that writes out a message in the logs. The button works correctly in JDK 1.8.0_301 by both changing text and calling the method in AppManagerFXPanel. However, in JDK 1.8.0_311 the button will change text, but it will not call the method in AppManagerFXPanel. So this would seem to rule out issues with the HTML/JavaScript. I also created a HelloWorld to test whether the webEngine bridge is fundamentally broken in the JDK 1.8.0_311. The HelloWorld example is from StackOverflow . The app is attached as HelloWorldApp.zip. The webEngine bridge successfully worked with JDK 1.8.0_311. These results indicate that the webEngine bridge does work with JDK 1.8.0_311 and that the issue is not related to the use of JSXTransform or React.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Commit: https://bitbucket.org/nfreese/nowlanfork-igb/commits/00db73bbd592947890bf68eed3b17375cc735237
            Branch: https://bitbucket.org/nfreese/nowlanfork-igb/branch/IGBF-3140

            Tested using JDK zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64

            When I removed the getLoadWorker logic from the HelloWorld example in the previous comment the button stopped working in JDK 1.8.0_311 but continued to work in JDK 1.8.0_301. I applied the same logic to AppManagerFxPanel and modified the config.properties and the App install button now works.

            I also had to add javafx.concurrent to the config.properties file (see error below and see similar issue in this stackoverflow). Note that specifying javafx.concurrent.worker does not work.

            ERROR com.affymetrix.main.OSGiHandler - 
            Unable to resolve org.lorainelab.igb.plugins-manager [74](R 74.0): missing requirement [org.lorainelab.igb.plugins-manager [74](R 74.0)] osgi.wiring.package; 
            (osgi.wiring.package=javafx.concurrent) Unresolved requirements: [[org.lorainelab.igb.plugins-manager [74](R 74.0)] osgi.wiring.package; (osgi.wiring.package=javafx.concurrent)]
            Show
            nfreese Nowlan Freese added a comment - - edited Commit: https://bitbucket.org/nfreese/nowlanfork-igb/commits/00db73bbd592947890bf68eed3b17375cc735237 Branch: https://bitbucket.org/nfreese/nowlanfork-igb/branch/IGBF-3140 Tested using JDK zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64 When I removed the getLoadWorker logic from the HelloWorld example in the previous comment the button stopped working in JDK 1.8.0_311 but continued to work in JDK 1.8.0_301. I applied the same logic to AppManagerFxPanel and modified the config.properties and the App install button now works. I also had to add javafx.concurrent to the config.properties file (see error below and see similar issue in this stackoverflow ). Note that specifying javafx.concurrent.worker does not work. ERROR com.affymetrix.main.OSGiHandler - Unable to resolve org.lorainelab.igb.plugins-manager [74](R 74.0): missing requirement [org.lorainelab.igb.plugins-manager [74](R 74.0)] osgi.wiring. package ; (osgi.wiring. package =javafx.concurrent) Unresolved requirements: [[org.lorainelab.igb.plugins-manager [74](R 74.0)] osgi.wiring. package ; (osgi.wiring. package =javafx.concurrent)]
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            Notes / Links :

            Summary of the problem: There were no problems with the javascript being able to talk to java. What we needed to do was reconfigure how the javascript code (as a "JSObject") was connecting to / integrating with the Java code.

            Show
            ann.loraine Ann Loraine added a comment - - edited Notes / Links : https://docs.oracle.com/javase/8/javafx/api/javafx/scene/web/WebEngine.html - see demo code - has "hello world" code used to figure out the problem https://stackoverflow.com/questions/34840370/javafx-webview-up-call-from-javascript-doesnt-work Summary of the problem: There were no problems with the javascript being able to talk to java. What we needed to do was reconfigure how the javascript code (as a "JSObject") was connecting to / integrating with the Java code.
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            For testing:

            • Building branch
            • Building installers w/ Zulu 1.8 JVM + JavaFX
            • Uploading installers to a place for testing on Mac, Linux, Windows

            Outcome:

            For testing, installer names have "Zulu" prefix.

            Please note: Apple installer isn't notarized. To run the installer, you have to do a special thing. I forget exactly what...trying to find it in previous comments, other tickets.

            Show
            ann.loraine Ann Loraine added a comment - - edited For testing: Building branch Building installers w/ Zulu 1.8 JVM + JavaFX Uploading installers to a place for testing on Mac, Linux, Windows Outcome: Built branch using JAVA_HOME pointing to zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64 Built installers using JREs created on respective platforms (downloaded from https://bitbucket.org/lorainelab/jre-bundles-install4j/downloads/ ) Uploaded installers to https://bitbucket.org/aloraine/nowlanfork-igb-aloraine/downloads/ for testing For testing, installer names have "Zulu" prefix. Please note: Apple installer isn't notarized. To run the installer, you have to do a special thing. I forget exactly what...trying to find it in previous comments, other tickets.
            Hide
            ann.loraine Ann Loraine added a comment -

            I was able to use the App Manager to install an App into IGB. I tested the IGB universal JVM "zulu" build from previous comment. Ready for PR.

            Show
            ann.loraine Ann Loraine added a comment - I was able to use the App Manager to install an App into IGB. I tested the IGB universal JVM "zulu" build from previous comment. Ready for PR.
            Show
            nfreese Nowlan Freese added a comment - Pull request: https://bitbucket.org/lorainelab/integrated-genome-browser/pull-requests/902/igbf-3140-fix-app-manager-webengine
            Hide
            ann.loraine Ann Loraine added a comment -

            PR is merged.

            Note that no bitbucket-built installers are available for testing as I have not yet built the docker image that would be required.

            Show
            ann.loraine Ann Loraine added a comment - PR is merged. Note that no bitbucket-built installers are available for testing as I have not yet built the docker image that would be required.
            Hide
            karthik Karthik Raveendran added a comment -

            Tested using Zulu 1.8 JDK +JavaFX (https://www.azul.com/downloads/?version=java-8-lts&os=windows&architecture=x86-64-bit&package=jdk-fx)
            The install button in App Manager works as intended and installs the app

            Show
            karthik Karthik Raveendran added a comment - Tested using Zulu 1.8 JDK +JavaFX ( https://www.azul.com/downloads/?version=java-8-lts&os=windows&architecture=x86-64-bit&package=jdk-fx ) The install button in App Manager works as intended and installs the app
            Hide
            nfreese Nowlan Freese added a comment -

            Tested master branch on Mac OS 12.5 using Zulu 1.8 JDK +JavaFX (zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64).
            Reset preferences to default and removed the .igb folder prior to testing.

            Was able to install ProtAnnot, use ProtAnnot, and then uninstall ProtAnnot. The ProtAnnot bundle disappeared from the .igb folder after being uninstalled. I did not encounter any issues in the log.

            Show
            nfreese Nowlan Freese added a comment - Tested master branch on Mac OS 12.5 using Zulu 1.8 JDK +JavaFX (zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64). Reset preferences to default and removed the .igb folder prior to testing. Was able to install ProtAnnot, use ProtAnnot, and then uninstall ProtAnnot. The ProtAnnot bundle disappeared from the .igb folder after being uninstalled. I did not encounter any issues in the log.

              People

              • Assignee:
                nfreese Nowlan Freese
                Reporter:
                ann.loraine Ann Loraine
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: