# ActiveRecord test problem

**URL:** <https://www.ruby-forum.com/t/activerecord-test-problem/169560>\
**Category:** Rails\
**Created:** [June 5, 2009, 9:38am UTC](https://www.ruby-forum.com/t/activerecord-test-problem/169560 "2009-06-05T09:38:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffrancy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@ffrancy](https://www.ruby-forum.com/u/ffrancy)\
**Post date:** [June 5, 2009, 9:38am UTC](https://www.ruby-forum.com/t/activerecord-test-problem/169560/1 "2009-06-05T09:38:04Z")

</div>

I have a problem to run ActiveRecord’s tests.

I downloaded the source code of ActiveRecord and I put it in  
NetBeansProject folder (I use that IDE).

I opened it as a Ruby project with existing source. I had also to put  
activesupport and the other gems in the same folder of ActiveRecord,  
otherwise it gave me an error.

I created the database and I configured tests for jdbcmysql, but when I  
do jruby -S rake test\_mysql it give me this error:

ffrancy@cray:~/NetBeansProjects/activerecord-2.2.2$ jruby -S rake  
test\_mysql  
(in /home/ffrancy/NetBeansProjects/activerecord-2.2.2)  
/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning:  
Gem::manage\_gems is deprecated and will be removed on or after March  
2009.

/opt/jruby/bin/jruby -Ilib:test:test/connections/native\_mysql  
“/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake\_test\_loader.rb”  
“test/cases/aaa\_create\_tables\_test.rb”  
“test/cases/active\_schema\_test\_mysql.rb” “test/cases/adapter\_test.rb”  
“test/cases/aggregations\_test.rb” “test/cases/ar\_schema\_test.rb”  
“test/cases/associations/belongs\_to\_associations\_test.rb”  
“test/cases/associations/callbacks\_test.rb”  
“test/cases/associations/cascaded\_eager\_loading\_test.rb”  
“test/cases/associations/eager\_load\_includes\_full\_sti\_class\_test.rb”  
“test/cases/associations/eager\_load\_nested\_include\_test.rb”  
“test/cases/associations/eager\_singularization\_test.rb”  
“test/cases/associations/eager\_test.rb”  
“test/cases/associations/extension\_test.rb”  
“test/cases/associations/has\_and\_belongs\_to\_many\_associations\_test.rb”  
“test/cases/associations/has\_many\_associations\_test.rb”  
“test/cases/associations/has\_many\_through\_associations\_test.rb”  
“test/cases/associations/has\_one\_associations\_test.rb”  
“test/cases/associations/has\_one\_through\_associations\_test.rb”  
“test/cases/associations/inner\_join\_association\_test.rb”  
“test/cases/associations/join\_model\_test.rb”  
“test/cases/associations\_test.rb” “test/cases/attribute\_methods\_test.rb”  
“test/cases/base\_test.rb” “test/cases/binary\_test.rb”  
“test/cases/calculations\_test.rb”  
“test/cases/callbacks\_observers\_test.rb” “test/cases/callbacks\_test.rb”  
“test/cases/class\_inheritable\_attributes\_test.rb”  
“test/cases/column\_alias\_test.rb” “test/cases/column\_definition\_test.rb”  
“test/cases/connection\_test\_mysql.rb”  
“test/cases/database\_statements\_test.rb” “test/cases/date\_time\_test.rb”  
“test/cases/defaults\_test.rb” “test/cases/deprecated\_finder\_test.rb”  
“test/cases/dirty\_test.rb” “test/cases/finder\_respond\_to\_test.rb”  
“test/cases/finder\_test.rb” “test/cases/fixtures\_test.rb”  
“test/cases/i18n\_test.rb” “test/cases/inheritance\_test.rb”  
“test/cases/invalid\_date\_test.rb”  
“test/cases/json\_serialization\_test.rb” “test/cases/lifecycle\_test.rb”  
“test/cases/locking\_test.rb” “test/cases/method\_scoping\_test.rb”  
“test/cases/migration\_test.rb” “test/cases/mixin\_test.rb”  
“test/cases/modules\_test.rb” “test/cases/multiple\_db\_test.rb”  
“test/cases/named\_scope\_test.rb” “test/cases/pk\_test.rb”  
“test/cases/pooled\_connections\_test.rb” “test/cases/query\_cache\_test.rb”  
“test/cases/readonly\_test.rb” “test/cases/reflection\_test.rb”  
“test/cases/reload\_models\_test.rb”  
“test/cases/reserved\_word\_test\_mysql.rb” “test/cases/sanitize\_test.rb”  
“test/cases/schema\_dumper\_test.rb” “test/cases/serialization\_test.rb”  
“test/cases/transactions\_test.rb” “test/cases/unconnected\_test.rb”  
“test/cases/validations\_i18n\_test.rb” “test/cases/validations\_test.rb”  
“test/cases/xml\_serialization\_test.rb”

Using native MySQL

MysqlConnectionTest

Loaded suite  
/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake\_test\_loader  
Started  
…EEEEEEEEEEEE.FF…F…F…F…F…F…E…F…F…F…F…F.com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException:  
Connection.close() has already been called. Invalid operation in this  
state.  
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)  
at com.mysql.jdbc.Connection.getMutex(Connection.java:3640)  
at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5243)  
at  
jdbc\_adapter.RubyJdbcConnection.rollback(RubyJdbcConnection.java:430)  
at  
jdbc\_adapter.RubyJdbcConnection$i\_method\_0\_0$RUBYINVOKER$rollback.call(jdbc\_adapter/RubyJdbcConnection$i\_method\_0\_0$RUBYINVOKER$rollback.gen)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:73)  
at  
ruby.jit.ruby.home.ffrancy.$\_dot\_gem.jruby.$1\_dot\_8.gems.activerecord\_minus\_jdbc\_minus\_adapter\_minus\_0\_dot\_9\_dot\_1.lib.jdbc\_adapter.jdbc\_mysql.rollback\_db\_transaction4212265\_8331873.rescue\_1$RUBY$\_\_rescue\_\_\_0(jdbc\_mysql.rb:109)  
at  
ruby.jit.ruby.home.ffrancy.$\_dot\_gem.jruby.$1\_dot\_8.gems.activerecord\_minus\_jdbc\_minus\_adapter\_minus\_0\_dot\_9\_dot\_1.lib.jdbc\_adapter.jdbc\_mysql.rollback\_db\_transaction4212265\_8331873. **file** (jdbc\_mysql.rb)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:195)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:73)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activerecord\_minus\_2\_dot\_2\_dot\_2.lib.active\_record.fixtures.teardown\_fixtures21821228\_8331873. **file** (fixtures.rb:955)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activerecord\_minus\_2\_dot\_2\_dot\_2.lib.active\_record.fixtures.teardown\_fixtures21821228\_8331873. **file** (fixtures.rb)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.retryJITCall(DefaultMethod.java:141)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:131)  
at org.jruby.RubyClass.finvoke(RubyClass.java:353)  
at org.jruby.RubyObject.send(RubyObject.java:1385)  
at  
org.jruby.RubyObject$i\_method\_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i\_method\_multi$RUBYINVOKER$send.gen)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:240)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:44)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.callbacks.evaluate\_method27680714\_8331873. **file** (callbacks.rb:178)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.retryJITCall(DefaultMethod.java:141)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:131)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:42)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.callbacks.call10442562\_8331873.rescue\_1$RUBY$\_\_rescue\_\_\_0(callbacks.rb:166)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.callbacks.call10442562\_8331873. **file** (callbacks.rb)  
at  
org.jruby.ast.executable.AbstractScript. **file** (AbstractScript.java:31)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:237)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.callbacks.run27050467\_8331873.block\_1$RUBY$ **block** (callbacks.rb:90)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.callbacks.run27050467\_8331873BlockCallback$block\_1$RUBY$\_\_block\_\_xx1.call(Unknown  
Source)  
at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:100)  
at org.jruby.runtime.Block.yield(Block.java:120)  
at org.jruby.RubyArray.reverse\_each(RubyArray.java:1597)  
at  
org.jruby.RubyArray$i\_method\_0\_0$RUBYFRAMEDINVOKER$reverse\_each.call(org/jruby/RubyArray$i\_method\_0\_0$RUBYFRAMEDINVOKER$reverse\_each.gen)  
at org.jruby.RubyClass.finvoke(RubyClass.java:332)  
at org.jruby.RubyObject.send(RubyObject.java:1358)  
at  
org.jruby.RubyObject$i\_method\_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i\_method\_multi$RUBYINVOKER$send.gen)  
at  
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:139)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.callbacks.run27050467\_8331873. **file** (callbacks.rb:90)  
at  
org.jruby.ast.executable.AbstractScript. **file** (AbstractScript.java:35)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:300)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.callbacks.run\_callbacks32517802\_8331873. **file** (callbacks.rb:277)  
at  
org.jruby.ast.executable.AbstractScript. **file** (AbstractScript.java:35)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:279)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:300)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:157)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.testing.setup\_and\_teardown.run\_with\_callbacks\_and\_mocha31435972\_8331873.rescue\_2$RUBY$\_\_rescue\_\_\_6(setup\_and\_teardown.rb:105)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.testing.setup\_and\_teardown.run\_with\_callbacks\_and\_mocha31435972\_8331873.ensure\_2$RUBY$\_\_ensure\_\_\_1(setup\_and\_teardown.rb:103)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.testing.setup\_and\_teardown.run\_with\_callbacks\_and\_mocha31435972\_8331873.ensure\_1$RUBY$\_\_ensure\_\_\_0(setup\_and\_teardown.rb:91)  
at  
ruby.jit.ruby.home.ffrancy.NetBeansProjects.activesupport.lib.active\_support.testing.setup\_and\_teardown.run\_with\_callbacks\_and\_mocha31435972\_8331873. **file** (setup\_and\_teardown.rb:89)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:258)  
at  
org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:84)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:290)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:126)  
at  
ruby.jit.ruby.opt.jruby\_minus\_1\_dot\_1\_dot\_6.lib.ruby.$1\_dot\_8.test.unit.testsuite.run11202034\_8331873.block\_0$RUBY$ **block** (testsuite.rb:34)  
at  
ruby.jit.ruby.opt.jruby\_minus\_1\_dot\_1\_dot\_6.lib.ruby.$1\_dot\_8.test.unit.testsuite.run11202034\_8331873BlockCallback$block\_0$RUBY$\_\_block\_\_xx1.call(Unknown  
Source)  
at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:100)  
at org.jruby.runtime.Block.yield(Block.java:120)  
at org.jruby.RubyArray.each(RubyArray.java:1559)  
at  
org.jruby.RubyArray$i\_method\_0\_0$RUBYFRAMEDINVOKER$each.call(org/jruby/RubyArray$i\_method\_0\_0$RUBYFRAMEDINVOKER$each.gen)  
at  
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:98)  
at  
ruby.jit.ruby.opt.jruby\_minus\_1\_dot\_1\_dot\_6.lib.ruby.$1\_dot\_8.test.unit.testsuite.run11202034\_8331873. **file** (testsuite.rb:33)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:258)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:124)  
at  
org.jruby.ast.CallOneArgBlockPassNode.interpret(CallOneArgBlockPassNode.java:60)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at  
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:202)  
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:153)  
at org.jruby.runtime.Block.yield(Block.java:120)  
at org.jruby.RubyArray.each(RubyArray.java:1559)  
at  
org.jruby.RubyArray$i\_method\_0\_0$RUBYFRAMEDINVOKER$each.call(org/jruby/RubyArray$i\_method\_0\_0$RUBYFRAMEDINVOKER$each.gen)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:270)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:85)  
at  
org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:63)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:267)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:290)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:126)  
at  
org.jruby.ast.CallOneArgBlockNode.interpret(CallOneArgBlockNode.java:60)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)  
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)  
at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:85)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)  
at org.jruby.ast.VCallNode.interpret(VCallNode.java:82)  
at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:85)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)  
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)  
at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:85)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:288)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:300)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:157)  
at org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)  
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)  
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)  
at  
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)  
at  
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:260)  
at  
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:75)  
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)  
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)  
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)  
at org.jruby.ast.IfNode.interpret(IfNode.java:111)  
at org.jruby.ast.NewlineNode.Finterpret(NewlineNode.java:101)  
at  
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:202)  
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:190)  
at org.jruby.runtime.BlockBody.call(BlockBody.java:64)  
at org.jruby.runtime.BlockBody.call(BlockBody.java:70)  
at org.jruby.runtime.Block.call(Block.java:116)  
at org.jruby.RubyProc.call(RubyProc.java:205)  
at org.jruby.RubyProc.call(RubyProc.java:187)  
at org.jruby.Ruby.tearDown(Ruby.java:2380)  
at org.jruby.Main.run(Main.java:216)  
at org.jruby.Main.run(Main.java:100)  
at  
org.jruby.util.ShellLauncher$ScriptThreadProcess.run(ShellLauncher.java:103)  
at java.lang.Thread.run(Thread.java:619)  
rake aborted!  
Command failed with status (-1): [/opt/jruby/bin/jruby  
-Ilib:test:test/conne…]

(See full trace by running task with --trace)

Any ideas how to handle it?  
I really don’t know how to manage it!!!

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ffrancy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@ffrancy](https://www.ruby-forum.com/u/ffrancy)\
**Post date:** [June 5, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/activerecord-test-problem/169560/2 "2009-06-05T13:26:54Z")

</div>

ActiveRecord tests will only work with JRuby for ActiveRecord 2.3.

And while you’re at it, upgrade your JRuby install to 1.3.

- 

Maurício Linhares  
[http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) |  
[http://codeshooter.wordpress.com/](http://codeshooter.wordpress.com/) (en)

On Fri, Jun 5, 2009 at 4:38 AM, Francesca

---

<div class="post-metadata">

**Author:** ![ffrancy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@ffrancy](https://www.ruby-forum.com/u/ffrancy)\
**Post date:** [June 5, 2009, 2:09pm UTC](https://www.ruby-forum.com/t/activerecord-test-problem/169560/3 "2009-06-05T14:09:42Z")

</div>

MaurÃ­cio Linhares wrote:

> ActiveRecord tests will only work with JRuby for ActiveRecord 2.3.
> 
> And while you’re at it, upgrade your JRuby install to 1.3.
> 
> - 
> 
> Maurï¿½cio Linhares  
> [http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) |  
> [http://codeshooter.wordpress.com/](http://codeshooter.wordpress.com/) (en)
> 
> On Fri, Jun 5, 2009 at 4:38 AM, Francesca

Thank you very much!!! 😃

---

<div class="post-metadata">

**Author:** ![ffrancy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@ffrancy](https://www.ruby-forum.com/u/ffrancy)\
**Post date:** [June 9, 2009, 10:33am UTC](https://www.ruby-forum.com/t/activerecord-test-problem/169560/4 "2009-06-09T10:33:01Z")

</div>

And also, if I have to use rails 2.3.2, how can I make it work with  
glassfish?

---

<div class="post-metadata">

**Author:** ![ffrancy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@ffrancy](https://www.ruby-forum.com/u/ffrancy)\
**Post date:** [June 9, 2009, 10:26am UTC](https://www.ruby-forum.com/t/activerecord-test-problem/169560/5 "2009-06-09T10:26:59Z")

</div>

Francesca T. wrote:

> MaurÃ­cio Linhares wrote:
> 
> > ActiveRecord tests will only work with JRuby for ActiveRecord 2.3.
> > 
> > And while you’re at it, upgrade your JRuby install to 1.3.
> > 
> > - 
> > 
> > Maurï¿½cio Linhares  
> > [http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) |  
> > [http://codeshooter.wordpress.com/](http://codeshooter.wordpress.com/) (en)
> > 
> > On Fri, Jun 5, 2009 at 4:38 AM, Francesca
> 
> Thank you very much!!! 😃

I tryed to use ActiveRecord 2.3 and tests works but this following  
errors:

Finished in 71.143069 seconds.

1. Failure:  
test\_add\_limit\_offset\_should\_sanitize\_sql\_injection\_for\_limit\_with\_comas(AdapterTest)  
[test/cases/adapter\_test.rb:129:in  
`test_add_limit_offset_should_sanitize_sql_injection_for_limit_with_comas' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
\<" LIMIT 1,7"\> expected but was  
\<" LIMIT 1, 7 procedure help()"\>.

2. Failure:  
test\_add\_limit\_offset\_should\_sanitize\_sql\_injection\_for\_limit\_without\_comas(AdapterTest)  
[test/cases/adapter\_test.rb:115:in  
`test_add_limit_offset_should_sanitize_sql_injection_for_limit_without_comas' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
\<" LIMIT 1"\> expected but was  
\<" LIMIT 1 select \* from schema"\>.

3. Failure:  
test\_read\_attributes\_before\_type\_cast\_on\_datetime(BasicsTest)  
[test/cases/base\_test.rb:148:in  
`test_read_attributes_before_type_cast_on_datetime' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
\<“2009-06-09 09:29:03”\> expected but was  
\<“2009-06-09 09:29:03.0”\>.

4. Failure:  
test\_update\_all\_with\_order\_and\_limit\_updates\_subset\_only(BasicsTest)  
[test/cases/base\_test.rb:693:in  
`test_update_all_with_order_and_limit_updates_subset_only' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
Exception raised:  
Class: ActiveRecord::StatementInvalid  
Message: \<“ActiveRecord::ActiveRecordError: This version of MySQL  
doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’: UPDATE `posts`  
SET body = ‘bulk update!’ WHERE `id` IN (SELECT `id` FROM `posts` WHERE  
(`posts`.author\_id = 1) ORDER BY posts.id LIMIT 1)”\>  
—Backtrace—  
./test/cases/…/…/lib/active\_record/connection\_adapters/abstract\_adapter.rb:212:in  
`log' /home/ffrancy/.gem/jruby/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:563:in `execute’  
./test/cases/helper.rb:37:in `execute_with_query_record' /home/ffrancy/.gem/jruby/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:582:in `jdbc\_update’  
./test/cases/…/…/lib/active\_record/connection\_adapters/abstract/query\_cache.rb:25:in  
`update_with_query_dirty' ./test/cases/../../lib/active_record/base.rb:852:in `update\_all’  
./test/cases/…/…/lib/active\_record/associations/association\_collection.rb:375:in  
`method_missing' ./test/cases/../../lib/active_record/base.rb:2148:in `with\_scope’  
./test/cases/…/…/lib/active\_record/associations/association\_proxy.rb:206:in  
`with_scope' ./test/cases/../../lib/active_record/associations/association_collection.rb:371:in `method\_missing’  
test/cases/base\_test.rb:696:in  
`test_update_all_with_order_and_limit_updates_subset_only' test/cases/base_test.rb:693:in `test\_update\_all\_with\_order\_and\_limit\_updates\_subset\_only’  
./test/cases/…/…/…/activesupport/lib/active\_support/testing/setup\_and\_teardown.rb:62:in  
`run’

* * *

1. Failure:  
test\_integer\_creates\_integer\_column(ChangeTableMigrationsTest)  
[(eval):16:in `integer’  
(eval):5:in `each’  
(eval):5:in `integer’  
test/cases/migration\_test.rb:1399:in  
`test\_integer\_creates\_integer\_column’  
test/cases/migration\_test.rb:1491:in `with\_change\_table’  
./test/cases/…/…/lib/active\_record/connection\_adapters/abstract/schema\_statements.rb:175:in  
`change\_table’  
test/cases/migration\_test.rb:1490:in `with\_change\_table’  
test/cases/migration\_test.rb:1396:in  
`test\_integer\_creates\_integer\_column’  
./test/cases/…/…/…/activesupport/lib/active\_support/testing/setup\_and\_teardown.rb:62:in  
`run’]:  
unexpected invocation:  
#ActiveRecord::ConnectionAdapters::JdbcAdapter:0x18b8.add\_column(:delete\_me,  
:foo, ‘integer(10)’, {})  
unsatisfied expectations:

- expected exactly once, not yet invoked:  
#ActiveRecord::ConnectionAdapters::JdbcAdapter:0x18b8.add\_column(:delete\_me,  
:bar, ‘integer’, {})

- expected exactly once, not yet invoked:  
#ActiveRecord::ConnectionAdapters::JdbcAdapter:0x18b8.add\_column(:delete\_me,  
:foo, ‘integer’, {})

* * *

1. Failure:  
test\_count\_queries\_with\_cache(QueryCacheTest)  
[./test/cases/…/…/lib/active\_record/test\_case.rb:31:in  
`assert_queries' test/cases/query_cache_test.rb:25:in `test\_count\_queries\_with\_cache’  
./test/cases/…/…/lib/active\_record/connection\_adapters/abstract/query\_cache.rb:34:in  
`cache' ./test/cases/../../lib/active_record/query_cache.rb:9:in `cache’  
test/cases/query\_cache\_test.rb:24:in  
`test_count_queries_with_cache' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
2 instead of 1 queries were executed.  
Queries:  
SELECT count(_) AS count\_all FROM `tasks`  
SELECT count(_) AS count\_all FROM `tasks` .  
\<1\> expected but was  
\<2\>.

2. Failure:  
test\_schema\_dump\_includes\_limit\_constraint\_for\_integer\_columns(SchemaDumperTest)  
[test/cases/schema\_dumper\_test.rb:113:in  
`test_schema_dump_includes_limit_constraint_for_integer_columns' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
\<“# This file is auto-generated from the current state of the database.  
Instead of editing this file, \n# please use the migrations feature of  
Active Record to incrementally modify your database, and\n# then  
regenerate this schema definition.\n#\n# Note that this schema.rb  
definition is the authoritative source for your database schema. If you  
need\n# to create the application database on another system, you should  
be using db:schema:load, not running\n# all the migrations from scratch.  
The latter is a flawed and unsustainable approach (the more  
migrations\n# you’ll amass, the slower it’ll run and the greater  
likelihood for issues).\n#\n# It’s strongly recommended to check this  
file into your version control  
system.\n\nActiveRecord::Schema.define(:version =\> 0) do\n\n  
create\_table "integer\_limits", :force =\> true do |t|\n t.integer  
"c\_int\_without\_limit"\n t.integer "c\_int\_1", :limit  
=\> 1\n t.integer "c\_int\_2", :limit =\> 2\n t.integer  
"c\_int\_3", :limit =\> 3\n t.integer "c\_int\_4",  
:limit =\> 4\n t.integer "c\_int\_5", :limit =\> 5\n  
t.integer "c\_int\_6", :limit =\> 6\n t.integer  
"c\_int\_7", :limit =\> 7\n t.integer "c\_int\_8",  
:limit =\> 8\n end\n\nend\n”\> expected to be =~  
\</c\_int\_5.\*:limit =\> 8/\>.

3. Failure:  
test\_underlying\_adapter\_no\_longer\_active(TestUnconnectedAdapter)  
[test/cases/unconnected\_test.rb:30:in  
`test_underlying_adapter_no_longer_active' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
Removed adapter should no longer be active.  
 is not true.

4. Failure:  
test\_optionally\_validates\_length\_of\_using\_within\_on\_create\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1074:in  
`test_optionally_validates_length_of_using_within_on_create_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in `with\_kcode’  
test/cases/validations\_test.rb:1065:in  
`test_optionally_validates_length_of_using_within_on_create_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
 is not true.

5. Failure:  
test\_optionally\_validates\_length\_of\_using\_within\_on\_update\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1092:in  
`test_optionally_validates_length_of_using_within_on_update_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in `with\_kcode’  
test/cases/validations\_test.rb:1088:in  
`test_optionally_validates_length_of_using_within_on_update_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
 is not true.

6. Failure:  
test\_optionally\_validates\_length\_of\_using\_within\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1054:in  
`test_optionally_validates_length_of_using_within_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in `with\_kcode’  
test/cases/validations\_test.rb:1050:in  
`test_optionally_validates_length_of_using_within_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
#\<ActiveRecord::Errors:0x512bcf @errors={“title”=\>[“is too long (maximum  
is 5 characters)”]}, @base=#\<Topic id: nil, title: “ä¸€äºŒä¸‰å››äº””, author\_name:  
nil, author\_email\_address: “removed\_email\_address@domain.invalid”, written\_on: nil, bonus\_time:  
nil, last\_read: nil, content: nil, approved: true, replies\_count: 0,  
parent\_id: nil, type: nil\>\>.  
 is not true.

7. Failure:  
test\_validate\_case\_sensitive\_uniqueness(ValidationsTest)  
[test/cases/validations\_test.rb:485:in  
`test_validate_case_sensitive_uniqueness' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
Should be valid.  
 is not true.

8. Failure:  
test\_validates\_length\_of\_using\_is\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1114:in  
`test_validates_length_of_using_is_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in `with\_kcode’  
test/cases/validations\_test.rb:1110:in  
`test_validates_length_of_using_is_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
 is not true.

9. Failure:  
test\_validates\_length\_of\_using\_maximum\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1026:in  
`test_validates_length_of_using_maximum_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in `with\_kcode’  
test/cases/validations\_test.rb:1022:in  
`test_validates_length_of_using_maximum_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
 is not true.

10. Failure:  
test\_validates\_length\_of\_using\_minimum\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1015:in  
`test_validates_length_of_using_minimum_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in `with\_kcode’  
test/cases/validations\_test.rb:1008:in  
`test_validates_length_of_using_minimum_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
 is not true.

11. Failure:  
test\_validates\_length\_of\_using\_within\_utf8(ValidationsTest)  
[test/cases/validations\_test.rb:1041:in  
`test_validates_length_of_using_within_utf8' ./test/cases/../../lib/active_record/test_case.rb:57:in `with\_kcode’  
test/cases/validations\_test.rb:1036:in  
`test_validates_length_of_using_within_utf8' ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run’]:  
\<“is too short (minimum is 3 characters)”\> expected but was  
\<“is too long (maximum is 5 characters)”\>.

2013 tests, 6503 assertions, 19 failures, 1 errors  
rake aborted!  
Command failed with status (1): [/opt/jruby/bin/jruby  
-Ilib:test:test/conne…]

I have to say that I’m using JRuby 1.6, Glassfish V 3 Prelude, Rails  
2.2.2 and NetBeans IDE.

How can I make everything work?  
Do I have to upgrade something?

Thanks!!!
