Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I had Geonetwork 2.8 running and formatted my Umbuntu 12_04 machine and can't seem to get it back or find the process I used to get it working the first time.

I am at the stage where tomcat 7 works but Geonetwork gives the following errors.

When I update catalina.sh based on instructions in http://geonetwork-opensource.org/_static/foss4g2010/FOSS4G_Mastering_Advanced_GeoNetwork.pdf

my Tomcat does not start.

Any ideas?


    Follow http://geonode.readthedocs.org/en/1.0/deploy/ubuntu.html with exceptions below.

    1. Install JRE - http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

    2. Install tomcat 7 (sudo apt-get install tomcat7 tomcat7-docs tomcat7-examples tomcat7-admin -y)

    3. Update JRE with "gksudo gedit /etc/default/tomcat7"

    4. gksudo gedit /etc/tomcat7/tomcat-users.xml

> Blockquote

ISSUES Viewing

    localhost:8080/geonetwork

> Raised exception while initializing resource main-db in
> /var/lib/tomcat7/webapps/geonetwork/WEB-INF/config.xml. Skipped.
> Exception         org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory (IO Exception:
> "java.io.FileNotFoundException: /var/lib/tomcat7/geonetwork.lock.db
> (Permission denied)"; "/var/lib/tomcat7/geonetwork.lock.db"
> [90031-152]) Resource         main-db Message         Cannot create
> PoolableConnectionFactory (IO Exception:
> "java.io.FileNotFoundException: /var/lib/tomcat7/geonetwork.lock.db
> (Permission denied)"; "/var/lib/tomcat7/geonetwork.lock.db"
> [90031-152]) Provider         jeeves.resources.dbms.ApacheDBCPool Stack
>       org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory (IO Exception:
> "java.io.FileNotFoundException: /var/lib/tomcat7/geonetwork.lock.db
> (Permission denied)"; "/var/lib/tomcat7/geonetwork.lock.db"
> [90031-152]) at
> org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
> at
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
> at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> at jeeves.resources.dbms.Dbms.connect(Dbms.java:88) at
> jeeves.resources.dbms.AbstractDbmsPool.open(AbstractDbmsPool.java:142)
> at jeeves.server.JeevesEngine.initResources(JeevesEngine.java:473) at
> jeeves.server.JeevesEngine.loadConfigFile(JeevesEngine.java:298) at
> jeeves.server.JeevesEngine.init(JeevesEngine.java:161) at
> jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:85)
> at javax.servlet.GenericServlet.init(GenericServlet.java:160) at
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
> at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
> at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
> at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
> at
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> at java.util.concurrent.FutureTask.run(FutureTask.java:166) at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:722) Caused by:
> org.h2.jdbc.JdbcSQLException: IO Exception:
> "java.io.FileNotFoundException: /var/lib/tomcat7/geonetwork.lock.db
> (Permission denied)"; "/var/lib/tomcat7/geonetwork.lock.db"
> [90031-152] at
> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:156) at
> org.h2.message.DbException.convertIOException(DbException.java:313) at
> org.h2.store.fs.FileSystemDisk.openFileOutputStream(FileSystemDisk.java:382)
> at org.h2.store.FileLock.save(FileLock.java:203) at
> org.h2.store.FileLock.lockFile(FileLock.java:335) at
> org.h2.store.FileLock.lock(FileLock.java:134) at
> org.h2.engine.Database.open(Database.java:535) at
> org.h2.engine.Database.openDatabase(Database.java:218) at
> org.h2.engine.Database.<init>(Database.java:213) at
> org.h2.engine.Engine.openSession(Engine.java:56) at
> org.h2.engine.Engine.openSession(Engine.java:159) at
> org.h2.engine.Engine.createSessionAndValidate(Engine.java:138) at
> org.h2.engine.Engine.createSession(Engine.java:121) at
> org.h2.engine.Engine.createSession(Engine.java:28) at
> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:285) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:114) at
> org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:98) at
> org.h2.Driver.connect(Driver.java:72) at
> org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
> at
> org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
> at
> org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
> at
> org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
> ... 26 more Caused by: java.io.FileNotFoundException:
> /var/lib/tomcat7/geonetwork.lock.db (Permission denied) at
> java.io.FileOutputStream.open(Native Method) at
> java.io.FileOutputStream.<init>(FileOutputStream.java:212) at
> java.io.FileOutputStream.<init>(FileOutputStream.java:136) at
> org.h2.store.fs.FileSystemDisk.openFileOutputStream(FileSystemDisk.java:374)
> ... 45 more

Before JVM/Saxon fix in catalina.sh

> ----------- root@atgis-linux:/var/lib/tomcat7/webapps/geonetwork/WEB-INF# service
> tomcat7 restart  * Stopping Tomcat servlet engine tomcat7             
> [ OK ]   * Starting Tomcat servlet engine tomcat7                     
> [ OK ]  root@atgis-linux:/var/lib/tomcat7/webapps/geonetwork/WEB-INF#
> wget http://lh:8080/geonetwork
> --2013-03-05 15:01:18--  http://lh:8080/geonetwork Resolving localhost (localhost)... 127.0.0.1 Connecting to localhost
> (localhost)|127.0.0.1|:8080... connected. HTTP request sent, awaiting
> response... 302 Found Location: http://lh:8080/geonetwork/
> [following]
> --2013-03-05 15:01:18--  http://lh:8080/geonetwork/ Reusing existing connection to localhost:8080. HTTP request sent, awaiting
> response... 200 OK Length: 666 [text/html] Saving to: 'geonetwork'
> 
> 100%[===============================================================>]
> 666         --.-K/s   in 0s      
> 
> 2013-03-05 15:01:18 (108 MB/s) - 'geonetwork' saved [666/666]

--------

Issue after fix

> root@atgis-linux:/var/lib/tomcat7/webapps/geonetwork/WEB-INF# service
> tomcat7 restart * Stopping Tomcat servlet engine tomcat7              
> [ OK ]   * Starting Tomcat servlet engine tomcat7                     
> [fail]
share|improve this question

1 Answer 1

Geonetwork's default configuration tries to put H2 database files directly in /var/lib/tomcat7, which is not writable by the tomcat user. You need to change this to a location that is writable, and that is persistent (won't get overwritten by a redeployment). A simple solution for this is using the tomcat user's home directory.

First, make sure your tomcat user's home directory is writable:

sudo chgrp tomcat7 /usr/share/tomcat7
sudo chmod g+w /usr/share/tomcat7

Then edit WEB-INF/config.xml in Geonetwork, and change the H2 url around line 153 from this:

<url>jdbc:h2:geonetwork;LOCK_TIMEOUT=20000;MVCC=TRUE</url>

to this:

<url>jdbc:h2:~/.geonetwork/geonetwork;LOCK_TIMEOUT=20000;MVCC=TRUE</url>

When you restart Tomcat Geonetwork should start without issue, and you can see the H2 db files under /usr/share/tomcat7/.geonetwork.

share|improve this answer
2  
Shane's answer worked for me with tomcat6 on debian. Just change the 7s to 6s. –  Raj Apr 17 '13 at 15:37
    
Thanks heaps for this answer. It helped me in a non GIS area and was very helpful. My area was using Tomcat 7 with Helenos for Cassandra Db on Ubunutu 14.04 LTS –  Dessus Jul 27 at 0:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.