Re: [jruby-user] Re: classpath issues

snacktime <[email protected]>
Newsgroups gmane.comp.lang.jruby.user
Message-ID <CABFnaravgCnA1cu_v=e-_gOWhsDY8EUL_O4S8XfiKQauO7BfBA@mail.gmail.com>
I'm using rvm but not tied to it, does it mess with jruby's ability to set
the classpath correctly?

By classpath I mean classpath as displayed in
System.getProperty('java.class.path").

All of the jdbc connection pools are setup in java code.  I use them from a
mix of ruby/java but the errors always come from the java side connection
pool reconnect logic where they try to get a new connection after idle
timeouts have killed current connections, or where it's expanding the pool,
etc..

Here is the stack trace I get.  You can see the pool timing out idle
connections, and then failing to get a new connection because it can't load
the driver.

20:49:24.962 [Hikari Housekeeping Timer (pool HikariPool-0)] DEBUG
com.zaxxer.hikari.pool.HikariPool - Before cleanup pool stats HikariPool-0
(total=10, inUse=0, avail=10, waiting=0)¬
 197284 20:49:24.972 [Hikari Housekeeping Timer (pool HikariPool-0)] DEBUG
com.zaxxer.hikari.pool.HikariPool - After cleanup pool stats HikariPool-0
(total=1, inUse=0, avail=1, waiting=0)¬
 197285 20:49:24.977 [HikariCP connection filler] DEBUG
com.zaxxer.hikari.pool.HikariPool - Connection attempt to database
HikariPool-0 failed: No suitable driver found for jdbc:postgresql://
127.0.0.1:5432/gamema
 197286 java.sql.SQLException: No suitable driver found for
jdbc:postgresql://
127.0.0.1:5432/gamemachine?loginTimeout=0&socketTimeout=0&prepareThreshold=5&unknownLength=2147483647&tcpKeepAlive=false&binaryTransfe
 197287 » at java.sql.DriverManager.getConnection(DriverManager.java:596)
~[na:1.7.0_65]¬
 197288 » at java.sql.DriverManager.getConnection(DriverManager.java:215)
~[na:1.7.0_65]¬
 197289 » at
org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:99)
~[postgresql-9.3-1102-jdbc41.jar:na]¬
 197290 » at
org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:82)
~[postgresql-9.3-1102-jdbc41.jar:na]¬
 197291 » at
com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:399)
[HikariCP-java6-2.0.1.jar:na]¬
 197292 » at
com.zaxxer.hikari.pool.HikariPool.access$400(HikariPool.java:64)
[HikariCP-java6-2.0.1.jar:na]¬
 197293 » at
com.zaxxer.hikari.pool.HikariPool$1AddConnection.run(HikariPool.java:316)
[HikariCP-java6-2.0.1.jar:na]¬
 197294 » at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[na:1.7.0_65]¬
 197295 » at java.util.concurrent.FutureTask.run(FutureTask.java:262)
[na:1.7.0_65]¬
 197296 » at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_65]¬
 197297 » at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_65]¬




Chris

On Mon, Oct 13, 2014 at 1:47 AM, christian <[email protected]> wrote:

> hi, would you tell me a little more what you are doing like: what are all
> those existing classloaders that have the driver jar ? are you using JDBC
> directly from jruby ?
>
> are you talking about $CLASSPATH variable inside JRuby which is something
> different than $CLASSPATH from environment ?!
>
> are you using jruby-complete.jar or rvm/rbenv/chruby installed jruby ?
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.