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

Error: oracle.jdbc.driver.OracleDriver not loaded. #43

Closed
cinhtau opened this Issue Aug 18, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@cinhtau

cinhtau commented Aug 18, 2015

Hi,

I'm working with the latest logstash v1.5.3 on a windows notebook. I installed the logstash-input-jdbc plugin successfully. I tried to perform a SQL connection test, but he is not able to load the Oracle jdbc driver.

My logstash config

input {
  jdbc {    
    jdbc_driver_library => "C:\Daten\tools\logstash-1.5.3\db\ojdbc6.jar"
    jdbc_driver_class => "oracle.jdbc.driver.OracleDriver"
    jdbc_connection_string => "jdbc:oracle:thin:@//localhost:1521/db"
    jdbc_user => "user"
    jdbc_password => "passwd"
    # will execute on the 0th minute of every hour every day
    schedule => "0 * * * *"
    statement => "select 1 from dual"
    jdbc_paging_enabled => "true"
    jdbc_page_size => "1"
  }
}
output {
    stdout { codec => rubydebug }
}

My setup from the windows cmd

C:\Daten\tools\logstash-1.5.3\db>dir
 Volume in drive C is SYSTEM
 Volume Serial Number is 8452-140B

 Directory of C:\Daten\tools\logstash-1.5.3\db

08/18/2015  11:38 AM    <DIR>          .
08/18/2015  11:38 AM    <DIR>          ..
06/04/2014  02:28 PM         3,389,454 ojdbc6.jar
               1 File(s)      3,389,454 bytes
               2 Dir(s)   1,006,612,480 bytes free

Starting the test

C:\Daten\tools\logstash-1.5.3>bin\logstash.bat -f local-db.conf
io/console not supported; tty will not be manipulated
Error: oracle.jdbc.driver.OracleDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_
library?

I have checked the jar and database version. Using a java program and a sql client the connection was ok. Any ideas and pointers?

I run the debug trace

{:timestamp=>"2015-08-18T11:50:45.581000+0200", :message=>"Reading config file", :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/agent.rb", :level=>:debug, :line=>"309", :method=>"local_config"}
{:timestamp=>"2015-08-18T11:50:45.630000+0200", :message=>"Compiled pipeline code:\n        @inputs = []\n        @filters = []\n        @outputs = []\n        @periodic_flushers = []\n        @shutdown_flushers = []\n\n          @input_jdbc_1 = plugin(\"input\", \"jdbc\", LogStash::Util.hash_merge_many({ \"jdbc_driver_library\" => (\"C:/Daten/tools/logstash-1.5.3/db/ojdbc6.jar\") }, { \"jdbc_driver_class\" => (\"oracle.jdbc.driver.OracleDriver\") }, { \"jdbc_connection_string\" => (\"jdbc:oracle:thin:@//localhost:1521/db\") }, { \"jdbc_user\" => (\"user\") }, { \"jdbc_password\" => (\"password\") }, { \"schedule\" => (\"0 * * * *\") }, { \"statement\" => (\"select 1 from dual\") }, { \"jdbc_paging_enabled\" => (\"true\") }, { \"jdbc_page_size\" => (\"1\") }))\n\n          @inputs << @input_jdbc_1\n\n          @output_stdout_2 = plugin(\"output\", \"stdout\", LogStash::Util.hash_merge_many({ \"codec\" => (\"rubydebug\") }))\n\n          @outputs << @output_stdout_2\n\n  def filter_func(event)\n    events = [event]\n    @logger.debug? && @logger.debug(\"filter received\", :event => event.to_hash)\n    events\n  end\n  def output_func(event)\n    @logger.debug? && @logger.debug(\"output received\", :event => event.to_hash)\n    @output_stdout_2.handle(event)\n    \n  end", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/pipeline.rb", :line=>"29", :method=>"initialize"}
{:timestamp=>"2015-08-18T11:50:45.633000+0200", :message=>"Plugin not defined in namespace, checking for plugin file", :type=>"input", :name=>"jdbc", :path=>"logstash/inputs/jdbc", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/plugin.rb", :line=>"133", :method=>"lookup"}
{:timestamp=>"2015-08-18T11:50:45.651000+0200", :message=>"Plugin not defined in namespace, checking for plugin file", :type=>"codec", :name=>"plain", :path=>"logstash/codecs/plain", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/plugin.rb", :line=>"133", :method=>"lookup"}
{:timestamp=>"2015-08-18T11:50:45.669000+0200", :message=>"config LogStash::Codecs::Plain/@charset = \"UTF-8\"", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.670000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_driver_library = \"C:/Daten/tools/logstash-1.5.3/db/ojdbc6.jar\"", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.671000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_driver_class = \"oracle.jdbc.driver.OracleDriver\"", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.673000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_connection_string = \"jdbc:oracle:thin:@//localhost:1521/db\"", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.674000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_user = \"user\"", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.675000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_password = <password>", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.676000+0200", :message=>"config LogStash::Inputs::Jdbc/@schedule = \"0 * * * *\"", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.677000+0200", :message=>"config LogStash::Inputs::Jdbc/@statement = \"select 1 from dual\"", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.678000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_paging_enabled = true", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.679000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_page_size = 1", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.680000+0200", :message=>"config LogStash::Inputs::Jdbc/@debug = false", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.681000+0200", :message=>"config LogStash::Inputs::Jdbc/@codec = <LogStash::Codecs::Plain charset=>\"UTF-8\">", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.682000+0200", :message=>"config LogStash::Inputs::Jdbc/@add_field = {}", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.683000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_validate_connection = false", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.685000+0200", :message=>"config LogStash::Inputs::Jdbc/@jdbc_validation_timeout = 3600", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.686000+0200", :message=>"config LogStash::Inputs::Jdbc/@parameters = {}", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.690000+0200", :message=>"config LogStash::Inputs::Jdbc/@clean_run = false", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.691000+0200", :message=>"config LogStash::Inputs::Jdbc/@record_last_run = true", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.693000+0200", :message=>"Plugin not defined in namespace, checking for plugin file", :type=>"output", :name=>"stdout", :path=>"logstash/outputs/stdout", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/plugin.rb", :line=>"133", :method=>"lookup"}
{:timestamp=>"2015-08-18T11:50:45.763000+0200", :message=>"Plugin not defined in namespace, checking for plugin file", :type=>"codec", :name=>"rubydebug", :path=>"logstash/codecs/rubydebug", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/plugin.rb", :line=>"133", :method=>"lookup"}
{:timestamp=>"2015-08-18T11:50:45.772000+0200", :message=>"config LogStash::Codecs::RubyDebug/@metadata = false", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.774000+0200", :message=>"config LogStash::Outputs::Stdout/@codec = <LogStash::Codecs::RubyDebug metadata=>false>", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.775000+0200", :message=>"config LogStash::Outputs::Stdout/@type = \"\"", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.776000+0200", :message=>"config LogStash::Outputs::Stdout/@tags = []", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.777000+0200", :message=>"config LogStash::Outputs::Stdout/@exclude_tags = []", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-08-18T11:50:45.777000+0200", :message=>"config LogStash::Outputs::Stdout/@workers = 1", :level=>:debug, :file=>"/Daten/tools/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
Error: oracle.jdbc.driver.OracleDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
You may be interested in the '--configtest' flag which you can
use to validate logstash's configuration before you choose
to restart a running system.
@pafq

This comment has been minimized.

pafq commented Aug 18, 2015

@cinhtau
Try to replace this line:
jdbc_driver_class => "oracle.jdbc.driver.OracleDriver"

for this one:
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"

@cinhtau

This comment has been minimized.

cinhtau commented Aug 18, 2015

💥 Yeah, that works! Thx a lot. 👍 Somehow the docs didn't mentioned that. 😌

@cinhtau cinhtau closed this Aug 18, 2015

@pafq

This comment has been minimized.

pafq commented Aug 18, 2015

I know. Other user had the same problem (me included)

rmoff pushed a commit to rmoff/logstash-input-jdbc that referenced this issue Nov 5, 2015

jordansissel added a commit that referenced this issue Nov 6, 2015

jordansissel added a commit that referenced this issue Nov 6, 2015

@blueskea

This comment has been minimized.

blueskea commented Aug 10, 2018

Thank for pafq !

@chengguojun

This comment has been minimized.

chengguojun commented Sep 10, 2018

感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment