glassfish
  1. glassfish
  2. GLASSFISH-16444

appclient failure of smoke tests on aix

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.1.1_b03
    • Component/s: standalone_client
    • Labels:
      None
    • Environment:

      AIX

      Description

      3.1.1 b02 on AIX

      appserver-sqe/pe/ejb/mdb/basic shows the failure

      runclient-common:
      [echo] Executing appclient at /export/hudson/workspace/alex-aix-smoke/appserver-sqe/pe/ejb/mdb/basic
      [exec] Result: 1
      [echo] Apr 22, 2011 3:12:11 PM org.glassfish.appclient.client.acc.AppclientCommandArguments warnAboutPasswordUsage
      [echo] WARNING: ACC013: The -password option is deprecated and will likely be removed
      in a future release. Please use -passwordfile or let the app client container prompt
      for the username and/or password if they are needed to access a remote resource.
      [echo] org.glassfish.appclient.client.acc.UserError: Client Container xml:
      /export/hudson/workspace/alex-aix-smoke/gl not found or unable to read.
      [echo] You may want to use the -xml option to locate your configuration xml.
      [echo] Usage :
      [echo] appclient [<classfile> | -client<appjar> ]
      [echo] [-mainclass<appClass-name>|-name<display-name>]
      [echo] [-xml<xml>]
      [echo] [-textauth] [-user<username>] [-password<password>|-passwordfile<password-file>]
      [echo] [-targetserver host[:port][,host[:port]...]
      [echo] [app-args]
      [echo] or :
      [echo] appclient [<valid JVM options and valid ACC options> ]
      [echo] [<appClass-name> | -jar<appjar> ]
      [echo] [app args]

        Activity

        Hide
        Tim Quinn added a comment -

        My suspicion - not yet confirmed - has been that there might be a limit on the size of the options string (it appears after the = sign in -javaagent:pathToAgent= ) which is passed to the Java agent.

        The command string generated by the first invocation of java and returned to the appclient script is correct; it is very long and includes the entire correct Java agent options string. But by the time the agent is invoked it receives only part of the string.

        The total length of the token starting with -javaagent seems to be very close to (perhaps exactly) 512 characters, which is a familiar number. More news soon.

        Show
        Tim Quinn added a comment - My suspicion - not yet confirmed - has been that there might be a limit on the size of the options string (it appears after the = sign in -javaagent:pathToAgent= ) which is passed to the Java agent. The command string generated by the first invocation of java and returned to the appclient script is correct; it is very long and includes the entire correct Java agent options string. But by the time the agent is invoked it receives only part of the string. The total length of the token starting with -javaagent seems to be very close to (perhaps exactly) 512 characters, which is a familiar number. More news soon.
        Hide
        Tim Quinn added a comment - - edited

        It indeed looks like the -javaagent options value - or perhaps the entire -javaagent token - is length-limited.

        I have attached a very simple test program (tstLongCommand.zip - a NetBeans project source and JAR files) which contains a Java agent. This program generates a long string (length controlled by a command line argument). Then, like the first Java execution in the appclient script, this test program emits a second java command which specifies a Java agent with a long options string and also specifies a property setting using the same long value.

        The second run of the program simply displays the length and content of the agent options string and the same for the property value that's assigned on the generated command line.

        I have also attached a simple shell script (go.sh) which drives the program.

        The attached output file (output.txt) contains the output from running to generate a use a 600-character value. The results show that the system property value flows through to the program correctly, but the options value is truncated at 451 characters.

        This is the option (excluding the long generated string) from the sample output; the full filespec to the JAR is part of the option so running the sample app in different environments will probably show different truncation points:

        -javaagent:/export/hudson/workspace/tim/TestLongCommand.jar=(long string)

        Interestingly, the token up to and including the = is 69 characters, and 69 + 451 is 511, certainly an interesting number.

        Because the property is handled correctly but the -javaagent options value is not, that strongly suggests that this is not a shell token parsing issue but an issue with the AIX Java implementation and its handling of the options string.

        Show
        Tim Quinn added a comment - - edited It indeed looks like the -javaagent options value - or perhaps the entire -javaagent token - is length-limited. I have attached a very simple test program (tstLongCommand.zip - a NetBeans project source and JAR files) which contains a Java agent. This program generates a long string (length controlled by a command line argument). Then, like the first Java execution in the appclient script, this test program emits a second java command which specifies a Java agent with a long options string and also specifies a property setting using the same long value. The second run of the program simply displays the length and content of the agent options string and the same for the property value that's assigned on the generated command line. I have also attached a simple shell script (go.sh) which drives the program. The attached output file (output.txt) contains the output from running to generate a use a 600-character value. The results show that the system property value flows through to the program correctly, but the options value is truncated at 451 characters. This is the option (excluding the long generated string) from the sample output; the full filespec to the JAR is part of the option so running the sample app in different environments will probably show different truncation points: -javaagent:/export/hudson/workspace/tim/TestLongCommand.jar=(long string) Interestingly, the token up to and including the = is 69 characters, and 69 + 451 is 511, certainly an interesting number. Because the property is handled correctly but the -javaagent options value is not, that strongly suggests that this is not a shell token parsing issue but an issue with the AIX Java implementation and its handling of the options string.
        Hide
        Tim Quinn added a comment -

        Fix checked in for 3.1.1 (rev 46488) and the trunk (rev 46490).

        epository: svn
        Revision: 46488
        Author: tjquinn
        Date: 2011-04-27 21:49:20 UTC
        Link:

        Log Message:
        ------------
        "Fix" for 16444

        This is actually a workaround for an apparent limitation in IBM's Java on AIX. The options string

        -javaagent:pathToAgent=options

        seems to be truncated if the entire -javaagent token exceeds 512 characters (give or take a couple of characters).

        Some of the ACC work is done by a Java agent so it can get control before the user's client (and so the gf-client.jar can be on the classpath without requiring it to be explicitly specified in -classpath). The options value passed to the agent can be quite large because it includes most of the command-line arguments and options the user specifies when invoking the appclient script - and then some. The large value combined with a potentially long path to the the agent JAR caused the options string which Java passes to the agent to be truncated.

        This fix causes CLIBootstrap to write the options to a file, then specify the file in the options string. Then the app client agent reads the actual options from the temp file before deleting it (unless a private, unpublished property is set to keep the options file for diagnosing any problems that might occur).

        Approved: Sathyan
        Tests: QL, deployment devtests, spot tests on AIX

        Revisions:
        ----------
        46488

        Show
        Tim Quinn added a comment - Fix checked in for 3.1.1 (rev 46488) and the trunk (rev 46490). epository: svn Revision: 46488 Author: tjquinn Date: 2011-04-27 21:49:20 UTC Link: Log Message: ------------ "Fix" for 16444 This is actually a workaround for an apparent limitation in IBM's Java on AIX. The options string -javaagent:pathToAgent=options seems to be truncated if the entire -javaagent token exceeds 512 characters (give or take a couple of characters). Some of the ACC work is done by a Java agent so it can get control before the user's client (and so the gf-client.jar can be on the classpath without requiring it to be explicitly specified in -classpath). The options value passed to the agent can be quite large because it includes most of the command-line arguments and options the user specifies when invoking the appclient script - and then some. The large value combined with a potentially long path to the the agent JAR caused the options string which Java passes to the agent to be truncated. This fix causes CLIBootstrap to write the options to a file, then specify the file in the options string. Then the app client agent reads the actual options from the temp file before deleting it (unless a private, unpublished property is set to keep the options file for diagnosing any problems that might occur). Approved: Sathyan Tests: QL, deployment devtests, spot tests on AIX Revisions: ---------- 46488
        Hide
        sherryshen added a comment -

        verified the fix on 3.1.1 b03.

        Show
        sherryshen added a comment - verified the fix on 3.1.1 b03.
        Hide
        Tim Quinn added a comment -

        Adjust fixed-in date.

        Show
        Tim Quinn added a comment - Adjust fixed-in date.

          People

          • Assignee:
            Tim Quinn
            Reporter:
            sherryshen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: