Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-5871

Invalid operator error launching the server in dash

XMLWordPrintable

    • Hide
      1. Force the use of dash on the standalone.sh script by changing the shebang from #!/bin/sh to #!/bin/dash
      2. export JAVA_OPTS="-Djava.security.manager"
      3. Launch the server: $WFLY_HOME/bin/standalone.sh
      4. You will get the following error:
      $WFLY_HOME/bin/standalone.sh
      JAVA_OPTS already set in environment; overriding default settings with values: -Djava.security.manager
      ./build/target/wildfly-core-19.0.0.Beta7-SNAPSHOT/bin/standalone.sh: 312: [: x: unexpected operator
      =========================================================================
      
        JBoss Bootstrap Environment
      
        JBOSS_HOME: /Users/yborgess/dev/projects/wildfly-core/build/target/wildfly-core-19.0.0.Beta7-SNAPSHOT
      
        JAVA: /Users/yborgess/.jenv/versions/11.0/bin/java
      
        JAVA_OPTS:  -server -Djava.security.manager  --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED
      
      =========================================================================
      
      Show
      Force the use of dash on the standalone.sh script by changing the shebang from #!/bin/sh to #!/bin/dash export JAVA_OPTS="-Djava.security.manager" Launch the server: $WFLY_HOME/bin/standalone.sh You will get the following error: $WFLY_HOME/bin/standalone.sh JAVA_OPTS already set in environment; overriding default settings with values: -Djava.security.manager ./build/target/wildfly-core-19.0.0.Beta7-SNAPSHOT/bin/standalone.sh: 312: [: x: unexpected operator ========================================================================= JBoss Bootstrap Environment JBOSS_HOME: /Users/yborgess/dev/projects/wildfly-core/build/target/wildfly-core-19.0.0.Beta7-SNAPSHOT JAVA: /Users/yborgess/.jenv/versions/11.0/bin/java JAVA_OPTS: -server -Djava.security.manager --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED =========================================================================

      The == operator to compare strings is not a POXIS shell-compatible operator. That throws an error when launching the server when -Djava.security.manager is in the JAVA_OPTIONS.

      Due to this bug, the server is allowed to start when -Djava.security.manager, however, in such a case, the following error trace should be shown preventing the server to start until JAVA_OPTIONS is corrected:

      $WFLY_HOME/bin/standalone.sh
      JAVA_OPTS already set in environment; overriding default settings with values: -Djava.security.manager
      ERROR: The use of -Djava.security.manager has been removed. Please use the -secmgr command line argument or SECMGR=true environment variable.
      

              jmesnil1@redhat.com Jeff Mesnil
              yborgess1@redhat.com Yeray Borges Santana
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: