Hi,
2015-05-12 12:11 GMT+02:00 Erik Voges <erik.voges@anonymised.com>:
Thanks Francois
1.) I have changed the ../WEB-INF/config-node/srv.xml file and
uncommented this line:
<import resource="../config-db/jndi-postgres-postgis.xml"/>
If doing step by step, I would try first to enable postgres
<import resource="../config-db/postgres.xml"/>
then enable postgis
and then move to JNDI.
2.) I have changed my jdbc.properties as follows:
jdbc.username=postgres
jdbc.password=secret_password
jdbc.database=geonetwork
jdbc.host=localhost
jdbc.basic.removeAbandoned=true
jdbc.basic.removeAbandonedTimeout=120
jdbc.basic.logAbandoned=true
jdbc.basic.maxActive=33
jdbc.basic.maxIdle=${jdbc.basic.maxActive}
jdbc.basic.initialSize=${jdbc.basic.maxActive}
jdbc.basic.maxWait=200
jdbc.basic.testOnBorrow=true
jdbc.basic.timeBetweenEvictionRunsMillis=10000
jdbc.basic.minEvictableIdleTimeMillis=1800000
jdbc.basic.testWhileIdle=true
jdbc.basic.numTestsPerEvictionRun=3
jdbc.basic.poolPreparedStatements=true
jdbc.basic.maxOpenPreparedStatements=1200
jdbc.basic.validationQuery=SELECT 1
jdbc.basic.defaultReadOnly=false
jdbc.basic.defaultAutoCommit=false
3.) I have created the geonetwork database (not sure if I should have
named it something else ..?)
4.) Next I changed my ../WEB-INF/config-db/jndi-postgres-postgis.xml
file as follows (changed the value of jndiName):
<bean id="jdbcDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/comp/env/jdbc/PostGIS"/>
<property name="cache" value="true"/>
<property name="exposeAccessContext" value="false"/>
</bean>
5.) I have also added this section inside my …/tomcat/conf/context.xml
file, inside the <context> tags.
<Resource name="jdbc/PostGIS" auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/geonetwork?relaxAutoCommit=true"
username="postgres" password="5455c4l_" maxActive="200" maxIdle="50"
maxWait="10000" />
6.) And I have replaced the postgres driver in ../WEB-INF/lib -
postgresql-9.1-901.jdbc4.jar with a later version -
postgresql-9.4-1201.jdbc41.jar , because I had some errors of a method that
wasn’t implemented – this seems to have fixed it.
Would be good to open ticket on github with description and error message
https://github.com/geonetwork/core-geonetwork/issues
to have this fixed in future release.
Thanks.
Francois
… and now I am here with the big rock in the middle of the road J
I am not sure if steps 4 and 5 were required… I tried it without those
changes, but then I got this error:
12-May-2015 12:10:06.099 INFO [localhost-startStop-2]
org.apache.catalina.core.ApplicationContext.log No Spring
WebApplicationInitializer types detected on classpath
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'entityManagerFactory' defined in URL
[jar:file:/opt/apache-tomcat-8.0.22/webapps/geonetwork/WEB-INF/lib/domain-3.0.0-0.jar!/config-spring-geonetwork.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to
convert property value of type 'org.apache.naming.NamingContext' to
required type 'javax.sql.DataSource' for property 'dataSource'; nested
exception is java.lang.IllegalStateException: Cannot convert value of type
[org.apache.naming.NamingContext] to required type [javax.sql.DataSource]
for property 'dataSource': no matching editors or conversion strategy found
Thanks for your help
Erik
From: Francois Prunayre [mailto:fx.prunayre@anonymised.com]
Sent: 12 May 2015 10:21 AM
To: Erik Voges
Cc: Geonetwork-Users@anonymised.com
Subject: Re: [GeoNetwork-users] create scripts in 3.0
Hi Erik,
2015-05-12 11:03 GMT+02:00 Erik Voges <erik.voges@anonymised.com>:
Dear Community
I have installed version 3.0 and I am trying to switch from H2 to a
postgis
database.
When I start up my app in the Tomcat manager, I get these errors (among
others) :
2015-05-12 10:35:27,936 WARN [geonetwork] - Database does not
contain
any version information. Check that the database is a GeoNetwork database
with data. Migration step aborted.
org.springframework.beans.factory.BeanCreationException: Error creating
bean
with name 'entityManagerFactory' defined in URL
[jar:file:/opt/apache-tomcat-8.0.22/webapps/geonetwork/WEB-INF/lib/domain-3.
0.0-0.jar!/config-spring-geonetwork.xml]: Cannot resolve reference to bean
'jdbcDataSource' while setting bean property 'dataSource'; nested
exception
is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'jdbcDataSource': Post-processing of the FactoryBean's
object
failed; nested exception is java.lang.RuntimeException:
org.postgresql.util.PSQLException: Cannot commit when autoCommit is
enabled.
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
eReference(BeanDefinitionValueResolver.java:329)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
eValueIfNecessary(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(Ab
stractBeanFactory.java:296)
How did you configure the db connection ?
http://osgeo-org.1560.x6.nabble.com/Configure-Data-Base-version-3-td5203785.html#a5203932
may help
Now, I noticed that the directory with database create scripts is not
included in the war file .
/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/ - this directory
only
has "data" and "migrate" subdirectories. I wanted to run the create
scripts
manually to see if that would resolve my problem . but they are not there.
I have the previous version installed on another local server - it has the
"create" directory and scripts. Would it be ok if I use that for creating
a
database for the v3.0 server? Where else would I be able to find the
create
scripts for a v3.0 postgis database?
The database in 3.0 is create by the application (JPA) so there is no SQL
script for the structure. Only a script to populate the data and to handle
migration in case JPA can not deal with it.
HTH
Francois
Many thanks
Erik
Erik Voges
Systems Engineer - OADC/KE
DISCLAIMER & COPYRIGHT
This email and any accompanying attachments may contain confidential,
proprietary information and attached artwork which is subject to
international copyright laws. This information is private and protected by
law and, accordingly if you are not the intended recipient, you are
requested to delete this entire communication immediately and are notified
that any disclosure, copying or distribution of or taking any action based
on this information is prohibited.
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork