Closed jeanpommier closed 5 years ago
Watch this maybe: https://github.com/geoadmin/geocat/commit/3047a04bd628edf3b0a6c4a9ba56f831cb1a5604
2 postgres JAR are included that may introduce conflicts.
I cannot reproduce this error with the docker image. There are two jars on the lib folder: postgresql-9.1-901.jdbc4.jar and postgresql-9.4.1211.jar, but no conflict comes up. @jeanpommier do you still have this error?
@jeanpommier @fgravin @pmauduit We'll make sure to add the 3.4. docker image, once it's released, and hopefully the problem will be solved.
Hi, Yes, I still can reproduce the error. That's weird, we shouldn't have different results, using docker, I don't get it. I've tried using postgresql server 9.4 (and 9.6 too) and I get the same error. Removing one of the postgres jar files solves the issue. I'm using docker 17.03.1-ce Anyway, I've got a workaround, it's no big deal, although it took me some time to find a solution (remove the file). That's why I reported it, so that someone else finding the same pb can get through quickly Thanks
@jeanpommier Thanks for reporting! Is this an error you get when starting GeoNetwork? Can you start Geonetwork at all (despite the errors)?
Nope, it doesn't start until I manually remove the duplicate jar and restart the container.
I have exactly the same docker version. Can you run the example on the docker hub page?
docker run --name some-postgres -p 5432:5432 -d postgres
docker run --name geonetwork -d -p 8080:8080 --link some-postgres:postgres -e POSTGRES_DB_USERNAME=postgres -e POSTGRES_DB_PASSWORD=mysecretpassword geonetwork:postgres
Hi, I've just done it. Same results : still that org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/usr/local/tomcat/webapps/geonetwork/WEB-INF/lib/domain-3.2.1-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' defined in URL [file:/usr/local/tomcat/webapps/geonetwork/WEB-INF/config-db/defaultJdbcDataSource.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.lang.NoSuchMethodError: org.postgresql.core.BaseConnection.getPreferQueryMode()Lorg/postgresql/jdbc/PreferQueryMode; ...
@jeanpommier this bug should no longer reproduce on the latest release: 3.2.2
When using the container geonetwork:3.2.1-postgres, I get an error similar to core-geonetwork issue 1887 (java.lang.NoSuchMethodError: org.postgresql.core.BaseConnection.getPreferQueryMode()Lorg/postgresql/jdbc/PreferQueryMode;). If I remove postgresql-9.4.1211.jar, the container starts properly, afterwards.