From: Jose G. <jos...@ge...> - 2016-01-28 12:41:22
|
Hi Adding the following bean in *TOMCAT_DIR/webapps/geonetwork/WEB-INF/config-db/**jndi-* *postgres-postgis.xml* solves the exception, but unfortunately GeoNetwork seem stalled in the startup, checking further as not sure if this config should be different: <bean id="jpaVendorAdapterDatabaseParam" class="java.lang.String"> <constructor-arg value="POSTGRESQL"/> </bean> In the meantime I found a nice blog entry to use PostGis without JNDI (https://diouck.wordpress.com/2015/09/16/configuration-geonetwork-3-postgresqlpostgis/), I remember some stuff in GN 2.10 about this is not the best way, preferring JNDI, but for now seem working fine. Will check to update the user manual with the database configuration. Regards, Jose García On Thu, Jan 28, 2016 at 12:11 PM, Jose Garcia <jos...@ge...> wrote: > Hi > > Has someone succeed in setting up postgis for the spatial indexing in > GeoNetwork 3? > > I'm enabling JNDI for this, but I get the following error on startup: > > 2016-01-28 12:02:30,543 INFO [geonetwork.databasemigration] - - > Migration ... > > 2016-01-28 12:02:30,736 INFO [geonetwork.databasemigration] - Error > getting database version: ERROR: relation "settings" does not exist > > Position: 19. Probably due to an old version. Trying with new Settings > structure. > > 2016-01-28 12:02:30,737 INFO [geonetwork.databasemigration] - > Webapp version:3.0.4-SNAPSHOT subversion:SNAPSHOT > > 2016-01-28 12:02:30,737 INFO [geonetwork.databasemigration] - > Database version:null subversion:null > > 2016-01-28 12:02:30,737 WARN [geonetwork.databasemigration] - > Database does not contain any version information. Check that the database > is a GeoNetwork database with data. The database is probably empty, no > migration required. > > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'entityManagerFactory' defined in URL > [jar:file:/usr/local/apache-tomcat-7.0.67/webapps/geonetwork/WEB-INF/lib/domain-3.0.4-SNAPSHOT.jar!/config-spring-geonetwork.xml]: > Cannot resolve reference to bean 'jpaVendorAdapter' while setting bean > property 'jpaVendorAdapter'; nested exception is > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'jpaVendorAdapter' defined in URL > [jar:file:/usr/local/apache-tomcat-7.0.67/webapps/geonetwork/WEB-INF/lib/domain-3.0.4-SNAPSHOT.jar!/config-spring-geonetwork.xml]: > Cannot resolve reference to bean 'jpaVendorAdapterDatabaseParam' while > setting bean property 'database'; nested exception is > org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean > named 'jpaVendorAdapterDatabaseParam' is defined > > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) > > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1417) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1158) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) > > at > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) > > at > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) > > at > org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117) > > at > org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922) > > at > org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) > > at > jeeves.config.springutil.JeevesContextLoaderListener.contextInitialized(JeevesContextLoaderListener.java:56) > > > *Changes done:* > > *TOMCAT_DIR/webapps/geonetwork/WEB-INF/config-node/srv.xml* > > <!-- <import resource="../config-db/h2.xml"/> --> > <import resource="../config-db/jndi-postgres-postgis.xml"/> > <!--<import resource="../config-db/oracle.xml"/>--> > <!--<import resource="../config-db/mysql.xml"/> --> > <!--<import resource="../config-db/db2.xml"/> --> > <!--<import resource="../config-db/postgres.xml"/>--> > <!--<import resource="../config-db/sqlserver.xml"/> --> > > *TOMCAT_DIR/webapps/geonetwork/WEB-INF/config-db/**jndi-postgres-postgis.xml* > > <bean id="jdbcDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> > <property name="jndiName" value="java:/comp/env/jdbc/geonetwork"/> > <property name="cache" value="true"/> > <property name="exposeAccessContext" value="false"/> > </bean> > > > *TOMCAT_DIR/conf/context.xml* > > *<Resource name="jdbc/geonetwork" auth="Container" > type="javax.sql.DataSource" > username="geonetwork" password="XXXXX" > factory="org.apache.commons.dbcp.BasicDataSourceFactory" > driverClassName="org.postgis.DriverWrapper" > url="jdbc:postgresql_postGIS://localhost:5432/gn-postgis" > maxActive="10" maxIdle="10" > removeAbandoned="true" > removeAbandonedTimeout="3600" logAbandoned="true" > testOnBorrow="true" > defaultAutoCommit="false" validationQuery="SELECT > 1" accessToUnderlyingConnectionAllowed="true" > />* > > > In previous versions used to work following the steps described in the > manual, but for version 3 there's no documentation about this. > > Wondering if I'm missing or wrong configuration? > > Regards, > Jose García > > -- > > > > > > > > > > > > > > *Vriendelijke groeten / Kind regards,Jose García > <http://www.geocat.net/>Veenderweg 136721 WD BennekomThe NetherlandsT: +31 > (0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv> > <https://twitter.com/geocat_bv> > <https://plus.google.com/u/1/+GeocatNetbv/posts>Please consider the > environment before printing this email.* > -- *Vriendelijke groeten / Kind regards,Jose García <http://www.geocat.net/>Veenderweg 136721 WD BennekomThe NetherlandsT: +31 (0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv> <https://twitter.com/geocat_bv> <https://plus.google.com/u/1/+GeocatNetbv/posts>Please consider the environment before printing this email.* |