glassfish
  1. glassfish
  2. GLASSFISH-15551

appclient does not work on windows with cygwin

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1_dev
    • Fix Version/s: 3.1_dev
    • Component/s: standalone_client
    • Labels:
      None

      Description

      appclient fails on windows with cygwin

      Here is the log

      > /cygdrive/c/ha/glassfish3/glassfish/ config
      > $ C:/ha/glassfish3/glassfish/bin/appclient -client C:/ha/ file_repository//appclient/cartClient.jar -xml C:/ha/ file_repository//appclient/sun-acc.xml++ dirname C:/ha/glassfish3/ glassfish/bin/appclient
      > + _AS_INSTALL=C:/ha/glassfish3/glassfish/bin/..
      > + export _AS_INSTALL
      > + case "`uname`" in
      > ++ uname
      > ++ cygpath --windows C:/ha/glassfish3/glassfish/bin/..
      > + _AS_INSTALL='C:\ha\glassfish3\glassfish\'
      > + . 'C:\ha\glassfish3\glassfish\/config/asenv.conf'
      > ++ AS_IMQ_LIB=../../mq/lib
      > ++ AS_IMQ_BIN=../../mq/bin
      > ++ AS_CONFIG=../config
      > ++ AS_INSTALL=..
      > ++ AS_DEF_DOMAINS_PATH=../domains
      > ++ AS_DEF_NODES_PATH=../nodes
      > ++ AS_DERBY_INSTALL=../../javadb
      > ++ AS_JAVA=C:/ha/jdk1.6.0_23
      > + chooseJava
      > + '[' C:/ha/jdk1.6.0_23 '!=' '' ']'
      > + javaSearchType=AS_JAVA
      > + javaSearchTarget=C:/ha/jdk1.6.0_23
      > + JAVA=C:/ha/jdk1.6.0_23/bin/java
      > + '[' '!' -x C:/ha/jdk1.6.0_23/bin/java ']'
      > ++ C:/ha/jdk1.6.0_23/bin/java -classpath 'C:\ha\glassfish3\glassfish \/lib/gf-client.jar' org.glassfish.appclient.client.CLIBootstrap - client C:/ha/file_repository//appclient/cartClient.jar -xml C:/ha/ file_repository//appclient/sun-acc.xml
      > + eval '"C:\ha\jdk1.6.0_23\jre\bin\java.exe"' '- Dcom.sun.aas.installRoot="C:\ha\glassfish3\glassfish"' '- Djava.security.policy="C:\ha\glassfish3\glassfish\lib\appclient \client.policy"' - Djava .system .class .loader=org.glassfish.appclient.client.acc.agent.ACCAgentClassLoader 'Djava.security.auth.login.config="C:\ha\glassfish3\glassfish\lib \appclient\appclientlogin.conf"' '-Djava.ext.dirs="C:\ha \glassfish3\glassfish\lib\ext";"C:\ha\jdk1.6.0_23\jre\lib\ext"' ' Djava.endorsed.dirs="C:\ha\glassfish3\glassfish\lib\endorsed";"C:\ha \glassfish3\glassfish\modules\endorsed";"C:\ha\jdk1.6.0_23\jre\lib \endorsed"' 'javaagent:"C:\ha\glassfish3\glassfish\lib\gf client.jar"=mode=acscript,arg=configxml,arg="C:\ha \glassfish3\glassfish\domains\domain1\config\sun acc.xml",client=jar="C:/ha/file_repository//appclient/ cartClient.jar",arg=xml,arg="C:/ha/file_repository//appclient/sun acc.xml"' -jar '"C:/ha/file_repository//appclient/cartClient.jar"' $'\r'
      > ++ 'C:\ha\jdk1.6.0_23\jre\bin\java.exe' '-Dcom.sun.aas.installRoot=C: \ha\glassfish3\glassfish' '-Djava.security.policy=C:\ha \glassfish3\glassfish\lib\appclient\client.policy' - Djava .system .class .loader=org.glassfish.appclient.client.acc.agent.ACCAgentClassLoader '-Djava.security.auth.login.config=C:\ha\glassfish3\glassfish\lib \appclient\appclientlogin.conf' '-Djava.ext.dirs=C:\ha \glassfish3\glassfish\lib\ext'
      > C:/ha/glassfish3/glassfish/bin/appclient: line 107: C:\ha \jdk1.6.0_23\jre\bin\java.exe: command not found
      > ++ 'C:\ha\jdk1.6.0_23\jre\lib\ext' '-Djava.endorsed.dirs=C:\ha \glassfish3\glassfish\lib\endorsed'
      > C:/ha/glassfish3/glassfish/bin/appclient: line 107: C:\ha \jdk1.6.0_23\jre\lib\ext: command not found
      > ++ 'C:\ha\glassfish3\glassfish\modules\endorsed'
      > C:/ha/glassfish3/glassfish/bin/appclient: line 107: C:\ha \glassfish3\glassfish\modules\endorsed: command not found
      > ++ 'C:\ha\jdk1.6.0_23\jre\lib\endorsed' 'javaagent:C:\ha \glassfish3\glassfish\lib\gf-client.jar=mode=acscript,arg= configxml,arg=C:\ha\glassfish3\glassfish\domains\domain1\config\sun- acc.xml,client=jar=C:/ha/file_repository//appclient/ cartClient.jar,arg=xml,arg=C:/ha/file_repository//appclient/sun acc.xml' -jar C:/ha/file_repository//appclient/cartClient.jar $'\r'
      > C:/ha/glassfish3/glassfish/bin/appclient: line 107: C:\ha \jdk1.6.0_23\jre\lib\endorsed: command not found
      >
      >

        Activity

        Hide
        Tim Quinn added a comment -

        As I said to Gopal in e-mail, I suspect the problem is this.

        The appclient script runs a java command executing CLIBootstrap, which in turn computes a second java command which actually launches the ACC. CLIBootstrap uss conventional techniques to determine what OS is current so it can use the correct path separator character. When running on Windows, even under cygwin, Java reports the separator character as '\' and the path separator char as ';' and so CLIBootstrap creates a java command using those characters. Further, CLIBootstrap prepares the second java command to run java.exe.

        I think cygwin appends another .exe to the file path to find the actual executable on the Windows system, and of course java.exe.exe is not present in the Java installation. That causes the error message that java.exe cannot be found. The subsequent errors are because cygwin seems to be interpreting the ; Windows path separator which CLIBootstrap used as command separators as *nix shells do.

        It may be a simple matter of CLIBootstrap detecting not only if the OS is Windows but also whether cygwin is the current shell. The appclient script can pass an additional property to CLIBootstrap to indicate this if needed. Elena has allowed me to use an SQE Windows test system with cygwin installed to work on this further.

        Show
        Tim Quinn added a comment - As I said to Gopal in e-mail, I suspect the problem is this. The appclient script runs a java command executing CLIBootstrap, which in turn computes a second java command which actually launches the ACC. CLIBootstrap uss conventional techniques to determine what OS is current so it can use the correct path separator character. When running on Windows, even under cygwin, Java reports the separator character as '\' and the path separator char as ';' and so CLIBootstrap creates a java command using those characters. Further, CLIBootstrap prepares the second java command to run java.exe. I think cygwin appends another .exe to the file path to find the actual executable on the Windows system, and of course java.exe.exe is not present in the Java installation. That causes the error message that java.exe cannot be found. The subsequent errors are because cygwin seems to be interpreting the ; Windows path separator which CLIBootstrap used as command separators as *nix shells do. It may be a simple matter of CLIBootstrap detecting not only if the OS is Windows but also whether cygwin is the current shell. The appclient script can pass an additional property to CLIBootstrap to indicate this if needed. Elena has allowed me to use an SQE Windows test system with cygwin installed to work on this further.
        Hide
        Tim Quinn added a comment -

        updating fix version

        Show
        Tim Quinn added a comment - updating fix version
        Hide
        Tim Quinn added a comment -

        Review discussion:

        How bad is its impact? (Severity)
        This is a regression and is causing sqe tests using Windows and cygwin to fail. Users will have the same problems in that environment.

        How often does it happen? (Frequency)
        Always with Windows and cygwin.

        How much effort is required to fix it? (Cost)
        I already have a fix I am testing.

        What is the risk of fixing it? (Risk)
        Low. The change consists of very simple changes to the appclient script (adding env var assignments and adding env var substitutions on a command to pass information into the CLIBootstrap class) plus a handful of parallel changes in CLIBoostrap.java to use these properties if/when they are defined.

        Does a work around for the issue exist? Can the workaround be reasonably employed by the end user?
        There is no workaround.

        If the issue is not fixed should the issue and its workaround (if applicable) be described in the Release Notes?

        Show
        Tim Quinn added a comment - Review discussion: How bad is its impact? (Severity) This is a regression and is causing sqe tests using Windows and cygwin to fail. Users will have the same problems in that environment. How often does it happen? (Frequency) Always with Windows and cygwin. How much effort is required to fix it? (Cost) I already have a fix I am testing. What is the risk of fixing it? (Risk) Low. The change consists of very simple changes to the appclient script (adding env var assignments and adding env var substitutions on a command to pass information into the CLIBootstrap class) plus a handful of parallel changes in CLIBoostrap.java to use these properties if/when they are defined. Does a work around for the issue exist? Can the workaround be reasonably employed by the end user? There is no workaround. If the issue is not fixed should the issue and its workaround (if applicable) be described in the Release Notes?
        Hide
        Tim Quinn added a comment -

        Fix checked in.

        Project: glassfish
        Repository: svn
        Revision: 44520
        Author: tjquinn
        Date: 2011-01-15 00:41:33 UTC
        Link:

        Log Message:
        ------------
        Fix for 15551

        The app client CLIBootstrap class, which prepares the actual java command to launch the ACC, needed to use Unix-style path separators if the user is on Windows but running under cygwin.

        These changes pass some additional information from the appclient and appclient.bat scripts to CLIBootstrap by env vars and a property.

        Approved: Nazrul
        Code Reviewed: Byron

        Tests: QL, deployment and ejb devtests; manual tests on Windows with and without cygwin

        Revisions:
        ----------
        44520

        Modified Paths:
        ---------------
        trunk/v3/appclient/client/appclient-scripts/src/main/resources/glassfish/bin/appclient
        trunk/v3/appclient/client/acc/src/main/java/org/glassfish/appclient/client/CLIBootstrap.java
        trunk/v3/appclient/client/appclient-scripts/src/main/resources/glassfish/bin/appclient.bat

        Show
        Tim Quinn added a comment - Fix checked in. Project: glassfish Repository: svn Revision: 44520 Author: tjquinn Date: 2011-01-15 00:41:33 UTC Link: Log Message: ------------ Fix for 15551 The app client CLIBootstrap class, which prepares the actual java command to launch the ACC, needed to use Unix-style path separators if the user is on Windows but running under cygwin. These changes pass some additional information from the appclient and appclient.bat scripts to CLIBootstrap by env vars and a property. Approved: Nazrul Code Reviewed: Byron Tests: QL, deployment and ejb devtests; manual tests on Windows with and without cygwin Revisions: ---------- 44520 Modified Paths: --------------- trunk/v3/appclient/client/appclient-scripts/src/main/resources/glassfish/bin/appclient trunk/v3/appclient/client/acc/src/main/java/org/glassfish/appclient/client/CLIBootstrap.java trunk/v3/appclient/client/appclient-scripts/src/main/resources/glassfish/bin/appclient.bat

          People

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

            Dates

            • Due:
              Created:
              Updated:
              Resolved: