Forum: Ruby on Rails classpath Issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ganesh K. (Guest)
on 2009-02-09 21:33
I am new to Ruby/RoR and would appreciate any help on the issue I am
trying to resolve far past 2 days.

I have a java application as a jar and I have included in the controller
as below.

  require 'java'
  require 'C:/Documents and Settings/user/Desktop/application.jar'

  include_package 'whatever.something'

After that I am calling a method from one of the classes in the jar.

  puts Java::WhateverSomething::Engine.helloWorld()

This helloWorld() program does a very complex thing :) and returns an id
string that I am trying to display in the console. This external
application has a call to the DB.

I have the driver jar in the application.jar. Also, I have included in
the RoR java runtime library and all places I can think of but still I
am getting the 'Class Not Found' exception. Can someone point what I am
doing wrong?

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
...
java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(DriverManager.java:545)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
...

Thanks.
This topic is locked and can not be replied to.