Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8193522

meta-index in 1.8.0_152 does not include jfxrt.jar entries

    XMLWordPrintable

Details

    • b01
    • b05
    • x86_64
    • linux
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        Version for running 144

        java version "1.8.0_144"
        Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
        Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

        Version for running 152
        java version "1.8.0_152"
        Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
        Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        Linux whitefly 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Mar 21 12:19:18 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

        EXTRA RELEVANT SYSTEM CONFIGURATION :
        Scripts for running located in the TestApplication directory

        Script for testing 144

        #!/bin/bash

        export JAVA_HOME=/usr/java/jdk1.8.0_144
        export NETBEANS_HOME=/usr/local/netbeans-8.2
        export ANT_HOME=${NETBEANS_HOME}/extide/ant
        export JAVA=${JAVA_HOME}/bin
        export NETBEANS=${NETBEANS_HOME}/bin
        export ANT=${ANT_HOME}/bin
        export PATH=${JAVA}:${NETBEANS}:${ANT}:${PATH}

        uname -a
        java -version
        cd dist
        java -classpath $(pwd)/TestApplication.jar -jar TestApplication.jar

        Script for testing 152

        #!/bin/bash

        export JAVA_HOME=/usr/java/jdk1.8.0_152
        export NETBEANS_HOME=/usr/local/netbeans-8.2
        export ANT_HOME=${NETBEANS_HOME}/extide/ant
        export JAVA=${JAVA_HOME}/bin
        export NETBEANS=${NETBEANS_HOME}/bin
        export ANT=${ANT_HOME}/bin
        export PATH=${JAVA}:${NETBEANS}:${ANT}:${PATH}

        uname -a
        java -version
        cd dist
        java -classpath $(pwd)/TestApplication.jar -jar TestApplication.jar


        A DESCRIPTION OF THE PROBLEM :
        When getting the MANIFEST.MF for a class in an application jar I am getting jar:file:/usr/java/jdk1.8.0_152/jre/lib/ext/jfxrt.jar!/META-INF/MANIFEST.MF instead of getting jar:file:/users/sewardge/NetBeansProjects/TestApplication/dist/TestApplication.jar!/META-INF/MANIFEST.MF as expected.

        By the way I believe the code works on 151.


        REGRESSION. Last worked in version 8u144

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Created a java application called TestApplication.
        2. Created a jframe form called TestWindow.
        3. Created a jpanel in the form.
        4. Created a jbutton in the jpanel.
        5. Added the following code to the post init of the button.
                URL manifestURL;
                manifestURL = getClass().getResource("/META-INF/MANIFEST.MF");
                System.out.println("class getResource manifestURL = " + manifestURL);
                manifestURL = TestWindow.class.getResource("/META-INF/MANIFEST.MF");
                System.out.println("class getResource manifestURL = " + manifestURL);
                manifestURL = ((URLClassLoader) TestWindow.class.getClassLoader()).getResource("META-INF/MANIFEST.MF");
                System.out.println("URLClassLoader getResource manifestURL = " + manifestURL);
                manifestURL = ((URLClassLoader) TestWindow.class.getClassLoader()).findResource("META-INF/MANIFEST.MF");
                System.out.println("URLClassLoader findResource manifestURL = " + manifestURL);
        6. Fixed the imports.
        7. Built the application using netbeans.
        Ran the scripts mentioned in the additional configuration section.



        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Linux whitefly 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Mar 21 12:19:18 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
        java version "1.8.0_144"
        Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
        Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
        class getResource manifestURL = jar:file:/users/sewardge/NetBeansProjects/TestApplication/dist/TestApplication.jar!/META-INF/MANIFEST.MF
        class getResource manifestURL = jar:file:/users/sewardge/NetBeansProjects/TestApplication/dist/TestApplication.jar!/META-INF/MANIFEST.MF
        URLClassLoader getResource manifestURL = jar:file:/users/sewardge/NetBeansProjects/TestApplication/dist/TestApplication.jar!/META-INF/MANIFEST.MF
        URLClassLoader findResource manifestURL = jar:file:/users/sewardge/NetBeansProjects/TestApplication/dist/TestApplication.jar!/META-INF/MANIFEST.MF

        ACTUAL -
        Linux whitefly 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Mar 21 12:19:18 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
        java version "1.8.0_152"
        Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
        Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
        class getResource manifestURL = jar:file:/usr/java/jdk1.8.0_152/jre/lib/ext/jfxrt.jar!/META-INF/MANIFEST.MF
        class getResource manifestURL = jar:file:/usr/java/jdk1.8.0_152/jre/lib/ext/jfxrt.jar!/META-INF/MANIFEST.MF
        URLClassLoader getResource manifestURL = jar:file:/usr/java/jdk1.8.0_152/jre/lib/ext/jfxrt.jar!/META-INF/MANIFEST.MF
        URLClassLoader findResource manifestURL = jar:file:/users/sewardge/NetBeansProjects/TestApplication/dist/TestApplication.jar!/META-INF/MANIFEST.MF


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------

        TestApplication.java
        /*
         * To change this license header, choose License Headers in Project Properties.
         * To change this template file, choose Tools | Templates
         * and open the template in the editor.
         */
        package testapplication;

        /**
         *
         * @author sewardge
         */
        public class TestApplication {

           static TestWindow bForm;
           
            /**
             * @param args the command line arguments
             */
            public static void main(String[] args) {
              bForm = new TestWindow();
              bForm.setVisible(true);
            }
            
        }

        TestWindow.java

        /*
         * To change this license header, choose License Headers in Project Properties.
         * To change this template file, choose Tools | Templates
         * and open the template in the editor.
         */
        package testapplication;

        import java.net.URL;
        import java.net.URLClassLoader;


        /**
         *
         * @author sewardge
         */
        public class TestWindow extends javax.swing.JFrame {

            /**
             * Creates new form TestWindow
             */
            public TestWindow() {
                initComponents();
            }

            /**
             * This method is called from within the constructor to initialize the form.
             * WARNING: Do NOT modify this code. The content of this method is always
             * regenerated by the Form Editor.
             */
            @SuppressWarnings("unchecked")
            // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
            private void initComponents() {

                jPanel1 = new javax.swing.JPanel();
                jButton1 = new javax.swing.JButton();

                setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

                jButton1.setText("jButton1");
                URL manifestURL;
                manifestURL = getClass().getResource("/META-INF/MANIFEST.MF");
                System.out.println("class getResource manifestURL = " + manifestURL);
                manifestURL = TestWindow.class.getResource("/META-INF/MANIFEST.MF");
                System.out.println("class getResource manifestURL = " + manifestURL);
                manifestURL = ((URLClassLoader) TestWindow.class.getClassLoader()).getResource("META-INF/MANIFEST.MF");
                System.out.println("URLClassLoader getResource manifestURL = " + manifestURL);
                manifestURL = ((URLClassLoader) TestWindow.class.getClassLoader()).findResource("META-INF/MANIFEST.MF");
                System.out.println("URLClassLoader findResource manifestURL = " + manifestURL);

                javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                jPanel1.setLayout(jPanel1Layout);
                jPanel1Layout.setHorizontalGroup(
                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(132, 132, 132)
                        .addComponent(jButton1)
                        .addContainerGap(180, Short.MAX_VALUE))
                );
                jPanel1Layout.setVerticalGroup(
                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(100, 100, 100)
                        .addComponent(jButton1)
                        .addContainerGap(175, Short.MAX_VALUE))
                );

                javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                getContentPane().setLayout(layout);
                layout.setHorizontalGroup(
                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                );
                layout.setVerticalGroup(
                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                );

                pack();
            }// </editor-fold>//GEN-END:initComponents

            /**
             * @param args the command line arguments
             */
            public static void main(String args[]) {
                /* Set the Nimbus look and feel */
                //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
                /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
                 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
                 */
                try {
                    for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                        if ("Nimbus".equals(info.getName())) {
                            javax.swing.UIManager.setLookAndFeel(info.getClassName());
                            break;
                        }
                    }
                } catch (ClassNotFoundException ex) {
                    java.util.logging.Logger.getLogger(TestWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
                } catch (InstantiationException ex) {
                    java.util.logging.Logger.getLogger(TestWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
                } catch (IllegalAccessException ex) {
                    java.util.logging.Logger.getLogger(TestWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
                } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                    java.util.logging.Logger.getLogger(TestWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
                }
                //</editor-fold>

                /* Create and display the form */
                java.awt.EventQueue.invokeLater(new Runnable() {
                    public void run() {
                        new TestWindow().setVisible(true);
                    }
                });
            }

            // Variables declaration - do not modify//GEN-BEGIN:variables
            private javax.swing.JButton jButton1;
            private javax.swing.JPanel jPanel1;
            // End of variables declaration//GEN-END:variables
        }


        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        The following is an excerpt from the above source codes that works for both 144 and 152.
                URL manifestURL = ((URLClassLoader) TestWindow.class.getClassLoader()).findResource("META-INF/MANIFEST.MF");
                System.out.println("URLClassLoader findResource manifestURL = " + manifestURL);


        Attachments

          Issue Links

            Activity

              People

                asemenyuk Alexey Semenyuk
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: