Jruby on rails deployment problem tomcat/ibm db2

hello, this is sort of a plea for help and/or to see if anyone else is
having the same problem…i am trying to deploy a jruby on rails app, i
have a working configuration (my staging/development environment) using:

jruby 1.1.6

tomcat 6.0.16

rails 2.2.2

activerecord-jdbc-adapter 0.9

ibm db2 8.2.8 on aix64

i am using warbler 0.9.12 to package everything up…for my production
environment the only difference is the database server is

ibm db2 9.5.1 on red hat linux

…the app blows up when communicating with the database…all the stack
traces look like this:

Dec 30, 2008 10:10:29 PM org.apache.catalina.core.ApplicationContext log

SEVERE: Exception caught


    at com.ibm.db2.jcc.c.s.q(s.java:722)

    at com.ibm.db2.jcc.c.wf.c(wf.java:2901)

    at com.ibm.db2.jcc.c.wf.b(wf.java:2883)

    at com.ibm.db2.jcc.c.p.b(p.java:2586)

    at com.ibm.db2.jcc.b.b.b(b.java:3173)

    at com.ibm.db2.jcc.c.p.d(p.java:2653)

    at com.ibm.db2.jcc.c.j.o(j.java:353)

    at com.ibm.db2.jcc.b.a.o(a.java:994)



    at com.ibm.db2.jcc.b.db.l(db.java:927)

    at com.ibm.db2.jcc.b.db.c(db.java:366)

    at com.ibm.db2.jcc.b.db.r(db.java:979)

    at com.ibm.db2.jcc.b.eb.O(eb.java:430)

    at com.ibm.db2.jcc.b.gb.a(gb.java:590)

    at com.ibm.db2.jcc.b.gb.l(gb.java:542)

    at com.ibm.db2.jcc.b.gb.k(gb.java:330)

    at com.ibm.db2.jcc.b.gb.e(gb.java:96)

    at com.ibm.db2.jcc.b.w.e(w.java:83)

    at com.ibm.db2.jcc.b.vb.i(vb.java:164)

    at com.ibm.db2.jcc.c.fg.q(fg.java:1311)

    at com.ibm.db2.jcc.c.gg.d(gg.java:2386)

    at com.ibm.db2.jcc.c.hg.V(hg.java:146)

    at com.ibm.db2.jcc.c.t.a(t.java:7384)

    at com.ibm.db2.jcc.c.t.be(t.java:7167)

    at com.ibm.db2.jcc.c.t.getTypeInfo(t.java:7106)









    at org.jruby.ast.VCallNode.interpret(VCallNode.java:82)

    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)

    at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)

to further complicate matters, i’ve had success embedding jruby as a
scripting engine in this environment (including calls to activerecord,
but not regular-stack rails) using:

jruby 1.1.4

activerecord-jdbc-adapter 0.8.2

activerecord 2.1.2

so naturally as a shot in the dark i tried reverting to
activerecord-jdbc-adapter 0.8.2 with no luck…

does anyone out there have any ideas? thanks for any help at all!

Richard F.

On Tue, Dec 30, 2008 at 9:23 PM, Finegan, Richard [HDS - WC]
[email protected] wrote:

activerecord 2.1.2

does anyone out there have any ideas? thanks for any help at all!

My first guess would be something related to Rails/ActiveRecord 2.2.
From the stack trace above, it looks like you’re losing a connection
to the database (or failing to connect at all?) when the adapter tries
to load the type metadata. Not sure what about 2.2 would make that
different, but the connection pooling logic is in 2.2, so that’s a
fairly big, new piece.

Are you connecting via JNDI, or a normal connection?

As a next step for debugging, see if you can write a script that just
uses AR (and ar-jdbc) by itself, outside of Rails and Tomcat. If you
can reproduce, try poking around in ar-jdbc with some puts statements
to see if you can isolate the problem any further.

Good luck!


To unsubscribe from this list, please visit:


thanks for the ideas nick…i’ll see what i can find out

and to answer your question, i’m connecting via jndi

Richard F.

it turns out there are 2 jdbc drivers from ibm:

db2jcc.jar - JDBC 3.0 and earlier functions
db2jcc4.jar - JDBC 4.0 and later, as well as JDBC 3.0 and earlier

got the info from here:


changing to db2jcc4.jar did the trick!

Richard F.