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

Wildfly does not start when non-ascii chars are used in configuration

    XMLWordPrintable

Details

    • Hide

      1. Include `-Dfile.encoding=UTF-8` in your JAVA_OPTIONS before starting your server.

      2. If the property has been already written, first you need to remove it, and then, let the server write it back in UTF-8. To remove it do one of these options:

      Option 1) Remove the property by editing the standalone.xml file, then start the server including -Dfile.encoding=UTF-8 in the server JAVA_OPTIONS and write it back again using the Web Console or server CLI

      Option 2) Grab the default file encoding of your JVM:

      $ java -XshowSettings:properties -version 2>&1 | grep file.encoding

      Add the expected encoding to the standalone.xml, for example:

      <?xml version="1.0" encoding="windows-1250" ?>

      Then start the server including -Dfile.encoding=UTF-8 in the server JAVA_OPTIONS. Remove and then add it back again the property/configuration by using the Web Console or server CLI

      Show
      1. Include `-Dfile.encoding=UTF-8` in your JAVA_OPTIONS before starting your server. 2. If the property has been already written, first you need to remove it, and then, let the server write it back in UTF-8. To remove it do one of these options: Option 1) Remove the property by editing the standalone.xml file, then start the server including -Dfile.encoding=UTF-8 in the server JAVA_OPTIONS and write it back again using the Web Console or server CLI Option 2) Grab the default file encoding of your JVM: $ java -XshowSettings:properties -version 2>&1 | grep file.encoding Add the expected encoding to the standalone.xml, for example: <?xml version="1.0" encoding="windows-1250" ?> Then start the server including -Dfile.encoding=UTF-8 in the server JAVA_OPTIONS. Remove and then add it back again the property/configuration by using the Web Console or server CLI

    Description

      1) Start the server

      export JAVA_OPTS="-Dfile.encoding=windows-1250 -Dsun.jnu.encoding=windows-1250"; ./standalone.sh
      

      JAVA_OPTS setting is simulating environmnet with default charset different to utf-8

      2) Go to Web Console and add a system property containing non-ascii characters. To access console you may need to create management user first e.g. by ./add-user.sh -u 'admin' -p 'admin'
      Configuration > System Properties > View > Add . E.g. a=これにはリスピンが必要ですá,č,ď,é,ě,í,ň,façade

      3) Stop the server. You can see question marks in standalone.xml. That is bad.

      <system-properties>
          <property name="a" value="?????????á,è,ï,é,ì,í,ò,façade"/>
      </system-properties>
      

      4) Now when trying to start the server, server fails.

      [mchoma@localhost bin]$ export JAVA_OPTS="-Dfile.encoding=windows-1250 -Dsun.jnu.encoding=windows-1250"; ./standalone.sh
      JAVA_OPTS already set in environment; overriding default settings with values: -Dfile.encoding=windows-1250 -Dsun.jnu.encoding=windows-1250
      =========================================================================
      
        JBoss Bootstrap Environment
      
        JBOSS_HOME: /home/mchoma/eaps/8.0.0.Beta-CR1/jboss-eap-8.0
      
        JAVA: java
      
        JAVA_OPTS:  -server -Xlog:gc*:file="/home/mchoma/eaps/8.0.0.Beta-CR1/jboss-eap-8.0/standalone/log/gc.log":time,uptimemillis:filecount=5,filesize=3M -Dfile.encoding=windows-1250 -Dsun.jnu.encoding=windows-1250  --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.url.ldap=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.url.ldaps=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 
      
      =========================================================================
      
      17:12:55,750 INFO  [org.jboss.modules] (main) JBoss Modules version 2.0.3.Final-redhat-00001
      17:12:56,007 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.13.Final-redhat-00001
      17:12:56,012 INFO  [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final-redhat-00001
      17:12:56,078 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: JBoss EAP 8.0.0.Beta (WildFly Core 19.0.0.Beta16-redhat-00004) starting
      17:12:56,319 ERROR [stderr] (Controller Boot Thread) [Fatal Error] :-1:-1: Invalid byte 2 of 3-byte UTF-8 sequence.
      17:12:56,561 ERROR [org.jboss.as.controller] (Controller Boot Thread) 
      
      OPVDX001: Validation error in standalone.xml -----------------------------------
      |
      |  39: </extensions>
      |  40: <system-properties>
      |  41:     <property name="a" value="??????????,?,?,?,?,?,?,fa?ade"/>
      |                                                ^^^^ Invalid byte 2 of 3-byte UTF-8 sequence
      |
      |  42: </system-properties>
      |  43: <management>
      |  44:     <audit-log>
      |
      | The primary underlying error message was:
      | > ParseError at [row,col]:[41,47]
      | > Message: Invalid byte 2 of 3-byte UTF-8 sequence.
      |
      |-------------------------------------------------------------------------------
      
      17:12:56,562 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
      	at org.jboss.as.controller@19.0.0.Beta16-redhat-00004//org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:137)
      	at org.jboss.as.server@19.0.0.Beta16-redhat-00004//org.jboss.as.server.ServerService.boot(ServerService.java:405)
      	at org.jboss.as.controller@19.0.0.Beta16-redhat-00004//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:473)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      
      17:12:56,563 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details. - Server configuration file in use: standalone.xml
      17:12:56,570 INFO  [org.jboss.as] (MSC service thread 1-6) WFLYSRV0050: JBoss EAP 8.0.0.Beta (WildFly Core 19.0.0.Beta16-redhat-00004) stopped in 4ms
      [mchoma@localhost bin]$ 
      

      In WF26 encoding attribute is missing in standalone.xml <?xml version='1.0' encoding='UTF-8'?> -> <?xml version='1.0' ?>. That may be cause of this.

      Attachments

        Issue Links

          Activity

            People

              yborgess1@redhat.com Yeray Borges Santana
              mchoma@redhat.com Martin Choma
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: