Logstash JDBC error java.lang.IllegalStateException

Im running on

  • Elastic 6.2.3
  • Logstash 6.2.3
  • Kibana 6.2.3
  • JDBC : sqljdbc_6.4

My logstash thew below error while reading from SQL server table

[ERROR] 2018-04-15 21:39:26.275 [main] Logstash - java.lang.IllegalStateExceptio
n: org.jruby.exceptions.RaiseException: (SystemExit) exit

my Logstash config

input {
jdbc {
jdbc_driver_library => "C:\Projects\ELKStack\sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre9.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost;databaseName=DBName;integratedSecurity=true;"
jdbc_user => "SQLODBC"
statement => "select * from MyTable"
}
}
output {
elasticsearch {
hosts => "localhost:9200"
index => "%{language}"
document_type => "%{SystemName}"
document_id => "%{SystemName}"
}
}

Look further up in the log. I'm sure there are more useful clues earlier on.

here is the actual error message. Any thoughts?

Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_driver_library=>"C:\Projects\ELKStack\
sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre9.jar", jdbc_driver_class=>"com.microsoft.
sqlserver.jdbc.SQLServerDriver", jdbc_connection_string=>"jdbc:sqlserver://local
host;databaseName=MYDB;integratedSecurity=true;", jdbc_user=>"tools
\myusername", statement=>"select SystemName from IntegrationSystems", i
d=>"973490965e2b62c2bdae0d8a664c638b9219c75f8ac1ec0a8f26b2b504a747fb", enable_me
tric=>true, codec=><LogStash::Codecs::Plain id=>"plain_3e8161bd-fa32-4180-8ef8-6
d46abc20ec3", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false
, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeo
ut=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts
=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>19
69-12-31 18:00:00 -0600}, last_run_metadata_path=>"C:\Users\myusername
/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numer
ic", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: com.microsoft.sqlserver.jdbc.SQLServerDriver not loaded. Are you sure y
ou've included the correct jdbc driver in :jdbc_driver_library?
Exception: LogStash::ConfigurationError
Stack: C:/Projects/ELKStack/logstash-6.2.3/logstash-6.2.3/vendor/bundle/jruby/
2.3.0/gems/logstash-input-jdbc-4.3.5/lib/logstash/plugin_mixins/jdbc.rb:161:in open_jdbc_connection' C:/Projects/ELKStack/logstash-6.2.3/logstash-6.2.3/vendor/bundle/jruby/2.3.0/gem s/logstash-input-jdbc-4.3.5/lib/logstash/plugin_mixins/jdbc.rb:219:inexecute_s
tatement'
C:/Projects/ELKStack/logstash-6.2.3/logstash-6.2.3/vendor/bundle/jruby/2.3.0/gem
s/logstash-input-jdbc-4.3.5/lib/logstash/inputs/jdbc.rb:264:in execute_query' C:/Projects/ELKStack/logstash-6.2.3/logstash-6.2.3/vendor/bundle/jruby/2.3.0/gem s/logstash-input-jdbc-4.3.5/lib/logstash/inputs/jdbc.rb:250:inrun'
C:/Projects/ELKStack/logstash-6.2.3/logstash-6.2.3/logstash-core/lib/logstash/pi
peline.rb:516:in inputworker' C:/Projects/ELKStack/logstash-6.2.3/logstash-6.2.3/logstash-core/lib/logstash/pi peline.rb:509:inblock in start_input'
[2018-04-16T13:41:22,817][ERROR][logstash.pipeline ] A plugin had an unre
coverable error. Will restart this plugin.

It looks like you have a jar file meant for Java 9, but your JVM is v8 isn't it? Other than that I have no ideas.

That was the issue, Thank you so much Magnus !!!

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