phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samarth Jain <sama...@apache.org>
Subject Re: JRuby on rails -> Phoenix connection error - cannot load java class
Date Wed, 02 Dec 2015 23:47:34 GMT
Josh,

One step worth trying would be is to register the PhoenixDriver instance
and see if that helps. Something like this:

DriverManager.registerDriver(PhoenixDriver.INSTANCE)
Connection con = DriverManager.getConnection("jdbc:phoenix:localhost:2181”)

- Samarth


On Wed, Dec 2, 2015 at 3:41 PM, Josh Harrison <joshharrison@coraxcyber.com>
wrote:

>
> Thanks for your help and quick response Russell. This does seemed to have
> progressed things, however I’m now getting the following error:
> NameError: cannot link Java class org.apache.phoenix.jdbc.PhoenixDriver,
> probable missing dependency: Could not initialize class
> org.apache.phoenix.jdbc.PhoenixDriver
>
> Any further ideas?
>
> Cheers,
> Josh
>
>
> On 2 Dec 2015, at 11:37, Russell Jurney <russell.jurney@gmail.com> wrote:
>
> This seems like a class path problem. Try specifying the class path to the
> jar with that class in it via: CLASSPATH=/foo/bar.jar jruby ...
>
> On Wednesday, December 2, 2015, Josh Harrison <joshharrison@coraxcyber.com>
> wrote:
>
>> Hi Guys,
>>
>> We’re trying to spin up a testing version of Phoenix and integrate it
>> with a Jruby on rails application. I have Phoenix and Hbase successfully
>> installed, configured and talking to each other, but am coming up with a
>> ‘cannot load java class’ error when trying to make the connection to the
>> rails server. I’m running this in standalone mode by the way for testing
>> purposes.
>>
>> The correct phoenix-server jars in are the classpath for the application.
>>
>> Any help or guidance you can give on the the connection would be greatly
>> appreciated.
>>
>> Phoenix:  4.6
>> HBase:  1.1.2
>> JRuby: 1.7.19
>>
>> Error:
>>
>> NameError: cannot load Java class org.apache.phoenix.jdbc.PhoenixDriver
>>                                 for_name at
>> org/jruby/javasupport/JavaClass.java:1286
>>                          get_proxy_class at
>> org/jruby/javasupport/JavaUtilities.java:34
>>                              java_import at
>> file:/usr/local/rvm/rubies/jruby-1.7.19/lib/jruby.jar!/jruby/java/core_ext/object.rb:27
>>
>>
>> ______________________________________________________________________________________________
>>
>> Here’s my jdbc.rb connector:
>>
>> require 'java'
>> java_import 'org.apache.phoenix.jdbc.PhoenixDriver'
>>
>> java_import 'java.sql.Connection'
>> java_import 'java.sql.DriverManager'
>> java_import 'java.sql.ResultSet'
>> java_import 'java.sql.SQLException'
>> java_import 'java.sql.PreparedStatement'
>> java_import 'java.sql.Statement'
>>
>> Java::JavaClass.for_name "org.apache.phoenix.jdbc.PhoenixDriver"
>> Connection con =
>> DriverManager.getConnection("jdbc:phoenix://localhost:2181”)
>>
>> ______________________________________________________________________________________________
>>
>> Related Gems in Gemfile:
>>
>> activerecord-jdbc-adapter
>> jdbc-mysql
>>
>>
>> More generally do you have many examples or use cases of OLTP rails
>> applications connecting to phoenix, as most examples I’ve found seem to be
>> Java applications?
>>
>> Many Thanks,
>> Josh
>>
>>
>>
>>
>>
>>
>> --
>>
>>
>> This is an e-mail from Corax Cyber Security Ltd or Corax Cyber Security
>> Inc. This email together with any attachments may contain confidential
>> and/or privileged information. It may be read, copied and used only by the
>> intended recipient. No one else may place any reliance on it or copy,
>> disclose or forward all or any of it in any form. If you have received
>> this
>> email in error, please contact the sender immediately.
>>
>> If you receive this e-mail in error, please notify us immediately.
>> Although
>> Corax Cyber Security Ltd and Corax Cyber Security Inc believes this email
>> and any attachments are free of any virus, it is the responsibility of the
>> recipient to ensure that it is virus free.
>>
>
>
> --
> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com relato.io
>
>
>
> This is an e-mail from Corax Cyber Security Ltd or Corax Cyber Security
> Inc. This email together with any attachments may contain confidential
> and/or privileged information. It may be read, copied and used only by the
> intended recipient. No one else may place any reliance on it or copy,
> disclose or forward all or any of it in any form. If you have received this
> email in error, please contact the sender immediately.
>
> If you receive this e-mail in error, please notify us immediately.
> Although Corax Cyber Security Ltd and Corax Cyber Security Inc believes
> this email and any attachments are free of any virus, it is the
> responsibility of the recipient to ensure that it is virus free.
>

Mime
View raw message