Maintenanace page bad characters

Hi all I recently installed dhis2 on a Windows PC but i have a small issue could someone assist on fixing this issue.


Hi @Jay, welcome to the dhis2 community. :wave:

A couple of questions:

  • Are you seeing the same problem on e.g. ?

  • Do you see the problem on multiple browsers in Windows?

  • What version of Tomcat are you running?

  • Could you provide your server.xml for Tomcat?

  • Are you running NGinx in front of Tomcat or are you accessing e.g. http://localhost:8080 directly?


1 Like


This seems to be a similar issue as that @em.hispvietnam faced and posted about in this topic: Icon error in Maintenance app on Windows OS server

It has to do with the Tomcat version, you can downgrade the Tomcat version until this issue is resolved. Please also add a comment saying you are facing the issue and vote for the JIRA issue here:

1 Like


More specifically, this error was identified for Tomcat 8.5.43 and 9.0.22 (released at the same time) - 8.5.42 and 9.0.21 work fine.

@Jay what tomcat version are you using? Please confirm if it is 8.5.46 (the latest) or 9.0.26 (latest) - if yes, then we know this is a permanent Tomcat change breaking compatibility with DHIS2 (and the DHIS2 core devs need to fix it).


1 Like

I am currently using tomcat 9.0.22 and dhis version 2.30

1 Like

Hi @varl,

  1. On the the icons are okay.
  2. On all my browsers I see the same issue.
  3. I am running tomcat version 9.0.
  4. My server.xml configuration
<?xml version="1.0" encoding="UTF-8"?>
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
    maxThreads="150" minSpareThreads="4"/>

<!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html
     Java AJP  Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
<Connector port="8080" protocol="HTTP/1.1"
           redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<Connector executor="tomcatThreadPool"
           port="8080" protocol="HTTP/1.1"
           redirectPort="8443" />
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
     This connector uses the NIO implementation. The default
     SSLImplementation will depend on the presence of the APR/native
     library and the useOpenSSL attribute of the
     Either JSSE or OpenSSL style configuration may be used regardless of
     the SSLImplementation selected. JSSE style configuration is used below.
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true">
        <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                     type="RSA" />
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
     This connector uses the APR/native implementation which always uses
     OpenSSL for TLS.
     Either JSSE or OpenSSL style configuration may be used. OpenSSL style
     configuration is used below.
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
           maxThreads="150" SSLEnabled="true" >
    <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
                     type="RSA" />

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

<!-- An Engine represents the entry point (within Catalina) that processes
     every request.  The Engine implementation for Tomcat stand alone
     analyzes the HTTP headers included with the request, and passes them
     on to the appropriate Host (virtual host).
     Documentation at /docs/config/engine.html -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
<Engine name="Catalina" defaultHost="localhost">

  <!--For clustering, please take a look at documentation at:
      /docs/cluster-howto.html  (simple how to)
      /docs/config/cluster.html (reference documentation) -->
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

  <!-- Use the LockOutRealm to prevent attempts to guess user passwords
       via a brute-force attack -->
  <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
         resources under the key "UserDatabase".  Any edits
         that are performed against this UserDatabase are immediately
         available for use by the Realm.  -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true">

    <!-- SingleSignOn valve, share authentication between web applications
         Documentation at: /docs/config/valve.html -->
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />

    <!-- Access log processes all example.
         Documentation at: /docs/config/valve.html
         Note: The pattern used is equivalent to using pattern="common" -->
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="localhost_access_log" suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" />

5. Accessing it as localhost
1 Like


I have just tested Tomcat 8.5.46 (the newest version), and the problem is still there - so it is obvious that this Icon error problem is a permanent issue with Tomcat 8.5.43 and later, as well as Tomcat 9.0.22 and later. Or in other words, DHIS2 is no longer fully compatible with newer versions of Tomcat 8.5.x and 9.0.x. There might be some configuration setting available that would bypass the problem, but in any case the issue is now a job for the relevant core dev team. @varl can you please investigate the issue - just run any DHIS2 instance under 8.5.43 or later, or 9.0.22 or later. Then go to e.g. Maintenance

NOTE re questions above: I am running localhost directly (no nginx or other load balancing software) and the server.xml is the default. I have tested with and without the setting added to Tomcat’s context.xml file, but that has no bearing on the problem (increasing Tomcat’s cache size seems to be required on Windows if you want full access to the icon library)

Best regards from Sierra Leone

1 Like

Thanks @Calle_Hedberg and @Jay. I’ll take a look at this today.

1 Like

Hi @Calle_Hedberg and @Jay

I’ve spent the day on this and tested these Tomcat versions:

  • Tomcat 8.5.34
  • Tomcat 8.5.46
  • Tomcat 9.0.26

All of these work properly on Linux, so I don’t think this is a problem with the DHIS2 core software specifically. I suspect it is the Java encoding in Windows that is tripping this up. Tomcat recently changed to falling back to the system default if it is not provided across all major tomcat channels (8.0.x, 8.5.x, and 9.0.x).

Could you please provide the output of:

java -XshowSettings:properties -version

I am specifically interested in the file.encoding property.

If that is set to windows-1252 (or anything except UTF-8/UTF8) then doing this in tomcat/bin/setenv.bat should do the trick:

set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8"

Hope this helps and hearing back from you with the requested information.




@varl I think you are definitely on to something here - my output is below, and the file.encoding is codepage 1252 (the most common western codepage). I had not spotted that Tomcat change, but it would explain why the problem suddenly appeared with versions 8.5.43 and 9.0.22 - my default java codepage has been 1252 all along, but never caused problems because Tomcat was sort of “overlooking” the issue.

I even wonder if this might resolve another JIRA issue related to SQL View output not displaying “extended” characters correctly.

I will test this right now.

Best regards from Freetown, Sierra Leone

C:\Users\Calle_Hedberg>java -XshowSettings:properties -version
Property settings:
awt.toolkit =
file.encoding = Cp1252
file.encoding.pkg =
file.separator =
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob =
java.class.path = .
java.class.version = 52.0
java.endorsed.dirs = C:\Program Files\Java\jre1.8.0_221\lib\endorsed
java.ext.dirs = C:\Program Files\Java\jre1.8.0_221\lib\ext
java.home = C:\Program Files\Java\jre1.8.0_221 = C:\Users\Calle_Hedberg\AppData\Local\Temp
java.library.path = C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\Program Files\Python36\Scripts
C:\Program Files\Python36
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Program Files\PostgreSQL\12\bin
C:\Program Files\PuTTY
C:\Program Files\Intel\WiFi\bin
C:\Program Files\Common Files\Intel\WirelessCommon
C:\Program Files (x86)\Brackets\command
C:\Program Files\Git\cmd
C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL
C:\Program Files\Intel\Intel® Management Engine Components\DAL
C:\Program Files\Microsoft VS Code\bin
C:\Program Files\Intel\WiFi\bin
C:\Program Files\Common Files\Intel\WirelessCommon
. = Java™ SE Runtime Environment
java.runtime.version = 1.8.0_221-b11 = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.8
java.vendor = Oracle Corporation
java.vendor.url =
java.vendor.url.bug =
java.version = 1.8.0_221 = mixed mode = Java HotSpot™ 64-Bit Server VM = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.8
java.vm.vendor = Oracle Corporation
java.vm.version = 25.221-b11
line.separator = \r \n
os.arch = amd64 = Windows 10
os.version = 10.0
path.separator = ; = 64
sun.boot.class.path = C:\Program Files\Java\jre1.8.0_221\lib\resources.jar
C:\Program Files\Java\jre1.8.0_221\lib\rt.jar
C:\Program Files\Java\jre1.8.0_221\lib\sunrsasign.jar
C:\Program Files\Java\jre1.8.0_221\lib\jsse.jar
C:\Program Files\Java\jre1.8.0_221\lib\jce.jar
C:\Program Files\Java\jre1.8.0_221\lib\charsets.jar
C:\Program Files\Java\jre1.8.0_221\lib\jfr.jar
C:\Program Files\Java\jre1.8.0_221\classes
sun.boot.library.path = C:\Program Files\Java\jre1.8.0_221\bin
sun.cpu.endian = little
sun.cpu.isalist = amd64
sun.desktop = windows = UnicodeLittle = SUN_STANDARD
sun.jnu.encoding = Cp1252 = HotSpot 64-Bit Tiered Compilers
sun.os.patch.level =
sun.stderr.encoding = cp437
sun.stdout.encoding = cp437 = ZA
user.dir = C:\Users\Calle_Hedberg
user.home = C:\Users\Calle_Hedberg
user.language = en = Calle_Hedberg
user.script =
user.timezone =
user.variant =

java version “1.8.0_221”
Java™ SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot™ 64-Bit Server VM (build 25.221-b11, mixed mode)

1 Like


BINGO - there is no setenv.bat file in the tomcat/bin/ directory, but I created one with the
set “JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8”
line as the only content.

I then upgraded again to 8.5.46, started tomcat, and

  • The nonsense icons under Maintenance is now gone, so setting the java file encoding to UTF8 did the trick.
  • The output of SQL views was not showing correctly (JIRA issue #4651 - over one year old!!), but this change to the codepage has resolved that too.

I have occasionally noted similar issues with a variety of XML/excel outputs from DHIS2, and I suspect this fix will resolve many of those issues too.

I have added the above fix to #4651, but can you please close the issue?

I would also suggest that this issue and its solution are added to the installation manual in a WARNING box (or something like that). 98% of all users are unlikely to be aware that their 64 bits Tomcat installation running on 64 bits window by default will be running an 8-bits codepage…

At least 2 birds with one stone - that’s good work, Viktor :wink:

Best regards

1 Like

Very cool!

Glad that it did the trick. :tada:


@varl l’m having the same issue with Windows 10, Tomcat 9 combination. I also don’t have setenv.bat by default in bin folder. Unfortunately manually creating setenv.bat inside bin folder did not help me get rid of this error.

Hi @Pamod I also had this problem on a new computer.

Open up Tomcat9w, go to the Java tab then add one line in the java options panel

After you apply it try to start up tomcat again

1 Like

Thanks @Pamod, It worked .

Hello everyone,
I have this same issue, and I tried the solution as suggested, but it didn’t work. I have Dhis 2.30 instance and I use Tomcat 9.0.21. Thanks.

Hi @Calle_Hedberg @Shurajit_Dutta

Good day!

Please note I am having the same issue on my windows (laptop) instance.


I am using Tomcat 8.5.57 and DHIS2 2.33.4 versions. The file.encoding shows the Cp1252.


I tried both solutions. Creating the setenv.bat file as well as adding the line as @Shurajit_Dutta told in Java 9 options tab. But the issue remains.

Kindly assist.



Interesting part is, you won’t get the same problem on the Windows server. It seems problem with OS type.

Me neither solved yet this problem as well on Windows 10pro, DHIS2.34.1, PG11. 5, Tomcat 9.0.33

Latest update and interesting!

I downgraded to Tomcat 7 and all issues resolved!

The issue can be fixed by following this linkL

And my final server.xml looks like:
Connector port=“8080” protocol=“HTTP/1.1”
relaxedPathChars =’[]|’

Thank you for all