DHIS2_HOME environment variable: null (TrayApp.java [main])

I get an error Environment variable DHIS2_HOME: null (TrayApp.java [main])when trying to start a connection dhis2-live.exewith Postgreson my Windows Vista machine.

However, the same application works fine if using H2 DB, but on demand I need to work with Postgres.

Here is the log file.

* INFO  23:48:27,232 Environment variable DHIS2_HOME: null (TrayApp.java [main])
* INFO  23:48:27,700 Initialising DHIS 2 Live... (TrayApp.java [main])
* INFO  23:48:28,574 Loading DHIS 2 on port: 8082 (WebAppServer.java [main])
* INFO  23:48:28,745 Setting DHIS 2 web app context to: /D:/dhis-live/webapps/dhis (WebAppServer.java [main])
* INFO  23:48:28,745 Lifecycle: server starting (TrayApp.java [Thread-2])
* INFO  23:48:55,001 System property dhis2.home points to /D:/dhis-live/conf (DefaultLocationManager.java [Thread-2])
* INFO  23:49:00,290 Hibernate configuration loaded, using dialect: org.hibernate.dialect.PostgreSQLDialect (DefaultHibernateConfigurationProvider.java [Thread-2])
* INFO  23:50:32,286 Found the following message senders: [org.hisp.dhis.message.EmailMessageSender@c0023f, org.hisp.dhis.sms.SmsMessageSender@b027dd] (DefaultMessageService.java [Thread-2])
* INFO  23:51:25,998 Lifecycle: server started (TrayApp.java [Thread-2])

hibernate.properties

#hibernate.dialect = org.hibernate.dialect.H2Dialect
#hibernate.connection.driver_class = org.h2.Driver
#hibernate.connection.url = jdbc:h2:./database/dhis2;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE
#hibernate.connection.username = sa
#hibernate.connection.password =

hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql:dhis2
hibernate.connection.username = dhis
hibernate.connection.password = dhis

hibernate.hbm2ddl.auto = update
+4
source share
2 answers

@ The answer to Ranjitsinh may be useful to some future readers, but for me the problem was solved by creating a new database and using the postgresdefault user privileges, as shown in the screenshot below.

User/Group .

enter image description here

+1

, TrayApp.java , DHIS2_HOME.

, :

DHIS2_HOME , D:\dhis2 hibernate.properties
    hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
    hibernate.connection.driver_class = org.postgresql.Driver
    hibernate.connection.url = jdbc:postgresql:dhis2
    hibernate.connection.username = dhis
    hibernate.connection.password = dhis
    hibernate.hbm2ddl.auto = update

dhis2-live.exe, dhis2 posgresql.

, .!!

+2

All Articles