0

I'm posting here after much study of all the previous postings (on this site and elsewhere) regarding problems in running a JavaFX application (developed using JWrapper as the launcher) in a VMWare encapsulated instance of Mac OSX 10.10. [NOTE: edited the preceding sentence and the title of this posting on 2015-02-25 to add reference to VMWare.]

After experiencing failure of my much larger Java 1.8.0_25 application to install and launch in Mac OSX v10.10.1, I replicated the problem using a 3-line "Hello World" JavaFX application.

In both cases, I am using what seem to be the standard Mac-oriented parameter settings in the JWrapper build-parm XML:

<JvmOption>-Djavafx.macosx.embedded=true</JvmOption>
<MustFork>true</MustFork>

In both cases, when attempting installation on the Mac, the JWrapper splash screen appears as expected, but then it goes away, and the application itself fails to launch.

Here are the links to (1) zip file with all logs from an attempted "HelloWorldFX" installation on Mac OSX v10.10.1, and (2) zip file with the log and "build" folder from the application's JWrapper build process. Note that this application installs and runs fine in Windows and Ubuntu.

Logs: https://googledrive.com/host/0B0skoeyva4KiUDZBS1FSUXo4RUU/mac_logs.zip

Build folder (300MB): https://googledrive.com/host/0B0skoeyva4KiUDZBS1FSUXo4RUU/helloWorldFX_build_folder.zip

Here are the highlights:

The HelloWorldFX code (pretty much the entirety of the application):

public void start(Stage stage) {
    stage.setTitle("Hello World FX");
    stage.setScene
        (new Scene(new StackPane(new Button("Hello World FX")), 600, 250));
    stage.show();
}

My complete JWrapper build parms:

<JWrapper>

    <!-- The name of the app bundle -->
    <BundleName>HelloWorldFX3</BundleName>

    <!-- The specification for one app within the bundle -->
    <App>
      <Name>HelloWorldFX3</Name>
      <LogoPNG>images/logo.png</LogoPNG>
      <MainClass>helloworldfx.HelloWorldFX</MainClass>
    </App>

    <SupportedLanguages>en</SupportedLanguages>

    <!-- App is a per-user app, it won't elevate and install for all users and the shared config folder will be per-user -->
    <InstallType>CurrentUser</InstallType>

    <!-- No <UpdateURL> element included here: only interested in **offline** installation -->

    <!-- Splash and Logo -->
    <SplashPNG>images/splash.png</SplashPNG>
    <BundleLogoPNG>images/logo.png</BundleLogoPNG>

    <!-- JVM options (e.g. extra memory) -->
    <JvmOptions>
     <JvmOption>-Xmx256m</JvmOption>

     <!-- following Mac-related option IS used in this build: for info, see: http://www.jwrapper.com/old-forum.html#nabble-td409 -->
     <JvmOption>-Djavafx.macosx.embedded=true</JvmOption>

    </JvmOptions>

    <!-- The JREs JWrapper should use for Windows, Linux32, Linux64... -->
    <Windows32JRE>jrepack18/win32/jre1.8.0_25</Windows32JRE>
    <Windows64JRE>jrepack18/win32/jre1.8.0_25</Windows64JRE>
    <Linux32JRE>jrepack18/linux/jre1.8.0_25</Linux32JRE>
    <Linux64JRE>jrepack18/linuxx64/jre1.8.0_25</Linux64JRE>
    <Mac64JRE>jrepack18/macos64/jre1.8.0_25.jre</Mac64JRE> 

    <!-- The files that the app wants to bundle, here we have just one which is a JAR file and we specify that it should be on the launch classpath -->
    <File classpath='yes'>helloWorldApp/HelloWorldFX.jar</File>

    <!-- NoStripJREs option required to avoiding stripping out of JavaFX classes! For info, see: http://www.jwrapper.com/old-forum.html#nabble-td89 -->
    <NoStripJREs>true</NoStripJREs> 
    <!-- This Mac-related option IS used in this build: -->
    <MustFork>true</MustFork>

 </JWrapper>

An ominous message from the "Wrapper" log file on the Mac:

+1 [BundleLoader] Could not load JRE bundle!

One curious line from the "Generic Updater" log file on the Mac, in which a file name is apparently truncated by JWrapper, resulting in a file not found exception:

8574158 (+0) java.io.FileNotFoundException: /Users/admin/Library/Application Support/JWrapper-HelloWorldFX3/JWrapper-JWrapper-00033253833-complete/JWAppSpec- (No such file or directory)

The entirety of the "HelloWorldFX" log file on the Mac (just craps out after or while attempting to disable App Nap):

8574542 (+0) STDOUT test
8574542 (+0) STDERR test
8574543 (+1) [LogFolderCleaner] Keeping Wrapper-2015-02-18-23-56-04-443.log
8574543 (+0) [LogFolderCleaner] Keeping HelloWorldFX3-HelloWorldFX3-2015-02-18-23-56-14-525.log
8574544 (+1) [LogFolderCleaner] Keeping GenericUpdater-2015-02-18-23-56-13-488.log
8574545 (+1) [EDT Exception Printer] Catching all EDT and uncaught exceptions and printing
8574548 (+3) [JWrapperNative] Detected 64-bit architecture
8574548 (+0) [JWrapperNative] Detected Mac OS
8574551 (+3) [JWrapper] sun.java2d.dpiaware: null
8574558 (+7) [JWDetectedProxy] No proxy configuration found to load.
8574559 (+1) JVM Option: -Xmx256m
8574559 (+0) JVM Option: -Djavafx.macosx.embedded=true
8574559 (+0) [JWrapper] JVM Home: /Users/admin/Library/Application Support/JWrapper-HelloWorldFX3/JWrapper-Mac64JRE-00034082796-complete
8574573 (+14) [JWrapper] Wrote JVM Options OK
8574574 (+1) [JWrapper] Set app name to HelloWorldFX3
8574577 (+3) [JWrapper] Loading virtual app
8574577 (+0) [JWrapper] Got virtual app HelloWorldFX3
8574577 (+0) [JWrapper] Setting OS dock info
8574786 (+209) [JWrapper] Image: BufferedImage@5ef04b5: type = 6 ColorModel: #pixelBits = 32 numComponents = 4 color space = java.awt.color.ICC_ColorSpace@5f4da5c3 transparency = 3 has alpha = true isAlphaPre = false ByteInterleavedRaster: width = 256 height = 245 #numDataElements 4 dataOff[0] = 3
8574887 (+101) [JWrapper] Disabling App Nap

Any assistance with getting this problem resolved would be GREATLY appreciated!!

1 Answers1

0

All this launch looks OK, the fact that the HelloWorldFX3 log was produced at all would indicate that the app did launch.

The message 'Disabling App Nap' is just the last message that JWrapper prints before it hands over control so that doesn't indicate that it failed to launch.

Do you get any hs_err_pid files generated anywhere?

What is the main method for your app like, are you able to put in a printout and check if it reaches that point in the logs?

My best guess at this point would be that although you have NoStripJRE specified maybe you haven't deleted the pre-built JRE archives from your build folder? If not then JWrapper will continue to use those and won't rebuild them and you won't have the JavaFX components to allow your app to run. I would suggest removing those and rebuilding and giving that another whirl. Beyond that if there is a hs_err_pid file it may have more info.

AntonyM
  • 1,602
  • 12
  • 12
  • Now that you mention it, yes there IS a file prefixed "hs_err_pid". Here is a link to a copy of it: https://googledrive.com/host/0B0skoeyva4KiUDZBS1FSUXo4RUU/hs_err_pid5748.log The contents of the hs_err_pid file make no sense to me, going much further down the rabbit-hole than I've ever been. By the way, forgive me for neglecting to mention: When I attempt to execute the application on the Mac, a standard Mac window DOES come up saying "HelloWorldFX3 quit unexpectedly. Click Reopen to open the application again... [etc.]", so something IS definitely going wrong (in the eyes of OSX). – Daniel Vimont Feb 20 '15 at 03:10
  • One additional question: Do you folks at JWrapper have a simple (helloWorld-ish) JavaFX application as part of your testing routines? If so, what build of Java are you using with it? (If not, please set one up.) -- Thanks!! – Daniel Vimont Feb 20 '15 at 03:12
  • BTW, repeated this entire build and installation process using Java 1.8.0_31 (the latest build from Oracle). Exact same result encountered -- no joy. – Daniel Vimont Feb 20 '15 at 04:24
  • More: As you advised, I put a println statement into the main method. This printed out in the output, so the main method IS successfully invoked (before any JavaFX class/methods are invoked). My start method (see code snippet above) is never reached, so things are apparently crapping out during instantiation of the JavaFX environment. (Looking at the hs_err_pid output suggests things possibly go bad when the JavaFX "QuantumRenderer" is making a call to a native OSX function.) – Daniel Vimont Feb 20 '15 at 06:24
  • Multiple google searches led me to this bug report, issued in December, which has hs_err_pid output which looks (to my untrained eye) similar to mine: https://bugs.openjdk.java.net/browse/JDK-8067271 – Daniel Vimont Feb 20 '15 at 06:43
  • More on this (for what it's worth): installed the latest NetBeans (8.0.2) in my Mac OSX 10.10.1 environment, did a "clean and build", followed by "run" on the standard NetBeans JavaFX "helloworld" application, and got very similar abend to the one documented above. The hs_err_pid from this new NetBeans abend is here: https://googledrive.com/host/0B0skoeyva4KiUDZBS1FSUXo4RUU/hs_err_pid35710_netbeans.log – Daniel Vimont Feb 23 '15 at 08:03
  • After digging considerably deeper, I crucially realized that the Mac machine provided to me remotely by the MacinCloud service is actually a VMWare-encapsulated instance running on a larger machine. So this problem is apparently caused by VMWare getting between JavaFX and the native OSX graphics infrastructure that JavaFX needs to access. Continued in next comment... – Daniel Vimont Feb 25 '15 at 09:52
  • I followed the advice on this stackoverflow posting (http://stackoverflow.com/questions/18754803/how-to-disable-or-bypass-hardware-graphics-accelerationprism-in-javafx) to add the JVM runtime parm -Dprism.order=j2d. This option allowed for successful launch of the HelloWorld window, but not its button. This run then generated a CGLCreateContext error. Bottom line: I apparently need to get direct access to a Mac that is not partitioned with VMWare, in order for any of my JavaFX applications to be runnable. – Daniel Vimont Feb 25 '15 at 09:53