pierrickrouxel / activerecord-jdbcas400-adapter

AS/400 JDBC adapter for ActiveRecord
MIT License
7 stars 4 forks source link

StandardError: Unable to retrieve tables without current library #7

Closed skoona closed 6 years ago

skoona commented 7 years ago

Without :current_library and :schema declared in database.yml I'm getting the following error. My intent is to connect to the IBM i and access legacy tables using the '*LIBL' library list. I'm using JRuby 9.1.6.0 with Rails 4.2.7.1 and the most current version of this gem.

Shouldn't this be working? What can I do to make it work?

James,

2017-02-09 08:02:00.862 APD:INFO Rails_Config loaded :development => Booting Puma => Rails 4.2.7.1 application starting in development on http://0.0.0.0:3000 => Runrails server -h` for more startup options => Ctrl-C to shutdown server 2017-02-09 08:02:03.066 APD:DEBUG AgencyProfile Load (229.0ms) SELECT agency_profiles.* FROM agency_profiles ORDER BY agency_profiles.agency_number ASC 2017-02-09 08:02:03.209 APD:DEBUG (140.0ms) VALUES CURRENT_SCHEMA Exiting StandardError: Unable to retrieve tables without current library tables at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-jdbcas400-adapter-1.3.20/lib/arjdbc/as400/adapter.rb:61 prepare_tables at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/schema_cache.rb:90 table_exists? at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/schema_cache.rb:22 table_exists? at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/model_schema.rb:230 get_primary_key at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:97 reset_primary_key at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:85 primary_key at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:73 attributes_builder at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/model_schema.rb:234 instantiate at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/persistence.rb:68 block in find_by_sql at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/querying.rb:50 block in each at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/result.rb:51 each at org/jruby/RubyArray.java:1734 each at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/result.rb:51 map at org/jruby/RubyEnumerable.java:829 block in find_by_sql at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/querying.rb:50 instrument at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20 find_by_sql at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/querying.rb:49 exec_queries at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:639 load at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:515 to_a at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:243 collect at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/delegation.rb:46 block in (root) at /Users/jscott/rDeveloper/APDService/config/initializers/agency_catalog_preload.rb:10 execute_hook at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/lazy_load_hooks.rb:36 block in run_load_hooks at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/lazy_load_hooks.rb:45 each at org/jruby/RubyArray.java:1734 run_load_hooks at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/lazy_load_hooks.rb:44 block in Finisher at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/application/finisher.rb:62 instance_exec at org/jruby/RubyBasicObject.java:1726 run at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30 block in run_initializers at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:55 block in tsort_each at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:228 block in each_strongly_connected_component at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:350 each_strongly_connected_component_from at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:431 block in each_strongly_connected_component at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:349 each at org/jruby/RubyArray.java:1734 call at org/jruby/RubyMethod.java:127 each_strongly_connected_component at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:347 tsort_each at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:226 tsort_each at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:205 run_initializers at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:54 initialize! at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:352

at /Users/jscott/rDeveloper/APDService/config/environment.rb:5 require at org/jruby/RubyKernel.java:959 block in (root) at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:1 require at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274 load_dependency at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240 block in require at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274 instance_eval at org/jruby/RubyBasicObject.java:1689 new_from_string at /Users/jscott/rDeveloper/APDService/config.ru:3 at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/builder.rb:55 eval at org/jruby/RubyKernel.java:998 new_from_string at /Users/jscott/rDeveloper/APDService/config.ru:1 new_from_string at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/builder.rb:49 parse_file at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/builder.rb:40 build_app_and_options_from_config at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/server.rb:299 app at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/server.rb:208 app at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/server.rb:61 wrapped_app at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/server.rb:336 log_to_stdout at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/server.rb:139 block in start at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/server.rb:78 tap at org/jruby/RubyKernel.java:1748 server at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:80 server at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:75
at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39 require at org/jruby/RubyKernel.java:959
at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands.rb:17`
pierrickrouxel commented 6 years ago

Maybe you don't wait for answer but I will answer. You can't use *LIBL with activerecord-jdbcas400-adapter. You should defined your liblist or a schema.