glassfish
  1. glassfish
  2. GLASSFISH-8409

create-jvm-options should provide reason no duplicate entry created

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: V3
    • Fix Version/s: 3.1
    • Component/s: command_line_interface
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Sun

    • Issuezilla Id:
      8,409

      Description

      asadmin create-jvm-options should report reason for not creating option when
      trying to add duplicate jvm-option, rather than just report "created 0 option(s)".

      i do this:

      % asadmin create-jvm-options -DWSIT_HOME=\$

      {com.sun.aas.installRoot}
      created 1 option(s)

      Command create-jvm-options executed successfully.


      % asadmin create-jvm-options -DWSIT_HOME=\${com.sun.aas.installRoot}

      created 0 option(s)

      Command create-jvm-options executed successfully.

      This should report the reason for "created 0 option(s)", giving the user some
      indication/feedback that the reason no option was created was because there
      already exist this same jmv-option in domain.xml, thus it's a duplicate and
      therefore will not be createe or added to domain.xml

      glassfishv3/glassfish/domains/domain1/config/domain.xml
      shows just the one entry:

      <java-config debug-options="-Xdebug
      -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009"
      system-classpath="" classpath-suffix="">

      [snip]

      <jvm-options>-DWSIT_HOME=$com.sun.aas.installRoot</jvm-options>
      </java-config>

      i'm using glassfish-v3-web-preview-b47b.zip with metro 2.0 downloaded from
      update center

      To reproduce:
      1. Download glassfish v3 web preview
      from:http://javaweb.sfbay/java/re/glassfish/v3/promoted/preview/b47b/archive/bundles/
      2. Unzip it.
      3. cd glassfishv3
      4. java -jar ./pkg/lib/pkg-bootstrap.jar
      5. cd bin
      6. /pkg set-authority -P -O http://pkg.glassfish.org/v3/stable/solaris-sparc/
      pkg.glassfish.org

      This should be changed based on platform
      http://pkg.glassfish.org/v3/stable/solaris-sparc/
      http://pkg.glassfish.org/v3/stable/solaris-x86/
      http://pkg.glassfish.org/v3/stable/windows/
      http://pkg.glassfish.org/v3/stable/linux/
      http://pkg.glassfish.org/v3/stable/mac

      Note that the Metro version has "1.4.0" but the
      bits are really from the Metro 2.0-b10 build. This
      will be fixed in the next v3 Preview promoted build.

      7.pkg refresh
      8.pkg install metro
      9.asadmin start-domain domain1
      10. asadmin create-jvm-options "-DWSIT_HOME=\$

      {com.sun.aas.installRoot}"

      then if you do this step again, you'll see the problem:

      10. asadmin create-jvm-options "-DWSIT_HOME=\${com.sun.aas.installRoot}

      "

        Activity

        Hide
        jbenoit added a comment -

        step 6. has a typo, it should be:

        6. ./pkg set-authority -P -O http://pkg.glassfish.org/v3/stable/solaris-sparc/
        pkg.glassfish.org

        instead of previously mentioned:

        6. /pkg set-authority -P -O http://pkg.glassfish.org/v3/stable/solaris-sparc/
        pkg.glassfish.org

        i.e. i forgot "." meaning current directory is where pkg command should be
        invoked from, not "/" or root dir.

        Show
        jbenoit added a comment - step 6. has a typo, it should be: 6. ./pkg set-authority -P -O http://pkg.glassfish.org/v3/stable/solaris-sparc/ pkg.glassfish.org instead of previously mentioned: 6. /pkg set-authority -P -O http://pkg.glassfish.org/v3/stable/solaris-sparc/ pkg.glassfish.org i.e. i forgot "." meaning current directory is where pkg command should be invoked from, not "/" or root dir.
        Hide
        Tom Mueller added a comment -

        This is fixed in GlassFish 3.1:

        $ asadmin create-jvm-options -Da=b
        Created 1 option(s)
        Command create-jvm-options executed successfully.
        $ asadmin create-jvm-options -Da=b
        remote failure: JVM option -Da=b already exists in the configuration.
        Command create-jvm-options failed.

        Show
        Tom Mueller added a comment - This is fixed in GlassFish 3.1: $ asadmin create-jvm-options -Da=b Created 1 option(s) Command create-jvm-options executed successfully. $ asadmin create-jvm-options -Da=b remote failure: JVM option -Da=b already exists in the configuration. Command create-jvm-options failed.
        Hide
        niclas.bentley added a comment - - edited

        ./asadmin create-jvm-options '-Da=b'
        Created 2 option(s)
        Command create-jvm-options executed successfully.

        ./asadmin create-jvm-options '-Da=b:-Dc=d'
        remote failure: JVM option -Da=b already exists in the configuration.
        Command create-jvm-options failed.

        jvm option c=d is not created.

        The documentation http://docs.oracle.com/cd/E19798-01/821-1758/6nmnj7ptl/index.html states that:
        "In this case, one of the two parameters already exists, so the subcommand reports that only one option was set."

        The behavior of this command does not conform to the documentation, and it is the behavior of the command that needs to be changed.

        It is actually quite disturbing, if you need to make sure multiple options are set, they have to be handled one-by-one.

        Show
        niclas.bentley added a comment - - edited ./asadmin create-jvm-options '-Da=b' Created 2 option(s) Command create-jvm-options executed successfully. ./asadmin create-jvm-options '-Da=b:-Dc=d' remote failure: JVM option -Da=b already exists in the configuration. Command create-jvm-options failed. jvm option c=d is not created. The documentation http://docs.oracle.com/cd/E19798-01/821-1758/6nmnj7ptl/index.html states that: "In this case, one of the two parameters already exists, so the subcommand reports that only one option was set." The behavior of this command does not conform to the documentation, and it is the behavior of the command that needs to be changed. It is actually quite disturbing, if you need to make sure multiple options are set, they have to be handled one-by-one.

          People

          • Assignee:
            Tom Mueller
            Reporter:
            jbenoit
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: