[2.3.4][HikariCP] Issues with HikariCP on Heroku

2,777 views
Skip to first unread message

Steve Chaloner

unread,
Sep 26, 2014, 2:30:27 PM9/26/14
to play-fr...@googlegroups.com
Hi,

I'm using Edulify's HikariCP plugin with a Play 2.3.4 app on Heroku.  The initial deploy worked fine, but once I made some changes to some view code and pushed to heroku the app fails with the following error:

[info] application - Starting HikariCP connection pool...
[info] application - Creating Pool for datasource 'default'
[info] application - Loading Hikari configuration from Play configuration.
[info] application - Loading from file configured by db.default.hikaricp.file that is Some(conf/hikaricp.prod.properties)
[info] application - Loading Hikari configuration from conf/hikaricp.prod.properties
[info] application - Properties: minimumIdle=5, idleTimeout=300000, driverClassName=org.postgresql.Driver, maximumPoolSize=10, jdbcUrl=postgres://<redacted>, maxLifetime=900000
[info] application - Registering driver org.postgresql.Driver
Oops, cannot start the server.
java.lang.RuntimeException: Unable to get driver for JDBC URL postgres://<redacted>
    at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:51)
     at com.zaxxer.hikari.pool.HikariPool.initializeDataSource(HikariPool.java:523)
     at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:137)
     at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:102)
     at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80)
     at com.edulify.play.hikaricp.HikariCPDBApi$$anonfun$1.apply(HikariCPDBApi.scala:37)
     at com.edulify.play.hikaricp.HikariCPDBApi$$anonfun$1.apply(HikariCPDBApi.scala:32)
     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
     at scala.collection.immutable.Set$Set1.foreach(Set.scala:74)
     at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
     at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
     at scala.collection.SetLike$class.map(SetLike.scala:93)
     at scala.collection.AbstractSet.map(Set.scala:47)
     at com.edulify.play.hikaricp.HikariCPDBApi.<init>(HikariCPDBApi.scala:32)
     at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi$lzycompute(HikariCPPlugin.scala:32)
     at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi(HikariCPPlugin.scala:32)
     at com.edulify.play.hikaricp.HikariCPPlugin.onStart(HikariCPPlugin.scala:38)
     at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
     at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
     at scala.collection.immutable.List.foreach(List.scala:318)
     at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
     at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
     at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
     at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
     at play.api.Play$.start(Play.scala:90)
     at play.core.StaticApplication.<init>(ApplicationProvider.scala:55)
     at play.core.server.NettyServer$.createServer(NettyServer.scala:244)
     at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:280)
     at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:275)
     at scala.Option.map(Option.scala:145)
     at play.core.server.NettyServer$.main(NettyServer.scala:275)
     at play.core.server.NettyServer.main(NettyServer.scala)
Process exited with status 255
State changed from starting to crashed

If I role back to the previous version, it works correctly again.

Spec:
Play 2.3.4
Scala 2.10.4
play-hikaricp 1.5.0

The connection details are exactly as specified on the play-hikaricp website:

jdbcUrl
=${env:DATABASE_URL}
driverClassName
=org.postgresql.Driver

connectionTestQuery
=SELECT 1
registerMbeans
=true

# 15 minutes
maxLifetime
=900000
# 5 minutes
idleTimeout
=300000

maximumPoolSize
=20
minimumIdle
=5




As usual, it all works fine locally...

Thanks for any pointers,
Steve

Brett Wooldridge

unread,
Sep 27, 2014, 9:39:31 AM9/27/14
to play-fr...@googlegroups.com
On Saturday, September 27, 2014 3:30:27 AM UTC+9, Steve Chaloner wrote:
Hi,

I'm using Edulify's HikariCP plugin with a Play 2.3.4 app on Heroku.  The initial deploy worked fine, but once I made some changes to some view code and pushed to heroku the app fails with the following error:

<snip>
 
If I role back to the previous version, it works correctly again.

Previous version of what?  HikariCP, Edulify plugin, or Play?

Steve Chaloner

unread,
Sep 27, 2014, 2:18:48 PM9/27/14
to play-fr...@googlegroups.com
Sorry for the lack of detail!

If I roll back to the previous Heroku version, it works. The only things that have changed are a couple of view classes. All db config, app config, etc, are the same.

Brett Wooldridge

unread,
Sep 28, 2014, 12:51:53 AM9/28/14
to play-fr...@googlegroups.com
Is postgres:// a valid URL for the PostgreSQL driver?  The documentation seems to indicate "jdbc:postgresql:// ...

Steve Chaloner

unread,
Sep 29, 2014, 1:38:37 AM9/29/14
to play-fr...@googlegroups.com
It's the JDBC URL that comes from Heroku, and it works correctly in some cases.  I'll try prefixing the connection string to see if that makes a difference.

--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/cmUXYk14G0o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Chaloner
st...@objectify.be
+32 (0)494 59 13 20

Sharpen your cutting edge...
http://www.objectify.be

Steve Chaloner

unread,
Sep 29, 2014, 9:00:13 AM9/29/14
to play-fr...@googlegroups.com
Changed the properties to

jdbcUrl=jdbc:${env:DATABASE_URL}



Pushed to Heroku, but the same problem again.


On Monday, 29 September 2014 07:38:37 UTC+2, Steve Chaloner wrote:
It's the JDBC URL that comes from Heroku, and it works correctly in some cases.  I'll try prefixing the connection string to see if that makes a difference.
On Sun, Sep 28, 2014 at 6:51 AM, Brett Wooldridge <brett.wo...@gmail.com> wrote:
Is postgres:// a valid URL for the PostgreSQL driver?  The documentation seems to indicate "jdbc:postgresql:// ...


On Sunday, September 28, 2014 3:18:48 AM UTC+9, Steve Chaloner wrote:
Sorry for the lack of detail!

If I roll back to the previous Heroku version, it works.  The only things that have changed are a couple of view classes.  All db config, app config, etc, are the same.

--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/cmUXYk14G0o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framework+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Brett Wooldridge

unread,
Sep 29, 2014, 10:12:51 AM9/29/14
to play-fr...@googlegroups.com
Any way to try the development branch of HikariCP (HikariCP 2.1.0-SNAPSHOT)?  We did have a user reporting a PostgreSQL issue with 2.0.1, but it was with PGDataSource not driver-based configuration.  Looking at the Play code a bit (and the plugin code), it appears to use play.util.ProxyDriver ... which is indeed expecting postgres:// style URL.  I'm a bit out of my element as I am neither a Play developer nor the author of the Edulify plugin.  At first blush, I would say open a tracking issue over at the play-hikaricp project.  I'll continue taking a look as well.

The line of code in HikariCP that is throwing is:

DriverManager.getDriver(jdbcUrl)


Which is caught as a SQLException, and rethrown as a RuntimeException.  It's our bad for not including the original exception in the rethrow.  That is fixed in the dev branch, and might provide more information.


Brett



On Monday, September 29, 2014 10:00:13 PM UTC+9, Steve Chaloner wrote:
Changed the properties to

jdbcUrl=jdbc:${env:DATABASE_URL}



Pushed to Heroku, but the same problem again.

On Monday, 29 September 2014 07:38:37 UTC+2, Steve Chaloner wrote:
It's the JDBC URL that comes from Heroku, and it works correctly in some cases.  I'll try prefixing the connection string to see if that makes a difference.
On Sun, Sep 28, 2014 at 6:51 AM, Brett Wooldridge <brett.wo...@gmail.com> wrote:
Is postgres:// a valid URL for the PostgreSQL driver?  The documentation seems to indicate "jdbc:postgresql:// ...


On Sunday, September 28, 2014 3:18:48 AM UTC+9, Steve Chaloner wrote:
Sorry for the lack of detail!

If I roll back to the previous Heroku version, it works.  The only things that have changed are a couple of view classes.  All db config, app config, etc, are the same.

--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/cmUXYk14G0o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Megazord

unread,
Sep 29, 2014, 3:04:31 PM9/29/14
to play-fr...@googlegroups.com
Hi,

I'm the author of play-hiikari plugin. Here are some things you could do to give us more information:

1. Configure HikariCP logs to debug level
2. Is there any logs when shutting down the application before deploying new code?
3. How is your project/play.plugins file?

Best,

Joe Kutner

unread,
Sep 29, 2014, 3:59:51 PM9/29/14
to play-fr...@googlegroups.com
The Heroku DATABASE_URL will be in the form postgres://<username>:<password>@<path>. Usually I split this up before sending it to DriverManager, like so:

val dbUri = new URI(System.getenv("DATABASE_URL"))
val username = dbUri.getUserInfo.split(":")(0)
val password = dbUri.getUserInfo.split(":")(1)
val dbUrl = "jdbc:postgresql://" + dbUri.getHost + dbUri.getPath
DriverManager.getConnection(dbUrl, username, password)

Also, I think you need "postgresql" instead of "postgres"

Could that be the problem?

Steve Chaloner

unread,
Sep 29, 2014, 4:20:13 PM9/29/14
to play-fr...@googlegroups.com
Are the HikariCP snapshots available in a public repo?  I can't see them in Maven Central, etc.  When I get that, I'll put a dev build of the Play plugin into my github-based Ivy repo and pull it into Heroku from there.

Steve Chaloner

unread,
Sep 29, 2014, 4:31:05 PM9/29/14
to play-fr...@googlegroups.com
Hi,

1. Check the end of this post for the full debug output
2. I don't have them to hand any more - will roll back to an earlier deploy on heroku and get them
3. play.plugins:

200:com.edulify.play.hikaricp.HikariCPPlugin
1500:com.typesafe.plugin.CommonsMailerPlugin
10000:be.objectify.deadbolt.java.DeadboltPlugin
20000:com.fashiontonic.security.MyUserServicePlugin
20010:com.feth.play.module.pa.providers.oauth1.twitter.TwitterAuthProvider




Heroku logs:


2014-09-29T20:08:06.301412+00:00 heroku[web.1]: State changed from starting to crashed
2014-09-29T20:08:06.302058+00:00 heroku[web.1]: State changed from crashed to starting
2014-09-29T20:08:13.361587+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/fashiontonic -Dhttp.port=${PORT} -Dplay.version=2.3.4 -Devolutionplugin=disabled -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=postgres://najredactpvg:y42Q2gho8Mr...@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bj74a2etf0ua`
2014-09-29T20:08:14.305444+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
2014-09-29T20:08:14.762952+00:00 app[web.1]: Play server process ID is 2
2014-09-29T20:08:15.710194+00:00 app[web.1]: [debug] play - Plugin [play.api.db.BoneCPPlugin] is disabled
2014-09-29T20:08:15.736558+00:00 app[web.1]: [debug] play - Plugin [play.api.db.evolutions.EvolutionsPlugin] is disabled
2014-09-29T20:08:16.436676+00:00 app[web.1]: [info] application - Starting HikariCP connection pool...
2014-09-29T20:08:16.441213+00:00 app[web.1]: [info] application - Creating Pool for datasource 'default'
2014-09-29T20:08:17.196515+00:00 app[web.1]: [info] application - Loading Hikari configuration from Play configuration.
2014-09-29T20:08:17.197851+00:00 app[web.1]: [info] application - Loading from file configured by db.default.hikaricp.file that is Some(conf/hikaricp.prod.properties)
2014-09-29T20:08:17.198582+00:00 app[web.1]: [info] application - Loading Hikari configuration from conf/hikaricp.prod.properties
2014-09-29T20:08:17.221339+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - FileName set to hikaricp.prod.properties
2014-09-29T20:08:17.221707+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - Base path set to /app/target/universal/stage/conf
2014-09-29T20:08:17.228411+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - ConfigurationUtils.locate(): base is /app/target/universal/stage/conf, name is hikaricp.prod.properties
2014-09-29T20:08:17.228850+00:00 app[web.1]: [debug] o.a.c.c.DefaultFileSystem - Could not locate file hikaricp.prod.properties at /app/target/universal/stage/conf: no protocol: /app/target/universal/stage/conf
2014-09-29T20:08:17.229252+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - Loading configuration from the path /app/target/universal/stage/conf/hikaricp.prod.properties
2014-09-29T20:08:17.275029+00:00 app[web.1]: [info] application - Properties: connectionTestQuery=SELECT 1, minimumIdle=5, idleTimeout=300000, driverClassName=org.postgresql.Driver, registerMbeans=true, maximumPoolSize=20, jdbcUrl=postgres://najiredactpvg:y42Q2redac...@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua, maxLifetime=900000
2014-09-29T20:08:17.285977+00:00 app[web.1]: [info] application - Registering driver org.postgresql.Driver
2014-09-29T20:08:17.289198+00:00 app[web.1]: [debug] c.z.h.HikariConfig - HikariCP pool HikariPool-0 configuration:
2014-09-29T20:08:17.295728+00:00 app[web.1]: [debug] c.z.h.HikariConfig - autoCommit......................true
2014-09-29T20:08:17.295887+00:00 app[web.1]: [debug] c.z.h.HikariConfig - catalog.........................
2014-09-29T20:08:17.296036+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionCustomizer............com.zaxxer.hikari.HikariConfig$1@57a6a9f4
2014-09-29T20:08:17.296139+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionCustomizerClassName...
2014-09-29T20:08:17.296281+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionInitSql...............
2014-09-29T20:08:17.296384+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionTestQuery.............SELECT 1
2014-09-29T20:08:17.296503+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionTimeout...............30000
2014-09-29T20:08:17.296610+00:00 app[web.1]: [debug] c.z.h.HikariConfig - dataSource......................
2014-09-29T20:08:17.296713+00:00 app[web.1]: [debug] c.z.h.HikariConfig - dataSourceClassName.............
2014-09-29T20:08:17.296819+00:00 app[web.1]: [debug] c.z.h.HikariConfig - dataSourceJNDI..................
2014-09-29T20:08:17.29716
2014-09-29T20:08:17.297329+00:00 app[web.1]: [debug] c.z.h.HikariConfig - driverClassName.................
2014-09-29T20:08:17.297449+00:00 app[web.1]: [debug] c.z.h.HikariConfig - idleTimeout.....................300000
2014-09-29T20:08:17.297588+00:00 app[web.1]: [debug] c.z.h.HikariConfig - initializationFailFast..........false
2014-09-29T20:08:17.297725+00:00 app[web.1]: [debug] c.z.h.HikariConfig - isolateInternalQueries..........false
2014-09-29T20:08:17.297896+00:00 app[web.1]: [debug] c.z.h.HikariConfig - jdbc4ConnectionTest.............false
2014-09-29T20:08:17.298019+00:00 app[web.1]: [debug] c.z.h.HikariConfig - jdbcUrl.........................postgres://najredactpvg:y42Q2ghored...@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua
2014-09-29T20:08:17.298169+00:00 app[web.1]: [debug] c.z.h.HikariConfig - leakDetectionThreshold..........0
2014-09-29T20:08:17.298235+00:00 app[web.1]: [debug] c.z.h.HikariConfig - maxLifetime.....................900000
2014-09-29T20:08:17.298356+00:00 app[web.1]: [debug] c.z.h.HikariConfig - maximumPoolSize.................20
2014-09-29T20:08:17.298454+00:00 app[web.1]: [debug] c.z.h.HikariConfig - metricsTrackerClassName.........com.zaxxer.hikari.metrics.CodaHaleMetricsTracker
2014-09-29T20:08:17.298557+00:00 app[web.1]: [debug] c.z.h.HikariConfig - minimumIdle.....................5
2014-09-29T20:08:17.298661+00:00 app[web.1]: [debug] c.z.h.HikariConfig - password........................<masked>
2014-09-29T20:08:17.298770+00:00 app[web.1]: [debug] c.z.h.HikariConfig - poolName........................HikariPool-0
2014-09-29T20:08:17.298907+00:00 app[web.1]: [debug] c.z.h.HikariConfig - readOnly........................false
2014-09-29T20:08:17.299041+00:00 app[web.1]: [debug] c.z.h.HikariConfig - recordMetrics...................false
2014-09-29T20:08:17.299187+00:00 app[web.1]: [debug] c.z.h.HikariConfig - registerMbeans..................true
2014-09-29T20:08:17.299368+00:00 app[web.1]: [debug] c.z.h.HikariConfig - threadFactory...................
2014-09-29T20:08:17.299491+00:00 app[web.1]: [debug] c.z.h.HikariConfig - transactionIsolation............-1
2014-09-29T20:08:17.299597+00:00 app[web.1]: [debug] c.z.h.HikariConfig - username........................
2014-09-29T20:08:17.301725+00:00 app[web.1]: [info] c.z.h.HikariDataSource - HikariCP pool HikariPool-0 is starting.
2014-09-29T20:08:17.311135+00:00 app[web.1]: Oops, cannot start the server.
2014-09-29T20:08:17.311614+00:00 app[web.1]: java.lang.RuntimeException: Unable to get driver for JDBC URL postgres://naredactpvg:y42QredactX...@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua
2014-09-29T20:08:17.311823+00:00 app[web.1]:     at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:51)
2014-09-29T20:08:17.311865+00:00 app[web.1]:     at com.zaxxer.hikari.pool.HikariPool.initializeDataSource(HikariPool.java:523)
2014-09-29T20:08:17.311906+00:00 app[web.1]:     at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:137)
2014-09-29T20:08:17.311947+00:00 app[web.1]:     at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:102)
2014-09-29T20:08:17.312006+00:00 app[web.1]:     at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80)
2014-09-29T20:08:17.312048+00:00 app[web.1]:     at com.edulify.play.hikaricp.HikariCPDBApi$$anonfun$1.apply(HikariCPDBApi.scala:37)
2014-09-29T20:08:17.312089+00:00 app[web.1]:     at com.edulify.play.hikaricp.HikariCPDBApi$$anonfun$1.apply(HikariCPDBApi.scala:32)
2014-09-29T20:08:17.312130+00:00 app[web.1]:     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
2014-09-29T20:08:17.312170+00:00 app[web.1]:     at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
2014-09-29T20:08:17.312210+00:00 app[web.1]:     at scala.collection.immutable.Set$Set1.foreach(Set.scala:74)
2014-09-29T20:08:17.312250+00:00 app[web.1]:     at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
2014-09-29T20:08:17.312291+00:00 app[web.1]:     at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
2014-09-29T20:08:17.312330+00:00 app[web.1]:     at scala.collection.SetLike$class.map(SetLike.scala:93)
2014-09-29T20:08:17.312369+00:00 app[web.1]:     at scala.collection.AbstractSet.map(Set.scala:47)
2014-09-29T20:08:17.312410+00:00 app[web.1]:     at com.edulify.play.hikaricp.HikariCPDBApi.<init>(HikariCPDBApi.scala:32)
2014-09-29T20:08:17.312452+00:00 app[web.1]:     at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi$lzycompute(HikariCPPlugin.scala:32)
2014-09-29T20:08:17.312494+00:00 app[web.1]:     at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi(HikariCPPlugin.scala:32)
2014-09-29T20:08:17.312534+00:00 app[web.1]:     at com.edulify.play.hikaricp.HikariCPPlugin.onStart(HikariCPPlugin.scala:38)
2014-09-29T20:08:17.312574+00:00 app[web.1]:     at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2014-09-29T20:08:17.312614+00:00 app[web.1]:     at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2014-09-29T20:08:17.312653+00:00 app[web.1]:     at scala.collection.immutable.List.foreach(List.scala:318)
2014-09-29T20:08:17.312710+00:00 app[web.1]:     at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
2014-09-29T20:08:17.312750+00:00 app[web.1]:     at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2014-09-29T20:08:17.312802+00:00 app[web.1]:     at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2014-09-29T20:08:17.312829+00:00 app[web.1]:     at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
2014-09-29T20:08:17.312871+00:00 app[web.1]:     at play.api.Play$.start(Play.scala:90)
2014-09-29T20:08:17.312907+00:00 app[web.1]:     at play.core.StaticApplication.<init>(ApplicationProvider.scala:55)
2014-09-29T20:08:17.312952+00:00 app[web.1]:     at play.core.server.NettyServer$.createServer(NettyServer.scala:244)
2014-09-29T20:08:17.312990+00:00 app[web.1]:     at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:280)
2014-09-29T20:08:17.313029+00:00 app[web.1]:     at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:275)
2014-09-29T20:08:17.313072+00:00 app[web.1]:     at scala.Option.map(Option.scala:145)
2014-09-29T20:08:17.313108+00:00 app[web.1]:     at play.core.server.NettyServer$.main(NettyServer.scala:275)
2014-09-29T20:08:17.313146+00:00 app[web.1]:     at play.core.server.NettyServer.main(NettyServer.scala)
2014-09-29T20:08:18.071717+00:00 heroku[web.1]: Process exited with status 255
2014-09-29T20:08:18.082197+00:00 heroku[web.1]: State changed from starting to crashed


sachin walia

unread,
Sep 29, 2014, 5:15:48 PM9/29/14
to play-fr...@googlegroups.com
Megazord,

as per JDBC 4 specs there should not be any need for this call at all. Beginning JDBC 4 the declaration of drivers are done in META-INF/service/java.sql.Driver file.


I have also built a play plugin for HikariCP in Java which little different than yours as it supports encrypted credentials and ability to switch to Postgres Impossibl JDBC driver. I didn't really went with the way of registering JDBC Driver either. Also postgres jdbc driver is JDBC 4 compliant which also eliminates the need for this static initialization.

Hope this helps.

thanks,

Sachin Walia

Megazord

unread,
Sep 30, 2014, 1:34:52 PM9/30/14
to play-fr...@googlegroups.com
Steve,

Not sure if this is having some effect on your application, but why are you passing "-Ddb.default.driver=org.postgresql.Driver" and "-Ddb.default.url" parameters in the start command? I mean, maybe they are in some way interfering in the whole plugin start cycle. Moreover, are you able to share a small app that reproduces the problem?

Sachin, I understand that we can use HikariCP with a non JDBC 4 driver, which will require to load the class driver, correct?

Best,

sachin walia

unread,
Sep 30, 2014, 5:25:16 PM9/30/14
to play-fr...@googlegroups.com
Megazord,

didn't mean to confuse. What I mentioned was that Postgres provides JDBC type 4 driver which is compliant with JDBC 4.x API spec. (Sorry if language sounds convoluted). 


In above URL postgres provided comparison of all the different JDBC API specs supported by different drivers.

Only drivers that support API spec 4.0 and above doesn't require static initialization.

thanks.

Megazord

unread,
Sep 30, 2014, 8:02:00 PM9/30/14
to play-fr...@googlegroups.com
Sachin, don't worry at all. :-)

E-mails can "sound" trick, specially when people (like me) are not writing in their mother language. Do you think it is necessary to do different initialization based on which version of JDBC the driver supports?

Steve,

By the way, which version of the PostgreSQL driver are you using?

sachin walia

unread,
Oct 3, 2014, 12:56:04 PM10/3/14
to play-fr...@googlegroups.com
Since you are planning to support JDBC API spec prior to V 4.0 so it probably is OK to do static initialization. In my case we use the latest release build of Postgres JDBC API spec 4 driver in our monthly production upgrade so we dont have to do static initialization. If you want I can share some code as well. I was planning to release this as Play plugin with support for DB encryption keys but never get around to it.

Christopher Robin Elmersson

unread,
Feb 7, 2015, 4:00:32 AM2/7/15
to play-fr...@googlegroups.com
Steve, did you ever manage to solve this on Heroku? I'm running into the same error message.

All that's in my configuration is:

jdbcUrl=${env:DATABASE_URL}
username=XXX
password=XXX
driverClassName=org.postgresql.Driver
registerMbeans=true
# 15 minutes
maxLifetime=900000
# 5 minutes
idleTimeout=300000
maximumPoolSize=20
minimumIdle=5

Heroku log output:

2015-02-07T08:51:36.535338+00:00 app[web.1]: 08:51:36 [info] application - Loading Hikari configuration from conf/hikaricp.prod.properties
2015-02-07T08:51:36.667842+00:00 app[web.1]: 08:51:36 [info] application - Registering driver org.postgresql.Driver
2015-02-07T08:51:36.706186+00:00 app[web.1]: java.lang.RuntimeException: Unable to get driver for JDBC URL postgres://XXX:X...@ec2-23-21-154-37.compute-1.amazonaws.com:5432/XXX
2015-02-07T08:51:36.712989+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi$lzycompute(HikariCPPlugin.scala:32)
2015-02-07T08:51:36.713127+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi(HikariCPPlugin.scala:32)
2015-02-07T08:51:36.713246+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.onStart(HikariCPPlugin.scala:38)
2015-02-07T08:51:36.713364+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2015-02-07T08:51:36.713485+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2015-02-07T08:51:36.713605+00:00 app[web.1]: at scala.collection.immutable.List.foreach(List.scala:381)
2015-02-07T08:51:36.713724+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
2015-02-07T08:51:36.713842+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2015-02-07T08:51:36.713961+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2015-02-07T08:51:36.714101+00:00 app[web.1]: at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
2015-02-07T08:51:36.718455+00:00 app[web.1]: at play.api.Play$.start(Play.scala:90)


Den måndag 29 september 2014 kl. 22:31:05 UTC+2 skrev Steve Chaloner:
Hi,

1. Check the end of this post for the full debug output
2. I don't have them to hand any more - will roll back to an earlier deploy on heroku and get them
3. play.plugins:

200:com.edulify.play.hikaricp.HikariCPPlugin
1500:com.typesafe.plugin.CommonsMailerPlugin
10000:be.objectify.deadbolt.java.DeadboltPlugin
20000:com.fashiontonic.security.MyUserServicePlugin
20010:com.feth.play.module.pa.providers.oauth1.twitter.TwitterAuthProvider




Heroku logs:


2014-09-29T20:08:06.301412+00:00 heroku[web.1]: State changed from starting to crashed
2014-09-29T20:08:06.302058+00:00 heroku[web.1]: State changed from crashed to starting
2014-09-29T20:08:13.361587+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/fashiontonic -Dhttp.port=${PORT} -Dplay.version=2.3.4 -Devolutionplugin=disabled -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=postgres://najredactpvg:y42Q2gho8MredactrMfd0jz@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bj74a2etf0ua`

2014-09-29T20:08:14.305444+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
2014-09-29T20:08:14.762952+00:00 app[web.1]: Play server process ID is 2
2014-09-29T20:08:15.710194+00:00 app[web.1]: [debug] play - Plugin [play.api.db.BoneCPPlugin] is disabled
2014-09-29T20:08:15.736558+00:00 app[web.1]: [debug] play - Plugin [play.api.db.evolutions.EvolutionsPlugin] is disabled
2014-09-29T20:08:16.436676+00:00 app[web.1]: [info] application - Starting HikariCP connection pool...
2014-09-29T20:08:16.441213+00:00 app[web.1]: [info] application - Creating Pool for datasource 'default'
2014-09-29T20:08:17.196515+00:00 app[web.1]: [info] application - Loading Hikari configuration from Play configuration.
2014-09-29T20:08:17.197851+00:00 app[web.1]: [info] application - Loading from file configured by db.default.hikaricp.file that is Some(conf/hikaricp.prod.properties)
2014-09-29T20:08:17.198582+00:00 app[web.1]: [info] application - Loading Hikari configuration from conf/hikaricp.prod.properties
2014-09-29T20:08:17.221339+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - FileName set to hikaricp.prod.properties
2014-09-29T20:08:17.221707+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - Base path set to /app/target/universal/stage/conf
2014-09-29T20:08:17.228411+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - ConfigurationUtils.locate(): base is /app/target/universal/stage/conf, name is hikaricp.prod.properties
2014-09-29T20:08:17.228850+00:00 app[web.1]: [debug] o.a.c.c.DefaultFileSystem - Could not locate file hikaricp.prod.properties at /app/target/universal/stage/conf: no protocol: /app/target/universal/stage/conf
2014-09-29T20:08:17.229252+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - Loading configuration from the path /app/target/universal/stage/conf/hikaricp.prod.properties
2014-09-29T20:08:17.275029+00:00 app[web.1]: [info] application - Properties: connectionTestQuery=SELECT 1, minimumIdle=5, idleTimeout=300000, driverClassName=org.postgresql.Driver, registerMbeans=true, maximumPoolSize=20, jdbcUrl=postgres://najiredactpvg:y42Q2redactN4mrMfd0jz@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua, maxLifetime=900000

2014-09-29T20:08:17.285977+00:00 app[web.1]: [info] application - Registering driver org.postgresql.Driver
2014-09-29T20:08:17.289198+00:00 app[web.1]: [debug] c.z.h.HikariConfig - HikariCP pool HikariPool-0 configuration:
2014-09-29T20:08:17.295728+00:00 app[web.1]: [debug] c.z.h.HikariConfig - autoCommit......................true
2014-09-29T20:08:17.295887+00:00 app[web.1]: [debug] c.z.h.HikariConfig - catalog.........................
2014-09-29T20:08:17.296036+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionCustomizer............com.zaxxer.hikari.HikariConfig$1@57a6a9f4
2014-09-29T20:08:17.296139+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionCustomizerClassName...
2014-09-29T20:08:17.296281+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionInitSql...............
2014-09-29T20:08:17.296384+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionTestQuery.............SELECT 1
2014-09-29T20:08:17.296503+00:00 app[web.1]: [debug] c.z.h.HikariConfig - connectionTimeout...............30000
2014-09-29T20:08:17.296610+00:00 app[web.1]: [debug] c.z.h.HikariConfig - dataSource......................
2014-09-29T20:08:17.296713+00:00 app[web.1]: [debug] c.z.h.HikariConfig - dataSourceClassName.............
2014-09-29T20:08:17.296819+00:00 app[web.1]: [debug] c.z.h.HikariConfig - dataSourceJNDI..................
2014-09-29T20:08:17.29716
2014-09-29T20:08:17.297329+00:00 app[web.1]: [debug] c.z.h.HikariConfig - driverClassName.................
2014-09-29T20:08:17.297449+00:00 app[web.1]: [debug] c.z.h.HikariConfig - idleTimeout.....................300000
2014-09-29T20:08:17.297588+00:00 app[web.1]: [debug] c.z.h.HikariConfig - initializationFailFast..........false
2014-09-29T20:08:17.297725+00:00 app[web.1]: [debug] c.z.h.HikariConfig - isolateInternalQueries..........false
2014-09-29T20:08:17.297896+00:00 app[web.1]: [debug] c.z.h.HikariConfig - jdbc4ConnectionTest.............false
2014-09-29T20:08:17.298019+00:00 app[web.1]: [debug] c.z.h.HikariConfig - jdbcUrl.........................postgres://najredactpvg:y42Q2ghoredact4mrMfd0jz@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua

2014-09-29T20:08:17.298169+00:00 app[web.1]: [debug] c.z.h.HikariConfig - leakDetectionThreshold..........0
2014-09-29T20:08:17.298235+00:00 app[web.1]: [debug] c.z.h.HikariConfig - maxLifetime.....................900000
2014-09-29T20:08:17.298356+00:00 app[web.1]: [debug] c.z.h.HikariConfig - maximumPoolSize.................20
2014-09-29T20:08:17.298454+00:00 app[web.1]: [debug] c.z.h.HikariConfig - metricsTrackerClassName.........com.zaxxer.hikari.metrics.CodaHaleMetricsTracker
2014-09-29T20:08:17.298557+00:00 app[web.1]: [debug] c.z.h.HikariConfig - minimumIdle.....................5
2014-09-29T20:08:17.298661+00:00 app[web.1]: [debug] c.z.h.HikariConfig - password........................<masked>
2014-09-29T20:08:17.298770+00:00 app[web.1]: [debug] c.z.h.HikariConfig - poolName........................HikariPool-0
2014-09-29T20:08:17.298907+00:00 app[web.1]: [debug] c.z.h.HikariConfig - readOnly........................false
2014-09-29T20:08:17.299041+00:00 app[web.1]: [debug] c.z.h.HikariConfig - recordMetrics...................false
2014-09-29T20:08:17.299187+00:00 app[web.1]: [debug] c.z.h.HikariConfig - registerMbeans..................true
2014-09-29T20:08:17.299368+00:00 app[web.1]: [debug] c.z.h.HikariConfig - threadFactory...................
2014-09-29T20:08:17.299491+00:00 app[web.1]: [debug] c.z.h.HikariConfig - transactionIsolation............-1
2014-09-29T20:08:17.299597+00:00 app[web.1]: [debug] c.z.h.HikariConfig - username........................
2014-09-29T20:08:17.301725+00:00 app[web.1]: [info] c.z.h.HikariDataSource - HikariCP pool HikariPool-0 is starting.
2014-09-29T20:08:17.311135+00:00 app[web.1]: Oops, cannot start the server.
2014-09-29T20:08:17.311614+00:00 app[web.1]: java.lang.RuntimeException: Unable to get driver for JDBC URL postgres://naredactpvg:y42QredactXjN4mrMfd0jz@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua

Steve Chaloner

unread,
Feb 7, 2015, 6:58:53 AM2/7/15
to play-fr...@googlegroups.com
I put the issue on one side because of other priorities.  I need to investigate this again, so I'll give some more useful feedback later.  Which version of Play and the HikariCP plugin are you using?

Regards,
Steve

On Saturday, 7 February 2015 10:00:32 UTC+1, Christopher Robin Elmersson wrote:
Steve, did you ever manage to solve this on Heroku? I'm running into the same error message.

All that's in my configuration is:

jdbcUrl=${env:DATABASE_URL}
username=XXX
password=XXX
driverClassName=org.postgresql.Driver
registerMbeans=true
# 15 minutes
maxLifetime=900000
# 5 minutes
idleTimeout=300000
maximumPoolSize=20
minimumIdle=5

Heroku log output:
2015-02-07T08:51:36.535338+00:00 app[web.1]: 08:51:36 [info] application - Loading Hikari configuration from conf/hikaricp.prod.properties
2015-02-07T08:51:36.667842+00:00 app[web.1]: 08:51:36 [info] application - Registering driver org.postgresql.Driver
2015-02-07T08:51:36.706186+00:00 app[web.1]: java.lang.RuntimeException: Unable to get driver for JDBC URL postgres://XXX:XXX@ec2-23-21-154-37.compute-1.amazonaws.com:5432/XXX
...

Christopher Robin Elmersson

unread,
Feb 7, 2015, 9:28:25 AM2/7/15
to play-fr...@googlegroups.com
I've tried various combinations. Currently play 2.3.5 and HikariCP 1.5.1 (the play plugin that is). I'll let you know if I figure it out.
...

Joe Kutner

unread,
Feb 7, 2015, 9:36:03 AM2/7/15
to play-fr...@googlegroups.com
The Heroku DATABASE_URL is in the form postgres://<username>:<
password>@<path>. It needs to be parse before sending it to DriverManager, like so:


val dbUri = new URI(System.getenv("DATABASE_URL"))
val username = dbUri.getUserInfo.split(":")(0)
val password = dbUri.getUserInfo.split(":")(1)
val dbUrl = "jdbc:postgresql://" + dbUri.getHost + dbUri.getPath
DriverManager.getConnection(dbUrl, username, password)

Also, I think you need "postgresql" instead of "postgres"

Could that be the problem?
...

Joe Kutner

unread,
Feb 7, 2015, 11:06:53 AM2/7/15
to play-fr...@googlegroups.com, play-fr...@googlegroups.com
I looked at the HikariCP docs and they do say to use DATABASE_URL as is. But that error is usually what you get if you don't parse the string into a proper jdbcUrl. 

Do you have a sample project I can deploy and play around with it?



2015-02-07T08:51:36.706186+00:00 app[web.1]: java.lang.RuntimeException: Unable to get driver for JDBC URL postgres://XXX:X...@ec2-23-21-154-37.compute-1.amazonaws.com:5432/XXX
2015-02-07T08:51:36.712989+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi$lzycompute(HikariCPPlugin.scala:32)
2015-02-07T08:51:36.713127+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi(HikariCPPlugin.scala:32)
2015-02-07T08:51:36.713246+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.onStart(HikariCPPlugin.scala:38)
2015-02-07T08:51:36.713364+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2015-02-07T08:51:36.713485+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2015-02-07T08:51:36.713605+00:00 app[web.1]: at scala.collection.immutable.List.foreach(List.scala:381)
2015-02-07T08:51:36.713724+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
2015-02-07T08:51:36.713842+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2015-02-07T08:51:36.713961+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2015-02-07T08:51:36.714101+00:00 app[web.1]: at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
2015-02-07T08:51:36.718455+00:00 app[web.1]: at play.api.Play$.start(Play.scala:90)
Den måndag 29 september 2014 kl. 22:31:05 UTC+2 skrev Steve Chaloner:
Hi,

1. Check the end of this post for the full debug output
2. I don't have them to hand any more - will roll back to an earlier deploy on heroku and get them
3. play.plugins:

200:com.edulify.play.hikaricp.HikariCPPlugin
1500:com.typesafe.plugin.CommonsMailerPlugin
10000:be.objectify.deadbolt.java.DeadboltPlugin
20000:com.fashiontonic.security.MyUserServicePlugin
20010:com.feth.play.module.pa.providers.oauth1.twitter.TwitterAuthProvider




Heroku logs:


2014-09-29T20:08:06.301412+00:00 heroku[web.1]: State changed from starting to crashed
2014-09-29T20:08:06.302058+00:00 heroku[web.1]: State changed from crashed to starting
2014-09-29T20:08:13.361587+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/fashiontonic -Dhttp.port=${PORT} -Dplay.version=2.3.4 -Devolutionplugin=disabled -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=postgres://najredactpvg:y42Q2gho8Mr...@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bj74a2etf0ua`

2014-09-29T20:08:14.305444+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
2014-09-29T20:08:14.762952+00:00 app[web.1]: Play server process ID is 2
2014-09-29T20:08:15.710194+00:00 app[web.1]: [debug] play - Plugin [play.api.db.BoneCPPlugin] is disabled
2014-09-29T20:08:15.736558+00:00 app[web.1]: [debug] play - Plugin [play.api.db.evolutions.EvolutionsPlugin] is disabled
2014-09-29T20:08:16.436676+00:00 app[web.1]: [info] application - Starting HikariCP connection pool...
2014-09-29T20:08:16.441213+00:00 app[web.1]: [info] application - Creating Pool for datasource 'default'
2014-09-29T20:08:17.196515+00:00 app[web.1]: [info] application - Loading Hikari configuration from Play configuration.
2014-09-29T20:08:17.197851+00:00 app[web.1]: [info] application - Loading from file configured by db.default.hikaricp.file that is Some(conf/hikaricp.prod.properties)
2014-09-29T20:08:17.198582+00:00 app[web.1]: [info] application - Loading Hikari configuration from conf/hikaricp.prod.properties
2014-09-29T20:08:17.221339+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - FileName set to hikaricp.prod.properties
2014-09-29T20:08:17.221707+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - Base path set to /app/target/universal/stage/conf
2014-09-29T20:08:17.228411+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - ConfigurationUtils.locate(): base is /app/target/universal/stage/conf, name is hikaricp.prod.properties
2014-09-29T20:08:17.228850+00:00 app[web.1]: [debug] o.a.c.c.DefaultFileSystem - Could not locate file hikaricp.prod.properties at /app/target/universal/stage/conf: no protocol: /app/target/universal/stage/conf
2014-09-29T20:08:17.229252+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - Loading configuration from the path /app/target/universal/stage/conf/hikaricp.prod.properties
2014-09-29T20:08:17.275029+00:00 app[web.1]: [info] application - Properties: connectionTestQuery=SELECT 1, minimumIdle=5, idleTimeout=300000, driverClassName=org.postgresql.Driver, registerMbeans=true, maximumPoolSize=20, jdbcUrl=postgres://najiredactpvg:y42Q2redac...@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua, maxLifetime=900000

2014-09-29T20:08:17.285977+00:00 app[web.1]: [info] application - Registering driver org.postgresql.Driver
2014-09-29T20:08:17.289198+00:00 app[web.1]: [debug] c.z.h.HikariConfig - HikariCP pool HikariPool-0 configuration:
2014-09
...

--

Christopher Robin Elmersson

unread,
Feb 8, 2015, 1:20:21 PM2/8/15
to play-fr...@googlegroups.com
Well, you may be right, but I find it weird that running it locally works just fine. I have no idea what makes the Heroku environment different. You want a sample project to deploy to heroku? I'll try to create one tomorrow.
2015-02-07T08:51:36.706186+00:00 app[web.1]: java.lang.RuntimeException: Unable to get driver for JDBC URL postgres://XXX:XXX@ec2-23-21-154-37.compute-1.amazonaws.com:5432/XXX
2015-02-07T08:51:36.712989+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi$lzycompute(HikariCPPlugin.scala:32)
2015-02-07T08:51:36.713127+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi(HikariCPPlugin.scala:32)
2015-02-07T08:51:36.713246+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.onStart(HikariCPPlugin.scala:38)
2015-02-07T08:51:36.713364+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2015-02-07T08:51:36.713485+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2015-02-07T08:51:36.713605+00:00 app[web.1]: at scala.collection.immutable.List.foreach(List.scala:381)
2015-02-07T08:51:36.713724+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
2015-02-07T08:51:36.713842+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2015-02-07T08:51:36.713961+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2015-02-07T08:51:36.714101+00:00 app[web.1]: at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
2015-02-07T08:51:36.718455+00:00 app[web.1]: at play.api.Play$.start(Play.scala:90)
Den måndag 29 september 2014 kl. 22:31:05 UTC+2 skrev Steve Chaloner:
Hi,

1. Check the end of this post for the full debug output
2. I don't have them to hand any more - will roll back to an earlier deploy on heroku and get them
3. play.plugins:

200:com.edulify.play.hikaricp.HikariCPPlugin
1500:com.typesafe.plugin.CommonsMailerPlugin
10000:be.objectify.deadbolt.java.DeadboltPlugin
20000:com.fashiontonic.security.MyUserServicePlugin
20010:com.feth.play.module.pa.providers.oauth1.twitter.TwitterAuthProvider




Heroku logs:


2014-09-29T20:08:06.301412+00:00 heroku[web.1]: State changed from starting to crashed
2014-09-29T20:08:06.302058+00:00 heroku[web.1]: State changed from crashed to starting
2014-09-29T20:08:13.361587+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/fashiontonic -Dhttp.port=${PORT} -Dplay.version=2.3.4 -Devolutionplugin=disabled -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=postgres://najredactpvg:y42Q2gho8MredactrMfd0jz@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bj74a2etf0ua`

2014-09-29T20:08:14.305444+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
2014-09-29T20:08:14.762952+00:00 app[web.1]: Play server process ID is 2
2014-09-29T20:08:15.710194+00:00 app[web.1]: [debug] play - Plugin [play.api.db.BoneCPPlugin] is disabled
2014-09-29T20:08:15.736558+00:00 app[web.1]: [debug] play - Plugin [play.api.db.evolutions.EvolutionsPlugin] is disabled
2014-09-29T20:08:16.436676+00:00 app[web.1]: [info] application - Starting HikariCP connection pool...
2014-09-29T20:08:16.441213+00:00 app[web.1]: [info] application - Creating Pool for datasource 'default'
2014-09-29T20:08:17.196515+00:00 app[web.1]: [info] application - Loading Hikari configuration from Play configuration.
2014-09-29T20:08:17.197851+00:00 app[web.1]: [info] application - Loading from file configured by db.default.hikaricp.file that is Some(conf/hikaricp.prod.properties)
2014-09-29T20:08:17.198582+00:00 app[web.1]: [info] application - Loading Hikari configuration from conf/hikaricp.prod.properties
2014-09-29T20:08:17.221339+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - FileName set to hikaricp.prod.properties
2014-09-29T20:08:17.221707+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - Base path set to /app/target/universal/stage/conf
2014-09-29T20:08:17.228411+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - ConfigurationUtils.locate(): base is /app/target/universal/stage/conf, name is hikaricp.prod.properties
2014-09-29T20:08:17.228850+00:00 app[web.1]: [debug] o.a.c.c.DefaultFileSystem - Could not locate file hikaricp.prod.properties at /app/target/universal/stage/conf: no protocol: /app/target/universal/stage/conf
2014-09-29T20:08:17.229252+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - Loading configuration from the path /app/target/universal/stage/conf/hikaricp.prod.properties
2014-09-29T20:08:17.275029+00:00 app[web.1]: [info] application - Properties: connectionTestQuery=SELECT 1, minimumIdle=5, idleTimeout=300000, driverClassName=org.postgresql.Driver, registerMbeans=true, maximumPoolSize=20, jdbcUrl=postgres://najiredactpvg:y42Q2redactN4mrMfd0jz@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua, maxLifetime=900000

2014-09-29T20:08:17.285977+00:00 app[web.1]: [info] application - Registering driver org.postgresql.Driver
2014-09-29T20:08:17.289198+00:00 app[web.1]: [debug] c.z.h.HikariConfig - HikariCP pool HikariPool-0 configuration:
2014-09
...

--
You received this message because you are subscribed to a topic in the Google Groups "play-framewor
...

Peter-Paul Oldenzeel

unread,
Feb 16, 2015, 3:22:42 PM2/16/15
to play-fr...@googlegroups.com
We're using Play's config vars together with HikariCP, Heroku and PostgreSQL. Things are working fine. The DATABASE_URL in Heroku looks like this:

DATABASE_URL:                 jdbc:postgresql://ec2-50-16-190-77.compute-1.amazonaws.com:5432/db1mgpaienncui


The application conf vars look like this:

evolutionplugin = disabled
dbplugin=disabled
ebean.default="models.data.*, models.listener.*"
db.default.driver=org.postgresql.Driver
db.default.url=${?DATABASE_URL}
db.default.user=${?DATABASE_USER}
db.default.password=${?DATABASE_PASS}


Lastly, we're using the following PSQL driver dependency:

"org.postgresql" % "postgresql" % "9.3-1102-jdbc41"

I hope this helps!
Message has been deleted
Message has been deleted

Christopher Robin Elmersson

unread,
Feb 17, 2015, 2:34:20 PM2/17/15
to play-fr...@googlegroups.com
Thanks Peter-Paul, that did the trick!

I noticed however, that SQL logging no logger works. The only info about it and Hikari and postgresql I find goes like this:
props.setProperty("dataSource.logWriter", new PrintWriter(System.out));

HikariConfig config = new HikariConfig(props);
HikariDataSource ds = new HikariDataSource(config);

That is, setting a PrintWriter by code. Is there any way to configure this in hikari using the play plugin?

Megazord

unread,
Feb 18, 2015, 10:42:17 AM2/18/15
to play-fr...@googlegroups.com
Hello Christopher,

HikariCP does not support SQL logging out of the box. From HikariCP docs:

Log Statement Text / Slow Query Logging
Like Statement caching, most major database vendors support statement logging through properties of their own driver. This includes Oracle, MySQL, Derby, MSSQL, and others. Some even support slow query logging. We consider this a "development-time" feature. For those few databases that do not support it, jdbcdslog-exp is a good option. Great stuff during development and pre-Production.

I've think about implement that in play-hikaricp, using jdbcdslog[1] to wrap the JDBC DataSource and enabling users to configure if they want SQL logging or not. Pull requests are very welcome.

[1] https://github.com/jdbcdslog/jdbcdslog

Megazord

unread,
Feb 18, 2015, 10:45:11 AM2/18/15
to play-fr...@googlegroups.com
The docs were corrected thanks to your pull request, Joe:

https://github.com/edulify/play-hikaricp.edulify.com/pull/46

Both the readme file and the github page now reflect the correct way to use the plugin in Heroku.

Bests,
2015-02-07T08:51:36.706186+00:00 app[web.1]: java.lang.RuntimeException: Unable to get driver for JDBC URL postgres://XXX:XXX@ec2-23-21-154-37.compute-1.amazonaws.com:5432/XXX
2015-02-07T08:51:36.712989+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi$lzycompute(HikariCPPlugin.scala:32)
2015-02-07T08:51:36.713127+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.com$edulify$play$hikaricp$HikariCPPlugin$$hikariCPDBApi(HikariCPPlugin.scala:32)
2015-02-07T08:51:36.713246+00:00 app[web.1]: at com.edulify.play.hikaricp.HikariCPPlugin.onStart(HikariCPPlugin.scala:38)
2015-02-07T08:51:36.713364+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2015-02-07T08:51:36.713485+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
2015-02-07T08:51:36.713605+00:00 app[web.1]: at scala.collection.immutable.List.foreach(List.scala:381)
2015-02-07T08:51:36.713724+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
2015-02-07T08:51:36.713842+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2015-02-07T08:51:36.713961+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
2015-02-07T08:51:36.714101+00:00 app[web.1]: at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
2015-02-07T08:51:36.718455+00:00 app[web.1]: at play.api.Play$.start(Play.scala:90)
Den måndag 29 september 2014 kl. 22:31:05 UTC+2 skrev Steve Chaloner:
Hi,

1. Check the end of this post for the full debug output
2. I don't have them to hand any more - will roll back to an earlier deploy on heroku and get them
3. play.plugins:

200:com.edulify.play.hikaricp.HikariCPPlugin
1500:com.typesafe.plugin.CommonsMailerPlugin
10000:be.objectify.deadbolt.java.DeadboltPlugin
20000:com.fashiontonic.security.MyUserServicePlugin
20010:com.feth.play.module.pa.providers.oauth1.twitter.TwitterAuthProvider




Heroku logs:


2014-09-29T20:08:06.301412+00:00 heroku[web.1]: State changed from starting to crashed
2014-09-29T20:08:06.302058+00:00 heroku[web.1]: State changed from crashed to starting
2014-09-29T20:08:13.361587+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/fashiontonic -Dhttp.port=${PORT} -Dplay.version=2.3.4 -Devolutionplugin=disabled -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=postgres://najredactpvg:y42Q2gho8MredactrMfd0jz@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bj74a2etf0ua`

2014-09-29T20:08:14.305444+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
2014-09-29T20:08:14.762952+00:00 app[web.1]: Play server process ID is 2
2014-09-29T20:08:15.710194+00:00 app[web.1]: [debug] play - Plugin [play.api.db.BoneCPPlugin] is disabled
2014-09-29T20:08:15.736558+00:00 app[web.1]: [debug] play - Plugin [play.api.db.evolutions.EvolutionsPlugin] is disabled
2014-09-29T20:08:16.436676+00:00 app[web.1]: [info] application - Starting HikariCP connection pool...
2014-09-29T20:08:16.441213+00:00 app[web.1]: [info] application - Creating Pool for datasource 'default'
2014-09-29T20:08:17.196515+00:00 app[web.1]: [info] application - Loading Hikari configuration from Play configuration.
2014-09-29T20:08:17.197851+00:00 app[web.1]: [info] application - Loading from file configured by db.default.hikaricp.file that is Some(conf/hikaricp.prod.properties)
2014-09-29T20:08:17.198582+00:00 app[web.1]: [info] application - Loading Hikari configuration from conf/hikaricp.prod.properties
2014-09-29T20:08:17.221339+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - FileName set to hikaricp.prod.properties
2014-09-29T20:08:17.221707+00:00 app[web.1]: [debug] o.a.c.c.PropertiesConfiguration - Base path set to /app/target/universal/stage/conf
2014-09-29T20:08:17.228411+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - ConfigurationUtils.locate(): base is /app/target/universal/stage/conf, name is hikaricp.prod.properties
2014-09-29T20:08:17.228850+00:00 app[web.1]: [debug] o.a.c.c.DefaultFileSystem - Could not locate file hikaricp.prod.properties at /app/target/universal/stage/conf: no protocol: /app/target/universal/stage/conf
2014-09-29T20:08:17.229252+00:00 app[web.1]: [debug] o.a.c.c.ConfigurationUtils - Loading configuration from the path /app/target/universal/stage/conf/hikaricp.prod.properties
2014-09-29T20:08:17.275029+00:00 app[web.1]: [info] application - Properties: connectionTestQuery=SELECT 1, minimumIdle=5, idleTimeout=300000, driverClassName=org.postgresql.Driver, registerMbeans=true, maximumPoolSize=20, jdbcUrl=postgres://najiredactpvg:y42Q2redactN4mrMfd0jz@ec2-54-83-204-85.compute-1.amazonaws.com:5432/d3bredact0ua, maxLifetime=900000

2014-09-29T20:08:17.285977+00:00 app[web.1]: [info] application - Registering driver org.postgresql.Driver
2014-09-29T20:08:17.289198+00:00 app[web.1]: [debug] c.z.h.HikariConfig - HikariCP pool HikariPool-0 configuration:
2014-09
...

--
You received this message because you are subscribed to a topic in the Google Groups "play-framewor
...
Reply all
Reply to author
Forward
0 new messages