Error while setting up DHIS2 2.33 in (windows 10,tomcat 9, postgres 10)

Dear Altruist,

I am trying to setup dhis2 2.33 in my windows machine, I am using tomcat 9 and postgres 10.
I am getting following error at end of setup. Can you please let me know what I am missing?

  • ERROR 2019-12-18 10:40:59,059 Error while executing action ( [http-nio-8080-exec-2])
    java.lang.ClassCastException: org.apache.catalina.webresources.CachedResource$CachedResourceURLConnection cannot be cast to
    at org.hisp.dhis.i18n.ui.resourcebundle.DefaultResourceBundleManager.getAvailableLocalesFromJar(
    at org.hisp.dhis.i18n.ui.resourcebundle.DefaultResourceBundleManager.getAvailableLocales(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
1 Like

Hi @sohel, tagging the mighty @julhas to check this out!

1 Like

@jomutsani, Thanks.

This is issues with tomcat version 9 in windows even after adding
relaxedPathChars="[ \ ] ^ { | }" relaxedQueryChars="[ \ ] ^ { | }" /> this problem remain in there.

But with tomcat 8.5 this works fine for me.

1 Like

This is great! I’ve also seen a post;

Are you using Java 9 or higher? because, starting with Java 9, xml components are now modules that you need to specify to be included.

You can either add “–add-modules java.xml.bind” to JAVA_OPTS environment variable or edit catalina.bat/ to hard code it. But keep in mind that --add-modules does not work in java 8 if you intend to use both jvm versions.


I am using java 8 (exact version is java version “1.8.0_231”). In JAVA_OPTS I have included,
-Djavax.servlet.request.encoding=“UTF-8” -Dfile.encoding=“UTF-8”

1 Like

This is nice, thank you @sohel for this.