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

Secondary Launchers picks wrong main class from module

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • deploy
    • Verified

      [Windows Developer Build: 12/05/2106 (mm/dd/yyyy)]

      Steps to reproduce.
      1. Download the attached "com.greetings.jar" modular jar to a folder say "modjars"

        a. try to execute the following commands at command line using download modular jar "com.greetings.jar"
      java --module-path modjars --module com.greetings/com.greetings.App1 ===> OUTPUTS PASS_1
      java --module-path modjars --module com.greetings/com.greetings.App2 ===> OUTPUTS PASS_2
      java --module-path modjars --module com.greetings/com.greetings.App3 ===> OUTPUTS PASS_3

      1. Download the attached 'secondarylauncher.xml' and MODIFY the following contents in 'secondarylauncher.xml' and save the file.

      a. <taskdef classpath ===> points to "ant-javafx.jar" available in "%JAVA_HOME%\lib\ant-javafx.jar
      b. <fx:runtime>
                       <fx:module-path value ===> points to jmods folder available in "%JAVA_HOME%\jmods;modjars" and modjars containing secondarylaunchers.

      2. check "ant -version" and "java -version" commands are pointing to correct jdk and ant version.
      3. execute command "ant -f secondarylauncher.xml" at command line.
      4. after execution of command in step 4. check installer "CoupleSecondaryLaunchersTest_ANT_ModularJar_exe-1.0.exe" in bundles folder.
      5. double click the installer and complete the installation.
      6. execute the command "set _JAVA_LAUNCHER_DEBUG=true" at command line.
      7. Navigate to the installed folder using command %lOCALAPPDATA%\CoupleSecondaryLaunchersTest_ANT_ModularJar_exe and execute the following commands
      a. app2.exe 1> app2_stdout.log
      b. app3.exe 1> app3_stdout.log
      8. Check the contents of app2_stdout.log, it should contain "PASS_2" text in it.
      9. Check the contetns of app3_stdout.log, it shoudl contain "PASS_3" text in it.

      ACTUAL OUTPUT:
            app2_stdout.log contains text "PASS_1"
            app3_stdout.log contains text "PASS_1"

      EXPECTED OUTPUT
           app2_stdout.log should contain text "PASS_2" ===> output from module/class : com.greetings/com.greetings.App2
           app3_stdout.log should contain text "PASS_3" ===> output from module/class: com.greetings/com.greetings.App3

      OBSERVATION: Looks like Secondary Launchers are using mainClass mentioned in <fx:application mainClass=""> instead it should pick the mainClass mentioned in it's own tag
      <fx:secondaryLauncher mainClass="" module="">

        1. app2_stdout.log
          3 kB
        2. app3_stdout.log
          3 kB
        3. com.greetings.jar
          10 kB
        4. modjars_64bit.zip
          9 kB
        5. modjars.zip
          9 kB
        6. secondarylauncher.xml
          1 kB

            vdrozdov Victor Drozdov (Inactive)
            rgangadhar Ramesh Gangadhar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: