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

[packager] app class should be derived from main jar if -appclass is not specified

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: deploy
    • Environment:

      java -version
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+101-jigsaw-nightly-h4313-20160120)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+101-jigsaw-nightly-h4313-20160120,
      mixed mode)

    • Subcomponent:
    • Introduced In Build:
      b101
    • Introduced In Version:
      9
    • OS:
      windows

      Description

      1. I have created a new testcase to list all service providers for particular service interface.

      2. Please find the attachment for three jars and javapackager log.
           a. com.shape.serviceinterface.jar
           b. com.shape.serviceprovider.circle.jar
           c. com.shape.serviceprovider.rectangle.jar

      where "com.shape.serviceinterface.jar" contains service interface defined along with main class ShapeMainClass for entire Application.

      "com.shape.serviceprovider.circle.jar" and "com.shape.serviceprovider.rectange.jar" are service providers for service interface.

      3. ISSUE:
      please check the following snippet in log.
      <snippet>

      INFO: Running command: [D:\Downloads\jdk-9_windows-x64_bin_101_jan20\jdk-9\bin\javapackager, -deploy, -verbose, -outdir, D:\TEMP\testBundlerWorkDir1148308311129
      415526, -outfile, test, -native, exe, -name, ServiceList, -linkmodulepath, D:\Downloads\jdk-9_windows-x64_bin_101_jan20\jdk-9\jmods, -srcdir, D:\TEMP\testBundle
      rWorkDir1148308311129415526\jars, -srcfiles, com.shape.serviceprovider.rectangle.jar;com.shape.serviceprovider.circle.jar;com.shape.serviceinterface.jar, -BMain
       Jar Classpath=com.shape.serviceinterface.jar;com.shape.serviceprovider.circle.jar;com.shape.serviceprovider.rectangle.jar, -detectmodules, -BMain Jar=RelativeF
      ileSet{basedir:D:\TEMP\testBundlerWorkDir1148308311129415526\jars, files:[com.shape.serviceinterface.jar]}, -appclass, com.shape.serviceprovider.Rectangle]

      </snippet>

      In the above snippet u can see "-BmainJar" is pointing to jar file "com.shape.serviceinterface.jar" where as
      "-appclass, com.shape.serviceprovider.Rectangle" is pointing to a class available in "com.shape.serviceprovider.rectangle.jar"

      NOTE:
      1. One point i want to emphasize is all three jars having MainClass attribute filled with classes available in respective jar.
      2. "-name" argument is not passed to Javapackager, so it looks like AppName is picked from -appclass value.




        Attachments

          Activity

            People

            Assignee:
            asemenyuk Alexey Semenyuk
            Reporter:
            rgangadhar Ramesh Gangadhar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: