Mssql server connectivity issue with logstash

I am trying to fetch data from MSSQL with the following mssql.conf script in config directory

input {
jdbc {
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_driver_library => ""
jdbc_connection_string => "jdbc:sqlserver://XX.XXX.XX.XXX:1433; database=elasticDB_test; user=sa; password=XXXXXXX"
jdbc_user => nil
statement => "select * from dbo.candidate"
}
}

output {
stdout{}
}

but receiving the following error, Kindly may help

[2023-06-29T13:08:45,276][INFO ][logstash.runner ] Log4j configuration path used is: C:\logstash-8.8.1-windows-x86_64\logstash-8.8.1\config\log4j2.properties
[2023-06-29T13:08:45,276][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"8.8.1", "jruby.version"=>"jruby 9.3.10.0 (2.6.8) 2023-02-01 107b2e6697 OpenJDK 64-Bit Server VM 17.0.7+7 on 17.0.7+7 +indy +jit [x86_64-mswin32]"}
[2023-06-29T13:08:45,276][INFO ][logstash.runner ] JVM bootstrap flags: [-Xms1g, -Xmx1g, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djruby.compile.invokedynamic=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true, -Djruby.regexp.interruptible=true, -Djdk.io.File.enableADS=true, --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED, --add-opens=java.base/java.security=ALL-UNNAMED, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.nio.channels=ALL-UNNAMED, --add-opens=java.base/sun.nio.ch=ALL-UNNAMED, --add-opens=java.management/sun.management=ALL-UNNAMED]
[2023-06-29T13:08:45,309][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2023-06-29T13:08:47,757][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[2023-06-29T13:08:47,982][INFO ][org.reflections.Reflections] Reflections took 156 ms to scan 1 urls, producing 132 keys and 464 values
[2023-06-29T13:08:53,306][INFO ][logstash.javapipeline ] Pipeline main is configured with pipeline.ecs_compatibility: v8 setting. All plugins in this pipeline will default to ecs_compatibility => v8 unless explicitly configured otherwise.
[2023-06-29T13:08:53,333][INFO ][logstash.javapipeline ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>500, "pipeline.sources"=>["C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/config/mssql-data.conf"], :thread=>"#<Thread:0x10fbde56@C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
[2023-06-29T13:08:54,248][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds"=>0.91}
[2023-06-29T13:08:54,977][ERROR][logstash.inputs.jdbc ][main] Unable to connect to database. Tried 1 times {:message=>"Java::JavaLang::NoClassDefFoundError: javax/xml/bind/DatatypeConverter", :exception=>Sequel::DatabaseConnectionError, :cause=>#<Java::JavaLang::NoClassDefFoundError: javax/xml/bind/DatatypeConverter>, :backtrace=>["com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:4098)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:3160)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:43)", "com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:3123)", "com.microsoft.sqlserver.jdbc.TDSCommand.execute(com/microsoft/sqlserver/jdbc/IOBuffer.java:7505)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2445)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1981)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.login(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1628)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1459)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:773)", "com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(com/microsoft/sqlserver/jdbc/SQLServerDriver.java:1168)", "java.sql.DriverManager.getConnection(java/sql/DriverManager.java:681)", "java.sql.DriverManager.getConnection(java/sql/DriverManager.java:252)", "jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)", "jdk.internal.reflect.NativeMethodAccessorImpl.invoke(jdk/internal/reflect/NativeMethodAccessorImpl.java:77)", "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(jdk/internal/reflect/DelegatingMethodAccessorImpl.java:43)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:568)", "org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:427)", "org.jruby.javasupport.JavaMethod.invokeStaticDirect(org/jruby/javasupport/JavaMethod.java:359)", "RUBY.connect(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/adapters/jdbc.rb:225)", "RUBY.new_connection(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/database/connecting.rb:248)", "RUBY.make_new(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/connection_pool.rb:154)", "RUBY.assign_connection(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/connection_pool/threaded.rb:209)", "RUBY.acquire(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/connection_pool/threaded.rb:139)", "RUBY.hold(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/connection_pool/threaded.rb:91)", "RUBY.synchronize(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/database/connecting.rb:293)", "RUBY.test_connection(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/database/connecting.rb:302)", "RUBY.initialize(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/database/misc.rb:188)", "org.jruby.RubyClass.new(org/jruby/RubyClass.java:890)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.connect(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/database/connecting.rb:57)", "RUBY.connect(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/sequel-5.67.0/lib/sequel/core.rb:124)", "RUBY.jdbc_connect(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.3/lib/logstash/plugin_mixins/jdbc/jdbc.rb:123)", "org.jruby.RubyKernel.loop(org/jruby/RubyKernel.java:1507)", "org.jruby.RubyKernel$INVOKER$s$0$0$loop.call(org/jruby/RubyKernel$INVOKER$s$0$0$loop.gen)", "RUBY.jdbc_connect(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.3/lib/logstash/plugin_mixins/jdbc/jdbc.rb:120)", "RUBY.open_jdbc_connection(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.3/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163)", "RUBY.register(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.3/lib/logstash/inputs/jdbc.rb:309)", "RUBY.register(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/logstash-mixin-ecs_compatibility_support-1.3.0-java/lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb:48)", "RUBY.register_plugins(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:237)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1865)", "org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)", "RUBY.register_plugins(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:236)", "RUBY.start_inputs(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:395)", "RUBY.start_workers(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:320)", "RUBY.run(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:194)", "RUBY.start(C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:146)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:309)", "java.lang.Thread.run(java/lang/Thread.java:833)"]}
[2023-06-29T13:08:54,982][WARN ][logstash.inputs.jdbc ][main] Exception when executing JDBC query {:exception=>Sequel::DatabaseConnectionError, :message=>"Java::JavaLang::NoClassDefFoundError: javax/xml/bind/DatatypeConverter", :cause=>"#<Java::JavaLang::NoClassDefFoundError: javax/xml/bind/DatatypeConverter>"}
[2023-06-29T13:08:55,083][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::ConfigurationError: Can't create a connection pool to the database>, :backtrace=>["C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/logstash-integration-jdbc-5.4.3/lib/logstash/inputs/jdbc.rb:318:in `register'", "C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/vendor/bundle/jruby/2.6.0/gems/logstash-mixin-ecs_compatibility_support-1.3.0-java/lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb:48:in `register'", "C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:237:in `block in register_plugins'", "org/jruby/RubyArray.java:1865:in `each'", "C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:236:in `register_plugins'", "C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:395:in `start_inputs'", "C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:320:in `start_workers'", "C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:194:in `run'", "C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:146:in `block in start'"], "pipeline.sources"=>["C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/config/mssql-data.conf"], :thread=>"#<Thread:0x10fbde56@C:/logstash-8.8.1-windows-x86_64/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
[2023-06-29T13:08:55,085][INFO ][logstash.javapipeline ][main] Pipeline terminated {"pipeline.id"=>"main"}
[2023-06-29T13:08:55,098][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create, action_result: false", :backtrace=>nil}
[2023-06-29T13:08:55,111][INFO ][logstash.runner ] Logstash shut down.
[2023-06-29T13:08:55,116][FATAL][org.logstash.Logstash ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:790) ~[jruby.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:753) ~[jruby.jar:?]
at C_3a_.logstash_minus_8_dot_8_dot_1_minus_windows_minus_x86_64.logstash_minus_8_dot_8_dot_1.lib.bootstrap.environment.(C:\logstash-8.8.1-windows-x86_64\logstash-8.8.1\lib\bootstrap\environment.rb:91) ~[?:?]

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