Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle: Unable to find driver class via URLClassLoader #355

Closed
lukasertl opened this issue Oct 24, 2019 · 5 comments
Closed

Oracle: Unable to find driver class via URLClassLoader #355

lukasertl opened this issue Oct 24, 2019 · 5 comments

Comments

@lukasertl
Copy link

  • Version:
    7.4.1

  • Operating System:
    CentOS 7

  • Config File (if you have sensitive info, please remove it):

    jdbc {
        jdbc_validate_connection => true
        jdbc_connection_string   => "CONN"
        jdbc_user                => "USER"
        jdbc_password            => "PW"
        jdbc_driver_library      => "/usr/lib64/oracle/19.3/client64/lib/ojdbc8.jar"
        jdbc_driver_class        => "Java::oracle.jdbc.driver.OracleDriver"
        statement                => "select ..."
        schedule                 => "* * * * *"
        last_run_metadata_path   => "/opt/logstash/jdbc_metadata/xxx"
        id                       => "input-jdbc-xxx"
        add_field                => { "database" => "xxx" }
    }

I've dozens of JDBC inputs like the above - all stopped working after upgrade to logstash 7.4.1 (worked fine in 7.4.0). The Oracle driver is from Oracle Instantclient 19.3.

This is the error I get:

{ 2020 rufus-scheduler intercepted an error:
2020   job:
2020     Rufus::Scheduler::CronJob "* * * * *" {}
2020   error:
2020     2020
2020     LogStash::PluginLoadingError
2020     Unable to find driver class via URLClassLoader in given driver jars: Java::oracle.jdbc.driver.OracleDriver and Java::oracle.jdbc.driver.OracleDriver
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.16/lib/logstash/plugin_mixins/jdbc/jdbc.rb:181:in `open_jdbc_connection'
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.16/lib/logstash/plugin_mixins/jdbc/jdbc.rb:253:in `execute_statement'
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.16/lib/logstash/inputs/jdbc.rb:309:in `execute_query'
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.16/lib/logstash/inputs/jdbc.rb:276:in `block in run'
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234:in `do_call'
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:258:in `do_trigger'
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300:in `block in start_work_thread'
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299:in `block in start_work_thread'
2020       org/jruby/RubyKernel.java:1425:in `loop'
2020       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289:in `block in start_work_thread'
2020   tz:
2020     ENV['TZ']:
2020     Time.now: 2019-10-24 16:12:00 +0200
2020   scheduler:
2020     object_id: 2014
2020     opts:
2020       {:max_work_threads=>1}
2020       frequency: 0.3
2020       scheduler_lock: #<Rufus::Scheduler::NullLock:0x3d368650>
2020       trigger_lock: #<Rufus::Scheduler::NullLock:0x7e02936c>
2020     uptime: 9.879249 (9s881)

2020     down?: false
2020     threads: 2
2020       thread: #<Thread:0x3e65047c>
2020       thread_key: rufus_scheduler_2014
2020       work_threads: 1
2020         active: 1
2020         vacant: 0
2020         max_work_threads: 1
2020       mutexes: {}
2020     jobs: 1
2020       at_jobs: 0
2020       in_jobs: 0
2020       every_jobs: 0
2020       interval_jobs: 0
2020       cron_jobs: 1
2020     running_jobs: 1
2020     work_queue: 0
} 2020 .

robbavey added a commit to robbavey/logstash-input-jdbc that referenced this issue Oct 25, 2019
The changes to class loading intended to fix usage of :jdbc_driver_library with
Java 11, introduced in `v4.3.14`, appear to have some issues
(elastic/logstash#11268, logstash-plugins#355). This commit attempts
to resolve those issues, and reworks the integration tests to work with
docker and ensure that the :jdbc_driver_library configuration option works.

This has been tested with postgresql using Java 8 and Java 11.
@robbavey
Copy link
Contributor

This was fixed by #355 and should be fixed by the 4.3.18 release of the jdbc input

@wargamez
Copy link

When will that be released?

@seanmbowen
Copy link

I am facing this issue in 7.4.2. When will the fix be deployed?

@wargamez
Copy link

wargamez commented Dec 5, 2019

Still an issue with 7.5.0, actually it has not worked since docker.elastic.co/logstash/logstash:7.1.1
I'm using jdbc/ojdbc8-19.3.jar and RUN bin/logstash-plugin install logstash-input-jdbc in my Dockerfile. Any idea as to when this fix will make it into the official download plugin repo/url as shown above in the Dockerfile RUN statement?

@jsvd
Copy link
Member

jsvd commented Dec 6, 2019

for those hitting this issue, running bin/logstash-plugin update logstash-input-jdbc should get you to 4.3.19 (this fix landed in 4.3.18):

/tmp/logstash-7.5.0
❯ bin/logstash-plugin update logstash-input-jdbc
Updating logstash-input-jdbc
Updated logstash-input-jdbc 4.3.16 to 4.3.19

Version >=4.3.19 will be shipped in 7.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants