Installing new test DHIS2 system on MS Windows - 404

Not sure I understand!

p.s. when I installed PostGres I selected the ‘Australia’ rather than the default – would that make any difference?

Thanks,

Claire

4 Likes

Hi Claire,

I use DHIS2 live for my development work on 2.30. Only difference is I’m using a old DHIS2 live version I got I think from 2.28 and update the war file from the latest with PostgreSQL which works perfectly.

4 Likes

also here is the localhost log from tomcat which looks relevant localhost.2019-01-13.log (67.3 KB)

3 Likes

Hey hi James,

Im also facing the same problem while installing DHIS2 2.30 on windows and unable to open the localhost:8080/dhis. It give error 404 as for claire. I’ve crosschecked all variables environment set and all are double checked. Im using tomcat 9 and postgre11 and everything has been done as per the instructions from DHIS2.org but still its not getting to work.

Please help if there is some special changes which needs to be made in tomcat /dhis webfiles. Im unable to find any solution on net so far for this issue.

Early reply would be highly appreciated.

Thanks in advance.

5 Likes

Hello Claire,

I was just going through the posts and saw your issues with the DHIS. Im also facing the same issues while installing on windows and getting the same error and i guess everywhere on internet there is no solution to this problem.

So if you have any luck getting it resolved please help share the knowledge with me to get this working.

Thanks in advance again.
Rahull

5 Likes

HI @usfreak13,

Sorry for the challenge faced.

Have you checked the instructions from Installing DHIS2 on a Windows Local Server - try this and let me know where you get stuck from; and Can’t Login after restoring sample database?

Also, kindly check that the port 8080 was not taken by another application you are using in your machine; maybe another instance of tomcat - (Are you able to share the Catalina logs for us to check out the error?)

For versions 2.30 upwards, you have to “CREATE EXTENSION postgis;” as a superuser in your db; (psql -d dhis2 --username=dhis2 -c "CREATE EXTENSION postgis") and restart the application.

Check these options out and let us know if they sort you out.

Best,
James.

4 Likes

Hey Hi,

This is the msg which i get when i try to create the Postgis.

C:\Program Files\PostgreSQL\10\bin>psql -d dhis2 --username=dhis -c “CREATE EXTENSION postgis”
Password for user dhis:
ERROR: could not open extension control file “C:/Program Files/PostgreSQL/10/share/extension/postgis.control”: No such file or directory

Also there is no port conflict and my localhost:8080 opens tomcat main page too. Im attached the catalina logs at the time of deploying the dhis.war & also the screenshot of the tomcat page.

Please look into the same and let know if anything is going wrong somewhere.

Thanks in advance.

CATALINA LOG is as attachedCatalina log.txt (30.6 KB)

I hope this would help understand the problem and resolve the same.

I understand that the problem is with the Tomcat Server only which is not letting the .war files load properly.

4 Likes

Hi Rahul,
The thing I noticed is that your are running PostgreSQL 11 but your command is looking for a directory called ‘10’. This may be a typo.
Also, you can only create extension Postgis if you have downloaded it into the correct directories. So there is something to do before you try to run the command.
I went to Windows Builds | PostGIS and then downloaded postgis-bundle-pg11x64-setup-2.5.1-1.exe from Index of /postgis/windows/pg11/
So do this first then check your directories and confirm that you have the extension in “C:/Program Files/PostgreSQL/11/share/extension/postgis.control”:
Then run the command.
I’m keen to know how you go.
Claire

5 Likes

Hello Claire,

Thanks for your response. I’ve downgraded my Postgre from 11 to 10 for a valid reason of installing of postgis on the same. So the code is correct im using postgre 10 and tomcat 8.5 at the moment.

If you can help understanding what is the reason that Tomcat is not deploying the .war files properly and loading it into the system.

Thanks again.

4 Likes

As far as I understand, it is not PostgreSQL version which is the problem, it is the version of DHIS2.
I got it working with postgresql 11 and without the postgis extension, but I had to go back to the DHIS2.29 WAR file. Postgis is required from DHIS2.30 onwards.
Tell us how that goes …
Claire

5 Likes

Hi Claire,

Thanks for the info. I’ve tried it with all v2.27, 2.29, 2.30 but the problem is consistent the same. Also i tried installing ODK Aggregate yesterday and the problem with that is also the same its not getting deployed on the Tomcat itself.

I think i’m missing some step or something which is not letting the tomcat install the .war file and load it.

Please if you can just send your steps of deploying and how you start your tomcat server and any settings which you made (if any).

Thanks again.

4 Likes

Hello Claire,

Im sending you my LOG file while loading the tomcat deployment. See if you can find some relevant error or point which needs attention and to be corrected for the error free load of the .war file.

Thanks in advance.
DHIS2 Tomcat Log.txt (23.8 KB)

4 Likes

Hi Rahul

I wonder as you have tried different versions of the DHIS2 war file whether you have completely cleared all traces of the old one first. In the webapps directory you will have a file a file (usually dhis2.war) and a directory. You should make sure to remove both the war file and the directory before deploying the new war file.

Also maybe try and start with a blank database.

You log file seems to show that start up is going reasonably well before that strange KAFKA error. (Like the webapp woke up only to discover it had 6 legs) @morten is the kafka guy and might have some insights but my guess is that you have remnants of multiple war files unpacked in your webapps.

Try my suggestions above.

Good luck
Bob

4 Likes

Hello Bob,

Thanks for your valuable insight on the same but ive been exactly doing the same. Removing all previous traces of the DHIS directory and war files from the webapps folder in tomcat directory.

In addition to that i also delete the entire database from postgre and create a new one all together to avoid any problems.

Still im facing the same error and the .war is not deploying. I also tried ODK Aggregate to install on tomcat and unfortunately that is also giving me the same error.

Im also trying installing the same on 2 different machines but both are showing me the similar error and not loading in tomcat.

Im surprised what could be the possible reason for the same even after trying different versions and combinations of the .war files and tomcat.

Please see what posssible error is it which can help resolve this issue.
You can also have a look on my previous posts with the CATALINA log while loading the .war file in tomcat.

Thanks in advance.

5 Likes

What java version are you using?

4 Likes

Im using JDK 10.0.2 and also used the other version on another computer. I think the problem lies in the installation of Tomcat as its not accepting the war file and loading it.

Could it be a problem with the access rights or firewall blocking something or access rights issues. Im not sure but somewhere it was also mentioned as a factor. Im just guessing.

You have something on this.

5 Likes

Rahul I don’t think your problem is anything related to firewall blocking. The error message in your log file (enum constant KAFKA_TRACKER does not exist in class org.hisp.dhis.scheduling.JobType) suggests to me something wrong between the war file and jvm. My first reaction was to think you had some old bits of war file lying around but you say this is not the case.

Are you still getting the same error or something different?

Please try running with java 8. (I know beyond doubt that works)

I don’t think this is actually your immediate problem, but it seems again from that log that your memory (heap) setting is a bit low. -Xmx256m Try increasing that to -Xmx768m.

(I just noticed from your log in the earlier post that you were already using java 8. Its now a bit confusing. Can you post latest log of startup error.)

5 Likes

Dear Bob,

Please find attached the screenshot of my settings for JVM in environment variable and the Error Log for the fresh install after deleting all past install and directories from webapps folder.

I hope this would help you to find out some solution to my problem.

Thanks again.

Error Log.txt (31.5 KB)

4 Likes

Hi Rahul

I see the error log now shows a different problem related to encryptionpassword. Please see Home - DHIS2 Documentation.

Try and comment out the encryption password in dhis2 and start again.

Note your JAVA_OPTS are still not being picked up by the tomcat. Your log file shows different values for -Xmx256m. I am not a windows expert and dont really know how your tomcat is setup. But it looks from the log that this is being set as a commandline option which probably overrides the environment variable. I don’t know if there is a batch file or something which is providing this option to tomcat?

5 Likes

Hi @clairebre and @usfreak13
PS: Instead of using the Apache.exe use the Zipped folder this means that every time you want to start DHIS2 you have to start it normally.
Pay attention to file extensions especially the .config and setenv.bat file (windows normally adds .txt)
Follow these steps below:

  1. Install PostgreSQL 9.6 or higher
  2. Install jdk-8-windows.exe
  3. Install jre-8-windows.exe
  4. Download the apache-apache-tomcat-7 or higher (use windows.zip and save it anywhere (preferably C:)
  5. Unzip that file (4) and delete the zipped file
  6. Open the file and navigate to bin folder within,
  7. Create the setenv.bat file in notepad++ and edit it as shown below (Ensure that the file extension is .bat)
    set DHIS2_HOME=C:\DHIS2 (contains Hibernate.properties) (Should point to the .config file)
    set JAVA_OPTS=-Xmx4G -XX:MaxPermSize=256m (for JAVA RAM size; set accordingly)
    set JAVA_HOME=C:\Program Files\Java\jdk1.8.0
    //For DHIS2_HOME make sure to specify the path to the hibernate.properties
    //For JAVA_OPTS make sure to specify the Xmx 4 value to half your memory value
    //For JAVA_HOME make sure to specify the path to the java jdk
  8. Open the Apache and navigate to webapps
  9. Copy DHIS2 WAR, file and paste in webapps (rename file to ROOT.war)
  10. Navigate to bin folder and double click start.sh (to start tomcat)

OPTIONAL: SET ANY ENVIRONMENT VARIABLES. but I normally add them
export DHIS2_HOME=‘C:\DHIS2’
export JAVA_OPTS=‘-Xmx2500m -Xms2000m -XX:MaxPermSize=500m -XX:PermSize=300m’
export JAVA_HOME=‘C:\Program Files\Java\jdk1.8.0_25’

Let us know if this works

4 Likes