Classpath Issue


#1

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 :slight_smile: 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.