Can't start dhis 2.31 from an empty DB

I have installed the postgis. created the postgis extension.
The conf.xml I can confirm is right.
but I still can’t start dhis231:

WARN 2018-12-05 14:56:52,604 A C3P0Registry mbean is already registered. This probably means that an application using c3p0 was undeployed, but not all PooledDataSources were closed prior to undeployment. This may lead to resource leaks over time. Please take care to close all PooledDataSources. (Slf4jMLog.java [localhost-startStop-2])

  • INFO 2018-12-05 14:56:54,275 Hibernate configuration loaded: dialect: ‘org.hisp.dhis.hibernate.dialect.DhisPostgresDialect’, region factory: ‘org.hibernate.cache.ehcache.EhCacheRegionFactory’, connection pool max size: 80 (DefaultHibernateConfigurationProvider.java [localhost-startStop-2])

  • ERROR 2018-12-05 14:56:54,730 Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again. (HibernateDatabaseInfoProvider.java [localhost-startStop-2])

  • WARN 2018-12-05 14:56:54,731 Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘databaseInfoProvider’ defined in URL [jar:file:/home/wcrmyy2017/tomcat534-1/webapps/dhis/WEB-INF/lib/dhis-support-system-2.32-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again. (AbstractApplicationContext.java [localhost-startStop-2])

  • ERROR 2018-12-05 14:56:54,741 Context initialization failed (ContextLoader.java [localhost-startStop-2])

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘databaseInfoProvider’ defined in URL [jar:file:/home/wcrmyy2017/tomcat534-1/webapps/dhis/WEB-INF/lib/dhis-support-system-2.32-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again.

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1631)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:297)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)

    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)

    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)

    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
1 Like

Hi @lin_xd; the @dhis2-analytics / @dhis2-apps team will be in touch with you shortly to support you with the configuration and also check to see if it might be something else.

Best,
James.

1 Like

@varl, I think you might be able to help out on this one.

2 Likes

Hi @lin_xd ,

could you run the following SQL in the database you have configured DHIS2 to connect to? This will confirm whether or not that specific database have postgis set up.

SELECT PostGIS_full_version();
1 Like

it’s ok. can start from dhis.war down from dhis2.org, but can’t start from the war builded from github source/master.

1 Like

can run SELECT PostGIS_full_version(); and get right result.

2 Likes

Are you still having the issue @lin_xd? If you do, are you still getting the same error messages, despite having PostGIS installed?

1 Like

Hi @Stian - I am facing the same challenge as described above. I have installed Postgis and also created an extension to the database but I get the error above. Please help

`INFO 2019-06-20 17:19:08,246 Hibernate configuration loaded, using dialect: org.hisp.dhis.hibernate.dialect.DhisPostgresDialect, region factory: org.hibernate.cache.ehcache.EhCacheRegionFactory (DefaultHibernateConfigurationProvider.java [localhost-startStop-1])

  • ERROR 2019-06-20 17:22:02,220 Exception when checking postgis_full_version(), PostGIS not available (HibernateDatabaseInfoProvider.java [localhost-startStop-1])
  • ERROR 2019-06-20 17:22:02,297 Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again. (HibernateDatabaseInfoProvider.java [localhost-startStop-1])
  • WARN 2019-06-20 17:22:02,571 Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.MergeService’ defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/dhis/WEB-INF/lib/dhis-service-schema-2.30.jar!/META-INF/dhis/beans.xml]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.SchemaService’: Unsatisfied dependency expressed through field ‘propertyIntrospectorService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.PropertyIntrospectorService’: Unsatisfied dependency expressed through field ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘databaseInfoProvider’ defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/dhis/WEB-INF/lib/dhis-support-system-2.30.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again. (AbstractApplicationContext.java [localhost-startStop-1])
  • ERROR 2019-06-20 17:22:08,193 Context initialization failed (ContextLoader.java [localhost-startStop-1])
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.MergeService’ defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/dhis/WEB-INF/lib/dhis-service-schema-2.30.jar!/META-INF/dhis/beans.xml]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.SchemaService’: Unsatisfied dependency expressed through field ‘propertyIntrospectorService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.PropertyIntrospectorService’: Unsatisfied dependency expressed through field ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘databaseInfoProvider’ defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/dhis/WEB-INF/lib/dhis-support-system-2.30.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again.
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1198)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1100)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4821)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5264)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1091)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1830)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.SchemaService’: Unsatisfied dependency expressed through field ‘propertyIntrospectorService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.PropertyIntrospectorService’: Unsatisfied dependency expressed through field ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘databaseInfoProvider’ defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/dhis/WEB-INF/lib/dhis-support-system-2.30.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again.
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1269)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    … 28 more
    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.schema.PropertyIntrospectorService’: Unsatisfied dependency expressed through field ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘databaseInfoProvider’ defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/dhis/WEB-INF/lib/dhis-support-system-2.30.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again.
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1269)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583)
    … 42 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘databaseInfoProvider’ defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/dhis/WEB-INF/lib/dhis-support-system-2.30.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1631)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:297)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583)
    … 55 more
    Caused by: java.lang.IllegalStateException: Postgis extension is not installed. Execute “CREATE EXTENSION postgis;” as a superuser and start the application again.
    at org.hisp.dhis.system.database.HibernateDatabaseInfoProvider.init(HibernateDatabaseInfoProvider.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1760)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1697)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1627)
    … 67 more
    Jun 20, 2019 5:22:09 PM org.apache.catalina.core.StandardContext startInternal
    SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
    Jun 20, 2019 5:22:09 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
    INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [112] milliseconds.
    Jun 20, 2019 5:22:09 PM org.apache.catalina.core.StandardContext startInternal
    SEVERE: Context [/dhis] startup failed due to previous errors
  • INFO 2019-06-20 17:22:10,039 De-registering jdbc driver: org.postgresql.Driver@73ff80c (StartupListener.java [localhost-startStop-1])
    Jun 20, 2019 5:22:10 PM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deployment of web application directory /home/dhis/tomcat-dhis/webapps/dhis has finished in 274,614 ms
    Jun 20, 2019 5:22:10 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler [“http-nio-8080”]
    Jun 20, 2019 5:22:11 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 365119 ms
    `
1 Like

@ksheghembe,

make sure that the dhis.conf is pointing to the same DB where you created the extension.

It is very common to not having created the extension, or to create the extension in the wrong database. The extension is tied to the specific database you make it for, so make sure these are all correct.

1 Like

@Stian - thanks for the response. I managed to solve this by using version 2.31.1. I still cant explain why that is the case but in case someone else is faced with the same challenge, you can try using version 2.31.1.

1 Like