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

[Logger] JavaFX apps fail to start if jfr.jar is removed from JRE

XMLWordPrintable

      Short version: root cause is missing jfr.jar.

      When javapackager constructs a bundle it puts by default a stripped JRE inside it and between u40 b01 and b02 we lost jfr.jar (PlugIns/jdk1.8.0_40.jdk/Contents/Home/jre/lib/jfr.jar).
      The workaround is to add it to your app manually (I attach the one from u40 b01).

      ---- The investigation ----
      SceneBuilder application (.app) doesn't start up since we moved to u40 b02, same failure with b03 and it was fine with b01.
      Another application like AirportApp packaged as well with the javapackager fails the same so we can say any app is hit.

      One way to reproduce is:
      - copy recursively in /tmp the AirportApp you find in rt repo (apps/scenebuilder/samples/AirportApp) then compile it
      - save the attached build-app.xml (e.g. in /tmp/AirportApp)
      - take "cd /tmp/AirportApp; ant -f build-app.xml"
      - Start the app with "./bundles/Airport\ App.app/Contents/MacOS/Airport\ App".

      dhcp-grenoble-10-166-105-112:AirportApp yjoan$ pwd
      /tmp/AirportApp
      dhcp-grenoble-10-166-105-112:AirportApp yjoan$ ant -f build-app.xml
      Buildfile: /private/tmp/AirportApp/build-app.xml

      create_bundle:
      No base JDK. Package will use system JRE.
        Using default package resource [Bundle config file] (add package/macosx/Info.plist to the class path to customize)
        Using default package resource [icon] (add package/macosx/Airport App.icns to the class path to customize)
      Creating app bundle: /tmp/AirportApp/bundles/Airport App.app
      security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
        Config files are saved to /var/folders/2h/f4qpfbnn0n18s12l93tphzh000grx0/T/fxbundler5381785303138984624/macosx. Use them to customize package.

      BUILD SUCCESSFUL
      Total time: 7 seconds
      dhcp-grenoble-10-166-105-112:AirportApp yjoan$ ls
      AirportApp.jar build-app.xml bundles manifest.mf null.html src
      build build.xml dist nbproject null.jnlp
      dhcp-grenoble-10-166-105-112:AirportApp yjoan$ ./bundles/Airport\ App.app/Contents/MacOS/Airport\ App
      airportapp.Controller.initialize
      Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: com/oracle/jrockit/jfr/EventToken
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2688)
      at java.lang.Class.getDeclaredMethod(Class.java:2115)
      at com.sun.javafx.logging.PulseLogger.<clinit>(PulseLogger.java:48)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleViewEvent(GlassViewEventHandler.java:787)
      at com.sun.glass.ui.View.handleViewEvent(View.java:533)
      at com.sun.glass.ui.View.notifyView(View.java:842)
      at com.sun.glass.ui.mac.MacWindow._setView(Native Method)
      at com.sun.glass.ui.Window.setView(Window.java:384)
      at com.sun.javafx.tk.quantum.WindowStage.setScene(WindowStage.java:250)
      at javafx.stage.Window$9.invalidated(Window.java:825)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:143)
      at javafx.stage.Window.setShowing(Window.java:902)
      at javafx.stage.Window.show(Window.java:917)
      at javafx.stage.Stage.show(Stage.java:256)
      at airportapp.Main.start(Main.java:47)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$152(LauncherImpl.java:821)
      at com.sun.javafx.application.LauncherImpl$$Lambda$51/1438254668.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$165(PlatformImpl.java:326)
      at com.sun.javafx.application.PlatformImpl$$Lambda$45/2058534881.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$null$163(PlatformImpl.java:295)
      at com.sun.javafx.application.PlatformImpl$$Lambda$47/1353569896.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.lambda$runLater$164(PlatformImpl.java:294)
      at com.sun.javafx.application.PlatformImpl$$Lambda$46/1673605040.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      Caused by: java.lang.ClassNotFoundException: com.oracle.jrockit.jfr.EventToken
      at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 27 more
      Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: Could not initialize class com.sun.javafx.logging.PulseLogger
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleViewEvent(GlassViewEventHandler.java:787)
      at com.sun.glass.ui.View.handleViewEvent(View.java:533)
      at com.sun.glass.ui.View.notifyResize(View.java:859)
      at com.sun.glass.ui.mac.MacWindow._setBounds(Native Method)
      at com.sun.glass.ui.Window.setBounds(Window.java:535)
      at com.sun.javafx.tk.quantum.WindowStage.setBounds(WindowStage.java:285)
      at javafx.stage.Window$TKBoundsConfigurator.apply(Window.java:1254)
      at javafx.stage.Window.applyBounds(Window.java:1144)
      at javafx.stage.Window.adjustSize(Window.java:241)
      at javafx.stage.Window.access$600(Window.java:77)
      at javafx.stage.Window$9.invalidated(Window.java:831)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:143)
      at javafx.stage.Window.setShowing(Window.java:902)
      at javafx.stage.Window.show(Window.java:917)
      at javafx.stage.Stage.show(Stage.java:256)
      at airportapp.Main.start(Main.java:47)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$152(LauncherImpl.java:821)
      at com.sun.javafx.application.LauncherImpl$$Lambda$51/1438254668.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$165(PlatformImpl.java:326)
      at com.sun.javafx.application.PlatformImpl$$Lambda$45/2058534881.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$null$163(PlatformImpl.java:295)
      at com.sun.javafx.application.PlatformImpl$$Lambda$47/1353569896.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.lambda$runLater$164(PlatformImpl.java:294)
      at com.sun.javafx.application.PlatformImpl$$Lambda$46/1673605040.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      Exception in Application start method
      Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: Could not initialize class com.sun.javafx.logging.PulseLogger
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:456)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:431)
      at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$361(QuantumToolkit.java:298)
      at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$41/1363854056.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: Could not initialize class com.sun.javafx.logging.PulseLogger
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:456)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:431)
      at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$361(QuantumToolkit.java:298)
      at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$41/1363854056.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: Could not initialize class com.sun.javafx.logging.PulseLogger
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleViewEvent(GlassViewEventHandler.java:787)
      at com.sun.glass.ui.View.handleViewEvent(View.java:533)
      at com.sun.glass.ui.View.notifyView(View.java:842)
      at com.sun.glass.ui.mac.MacWindow._setView(Native Method)
      at com.sun.glass.ui.Window.close(Window.java:313)
      at com.sun.glass.ui.Application.terminate(Application.java:393)
      at com.sun.javafx.tk.quantum.QuantumToolkit.exit(QuantumToolkit.java:688)
      at com.sun.javafx.application.PlatformImpl.lambda$tkExit$168(PlatformImpl.java:448)
      at com.sun.javafx.application.PlatformImpl$$Lambda$236/1321127460.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$165(PlatformImpl.java:326)
      at com.sun.javafx.application.PlatformImpl$$Lambda$45/2058534881.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$null$163(PlatformImpl.java:295)
      at com.sun.javafx.application.PlatformImpl$$Lambda$47/1353569896.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.lambda$runLater$164(PlatformImpl.java:294)
      at com.sun.javafx.application.PlatformImpl$$Lambda$46/1673605040.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      Java has been detached already, but someone is still trying to use it at -[GlassRunnable run]:/HUDSON/workspace/8u40/label/macosx-universal-30/rt/modules/graphics/src/main/native-glass/mac/GlassApplication.m:93
      Java has been detached already, but someone is still trying to use it at -[GlassRunnable dealloc]:/HUDSON/workspace/8u40/label/macosx-universal-30/rt/modules/graphics/src/main/native-glass/mac/GlassApplication.m:107
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:363)
      at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:303)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
      Caused by: java.lang.RuntimeException: Exception in Application start method
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$146(LauncherImpl.java:157)
      at com.sun.javafx.application.LauncherImpl$$Lambda$48/410424423.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.javafx.logging.PulseLogger
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleViewEvent(GlassViewEventHandler.java:787)
      at com.sun.glass.ui.View.handleViewEvent(View.java:533)
      at com.sun.glass.ui.View.notifyView(View.java:842)
      at com.sun.glass.ui.Window.synthesizeViewMoveEvent(Window.java:564)
      at com.sun.glass.ui.Window.setVisible(Window.java:602)
      at com.sun.javafx.tk.quantum.WindowStage.setVisible(WindowStage.java:455)
      at javafx.stage.Window$9.invalidated(Window.java:849)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:143)
      at javafx.stage.Window.setShowing(Window.java:902)
      at javafx.stage.Window.show(Window.java:917)
      at javafx.stage.Stage.show(Stage.java:256)
      at airportapp.Main.start(Main.java:47)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$152(LauncherImpl.java:821)
      at com.sun.javafx.application.LauncherImpl$$Lambda$51/1438254668.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$165(PlatformImpl.java:326)
      at com.sun.javafx.application.PlatformImpl$$Lambda$45/2058534881.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl.lambda$null$163(PlatformImpl.java:295)
      at com.sun.javafx.application.PlatformImpl$$Lambda$47/1353569896.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl.lambda$runLater$164(PlatformImpl.java:294)
      at com.sun.javafx.application.PlatformImpl$$Lambda$46/1673605040.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
      Exception running application airportapp.Main

        1. build-app.xml
          1 kB
          Yves Joan

            kcr Kevin Rushforth
            yjoan Yves Joan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: