Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setUrl + postrgesql #175

Open
b0c1 opened this issue Apr 12, 2015 · 1 comment
Open

setUrl + postrgesql #175

b0c1 opened this issue Apr 12, 2015 · 1 comment
Labels

Comments

@b0c1
Copy link
Contributor

b0c1 commented Apr 12, 2015

I want to use postgres with activate 1.6.2 but I got:

tested with jdbc3 and jdbc4 postrges driver

java.lang.RuntimeException: Could not create datasource instance: org.postgresql.ds.PGSimpleDataSource
    at com.zaxxer.hikari.pool.HikariPool.initializeDataSource(HikariPool.java:502)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:123)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:90)
    at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:69)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorage$class.initConnectionPool(JdbcRelationalStorage.scala:360)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorage$class.delayedInit(JdbcRelationalStorage.scala:349)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorageFactory$PooledJdbcRelationalStorageFromFactory.delayedInit(JdbcRelationalStorage.scala:392)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorageFactory$PooledJdbcRelationalStorageFromFactory.<init>(JdbcRelationalStorage.scala:392)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorageFactory$.buildStorage(JdbcRelationalStorage.scala:401)
    at com.trendensity.web.persistence.ConfigStorageFactory$.fromConfig(ConfigStorageFactory.scala:19)
    at com.trendensity.persistenceContext$delayedInit$body.apply(persistenceContext.scala:8)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at net.fwbrasil.activate.migration.MigrationContext$class.delayedInit(MigrationContext.scala:18)
    at com.trendensity.persistenceContext$.delayedInit(persistenceContext.scala:7)
    at com.trendensity.persistenceContext$.<init>(persistenceContext.scala:7)
    at com.trendensity.persistenceContext$.<clinit>(persistenceContext.scala)
    at com.trendensity.web.Bootstrap.initializeDatabase(Bootstrap.scala:26)
    at com.trendensity.web.Bootstrap.init(Bootstrap.scala:13)
    at org.scalatra.servlet.ScalatraListener.configureCycleClass(ScalatraListener.scala:67)
    at org.scalatra.servlet.ScalatraListener.contextInitialized(ScalatraListener.scala:23)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:800)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:498)
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:146)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
    at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:461)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:528)
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:391)
    at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:329)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
Caused by: 
java.lang.RuntimeException: java.beans.IntrospectionException: Method not found: setUrl
    at com.zaxxer.hikari.util.PropertyBeanSetter.setProperty(PropertyBeanSetter.java:109)
    at com.zaxxer.hikari.util.PropertyBeanSetter.setTargetFromProperties(PropertyBeanSetter.java:61)
    at com.zaxxer.hikari.pool.HikariPool.initializeDataSource(HikariPool.java:497)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:123)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:90)
    at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:69)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorage$class.initConnectionPool(JdbcRelationalStorage.scala:360)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorage$class.delayedInit(JdbcRelationalStorage.scala:349)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorageFactory$PooledJdbcRelationalStorageFromFactory.delayedInit(JdbcRelationalStorage.scala:392)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorageFactory$PooledJdbcRelationalStorageFromFactory.<init>(JdbcRelationalStorage.scala:392)
    at net.fwbrasil.activate.storage.relational.PooledJdbcRelationalStorageFactory$.buildStorage(JdbcRelationalStorage.scala:401)
    at com.trendensity.web.persistence.ConfigStorageFactory$.fromConfig(ConfigStorageFactory.scala:19)
    at com.trendensity.persistenceContext$delayedInit$body.apply(persistenceContext.scala:8)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at net.fwbrasil.activate.migration.MigrationContext$class.delayedInit(MigrationContext.scala:18)
    at com.trendensity.persistenceContext$.delayedInit(persistenceContext.scala:7)
    at com.trendensity.persistenceContext$.<init>(persistenceContext.scala:7)
    at com.trendensity.persistenceContext$.<clinit>(persistenceContext.scala)
    at com.trendensity.web.Bootstrap.initializeDatabase(Bootstrap.scala:26)
    at com.trendensity.web.Bootstrap.init(Bootstrap.scala:13)
    at org.scalatra.servlet.ScalatraListener.configureCycleClass(ScalatraListener.scala:67)
    at org.scalatra.servlet.ScalatraListener.contextInitialized(ScalatraListener.scala:23)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:800)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:498)
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:146)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
    at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:461)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:528)
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:391)
    at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:329)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
Caused by: 
@plamola
Copy link

plamola commented Apr 19, 2015

Ran into the same issue, with activate 1.7

Seems the PGSimpleDataSource doesn't like the url property, but expects a databaseName, serverName and portNumber property.
See also this thread: http://t28077.db-postgresql-jdbc.databasetalk.us/pgsimpledatasource-not-support-jdbc-url-t28077.html

As a workaround, I've extended the original PooledJdbcRelationalStorage, to remove the url property from the Hikari config and to add the databaseName, serverName and portNumber property.

You can find it here: https://gist.github.com/plamola/15ef3804cfaf6516132a

@fwbrasil fwbrasil added the bug label May 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants