Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Mac OS 10.5.3, Netbeans 6.1,jruby-1.1.2, rails-2.1.0, activerecord-jdbcmysql-adapter-0.8.1, database is MySQL 5 running on a Solaris 10 box (connection setting is localhost but that tunnels to the solaris box)
-
Number of attachments :
Description
*Attached is a new project I created and is going the same thing.
When I run my database migrationI get an error that the table it just created does not exist. It was able to connect to the mysql 5 db to create the table so I assume the connector is working.
I don't know if the fact that it claims to be looking for "WEB_FORMS" when the table is called "web_forms" is the problem or a red herring. Perhaps the error reporting just displays it in all caps for emphasis.
When I run the app in debug and try to create a new object in the scaffolded view I can trace it to Line 566 of jdbc_adapter.rb:
def jdbc_columns(table_name, name = nil)
@connection.columns(table_name.to_s)
end
Then it goes into the exception handler and I have no idea what caused the exception. At that point table_name is still lower case according to the debugger. Here is my stack trace from the migration:
(in /Users/rosey/Projects/Ruby/MiniSURF)
-
- Invoke db:migrate (first_time)
- Invoke environment (first_time)
- Execute environment
- Execute db:migrate
rake aborted!
Table WEB_FORMS does not exist
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:69:in `columns_with_query_cache'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/schema_dumper.rb:75:in `table'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/schema_dumper.rb:70:in `tables'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/schema_dumper.rb:61:in `each'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/schema_dumper.rb:61:in `tables'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/schema_dumper.rb:23:in `dump'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/schema_dumper.rb:17:in `dump'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/databases.rake:219:in `/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/databases.rake'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/databases.rake:218:in `open'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/databases.rake:218:in `/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/databases.rake'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/databases.rake:100:in `/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/databases.rake'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31:in `/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake'
/usr/local/ruby/jruby-1.1.2/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:19:in `load'
/usr/local/ruby/jruby-1.1.2/bin/rake:19 - Invoke db:schema:dump (first_time)
- Invoke environment
- Execute db:schema:dump
This is a showstopper for the app I'm developing, and I haven't quite tracked down in the source where the problem might be. Running Rails 2.3.2 on JRuby 1.2.0, with Derby via ActiveRecord-JDBC and the EmbeddedDriver for Derby.
rake db:migrate works fine, and I can work with the database in ij, but nothing works from inside Rails; Model.find(:all), Model.create(...), all of them throw the same exception:
script/console:
>> Ticket.find(:all)
ActiveRecord::ActiveRecordError: Table TICKETS does not exist
from /opt/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1276:in `columns'
from /opt/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1289:in `column_names'
from /opt/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2857:in `inspect'
from /opt/jruby/lib/ruby/1.8/irb.rb:302:in `output_value'
from /opt/jruby/lib/ruby/1.8/irb.rb:151:in `eval_input'
from /opt/jruby/lib/ruby/1.8/irb.rb:263:in `signal_status'
from /opt/jruby/lib/ruby/1.8/irb.rb:147:in `eval_input'
from /opt/jruby/lib/ruby/1.8/irb.rb:146:in `eval_input'
from /opt/jruby/lib/ruby/1.8/irb.rb:70:in `start'
from /opt/jruby/lib/ruby/1.8/irb.rb:69:in `catch'
from /opt/jruby/lib/ruby/1.8/irb.rb:69:in `start'
from /opt/jruby/bin/jirb:19
The other odd thing is that find(:all) returned an empty array until I manually added a row to the database; create and such have never worked.
A few other odd things:
Ticket.connection.tables
=> []
Ticket.connection.select_all("select * from tickets")
=> [{"id"=>1, "description"=>"foobar"}]
Ticket.connection.select_all("select * from TICKETS")
=> [{"id"=>1, "description"=>"foobar"}]
And a list of my installed gems:
actionmailer (2.3.2)
actionpack (2.3.2)
activerecord (2.3.2)
activerecord-jdbc-adapter (0.9.1)
activerecord-jdbcderby-adapter (0.9.1)
activeresource (2.3.2)
activesupport (2.3.2)
jdbc-derby (10.4.2.0)
jruby-openssl (0.4)
rails (2.3.2)
rake (0.8.4)
rspec (1.2.2, 1.2.0)
sources (0.0.1)
warbler (0.9.12)
Any ideas? Am I missing something simple, or...?