phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Jurney <russell.jur...@gmail.com>
Subject Re: JRuby on rails -> Phoenix connection error - cannot load java class
Date Wed, 02 Dec 2015 19:37:39 GMT
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

Mime
View raw message