Jdbc error : NoMethodError: undefined method `message=' for #<Java


(Gili Sade) #1

Hi there
running Logstash 5.0.1
ruby version: 2.0.0p598 (2014-11-13) [x86_64-linux]

trying to extract data from a MSSQL server with the following config:

    jdbc {
            jdbc_driver_library => /path/to/sqljdbc42.jar"
            jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
            jdbc_connection_string => "jdbc:sqlserver://DBSRV:1433"
            jdbc_user => "user"
            jdbc_password => "pass"
            type => "type"
            schedule  => "* * * * *"
            statement => "SELECT * FROM [DB].[SCHEMA].[TABLE]"
          }

and getting the following error:

[[main]-pipeline-manager] ERROR logstash.agent - Pipeline aborted due to error {:exception=>#<Sequel::DatabaseConnectionError: NoMethodError: undefined method message=' for #<Java::ComMicrosoftSqlserverJdbc::SQLServerException:0x62dd3df9>>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/adapters/jdbc.rb:227:inconnect'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool.rb:116:in make_new'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool/threaded.rb:228:inmake_new'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool/threaded.rb:201:in available'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool/threaded.rb:137:in_acquire'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool/threaded.rb:151:in acquire'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool/threaded.rb:282:insync'", "org/jruby/ext/thread/Mutex.java:149:in synchronize'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool/threaded.rb:282:insync'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool/threaded.rb:150:in acquire'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/connection_pool/threaded.rb:106:inhold'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/database/connecting.rb:285:in synchronize'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.40.0/lib/sequel/database/connecting.rb:295:intest_connection'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/plugin_mixins/jdbc.rb:171:in prepare_jdbc_connection'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/inputs/jdbc.rb:191:inregister'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:319:in start_inputs'", "org/jruby/RubyArray.java:1613:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:318:in start_inputs'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:195:instart_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:153:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:250:instart_pipeline'"]}

any idea?


(Gili Sade) #2

HI an UPDATE
apparently the problem was that the user i used did not exist in this DB
so after creating the user everything worked just fine
BTW it had to be an "sql authentication" user


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.