0

I have got below error when I am trying to connect with SQL Server

error_message=>"Java::JavaLang::NoClassDefFoundError: javax/xml/bind/DatatypeConverter"} logstash_1 | [2019-12-05T07:52:10,649][ERROR][logstash.javapipeline ] A plugin had an unrecoverable error. Will restart this plugin

My ELK version is 7.4

Zaynul Abadin Tuhin
  • 31,407
  • 5
  • 33
  • 63

1 Answers1

0

I just built-up the connection. It's an issue caused by latest version of ELK. (7.5.0) Here's work around in my article. The point is to copy the JDBC driver .jar to the logstash-core\lib.

Check here:

My blog of workaround solution before Elastic stack solved their issue

-- MUST remain:

jdbc_driver_library => “"

Logstash config:

    input {
jdbc {
jdbc_connection_string => “jdbc:sqlserver://localhost:1433;databaseName=SAMXIAODEMO;integratedSecurity=false;"
jdbc_driver_library => “"
jdbc_driver_class => “com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_user => “SQL DB account"
jdbc_password => “SQL DB password"
statement => “SELECT * FROM DB.SCHEMA.TABLE"
}
}
output {
elasticsearch {
hosts => [“localhost:9200″]
index => “your index name"
}
}
Sam Xiao
  • 21
  • 5
  • I'll soon come out an English version for this :P – Sam Xiao Dec 06 '19 at 03:20
  • its a mixed versison btw thanks for your answer but sorry to say i have used same logtash confiz then i got the error thoug i am able to connect in my sql – Zaynul Abadin Tuhin Dec 06 '19 at 07:51
  • Have you checked the JRE setting? And there's also an issue if you did wrong query in `statement => " select ...."` – Sam Xiao Dec 06 '19 at 08:17
  • there is no chance of query wrong 100% sure about that :) but as i have used docker so i placed jar file sqljdbc42.jar inside logstash – Zaynul Abadin Tuhin Dec 06 '19 at 08:55
  • So did it work? I'm curious about it. Maybe it help the other docker users :). Thank you. – Sam Xiao Dec 08 '19 at 19:54
  • This didn't work for me. I am not using docker. Just a plain logstash conf file. Please check https://stackoverflow.com/questions/68409727/logstash-error-javajavalangnoclassdeffounderror-unable-to-resolve – Eswar Jul 17 '21 at 07:52