We're updating the issue view to help you get more done. 

Database creation fails when localhost not set up correctly

Description

Running jstack during this 5 minute period I see:

"C3P0PooledConnectionPoolManager[identityToken->tys5dp9n86d1sl8vqh|f278eb]HelperThread#0" #9 daemon prio=5 os_prio=0 tid=0x7a1747b8 nid=0x75d3 runnable [0x79d60000]
java.lang.Thread.State: RUNNABLE
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)

  • locked <0x8eddfe38> (a java.lang.Object)
    at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:272)

  • locked <0x7c040f80> (a java.lang.Class for org.h2.util.NetUtils)
    at org.h2.store.FileLock.lockSocket(FileLock.java:380)
    at org.h2.store.FileLock.lock(FileLock.java:138)

  • locked <0x7be62750> (a org.h2.store.FileLock)
    at org.h2.engine.Database.open(Database.java:662)

  • locked <0x7bc23a90> (a org.h2.engine.Database)
    at org.h2.engine.Database.openDatabase(Database.java:276)
    at org.h2.engine.Database.<init>(Database.java:270)
    at org.h2.engine.Engine.openSession(Engine.java:64)
    at org.h2.engine.Engine.openSession(Engine.java:176)

  • locked <0x8ee8bc50> (a org.h2.engine.Engine)
    at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154)
    at org.h2.engine.Engine.createSession(Engine.java:137)
    at org.h2.engine.Engine.createSession(Engine.java:27)
    at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:354)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:116)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:100)
    at org.h2.Driver.connect(Driver.java:69)
    at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:146)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
    at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44)
    at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810)
    at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648)

calling java.net.InetAddress.getLocalHost() directly fails, fixed by editing /etc/hosts and adding th ehostname it complains it cannot find

Environment

None

Status

Assignee

Unassigned

Reporter

Paul Taylor

Labels

None

Forum Username

JayRice

os

None

Components

Fix versions

Affects versions

4.7

Priority

Major