phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 夏凉 <luoxiulu...@163.com>
Subject Problem of Phoenix Hello World sample
Date Fri, 29 Aug 2014 19:01:05 GMT
Hi there,


I have a problem of HelloWorld example. http://phoenix.apache.org/faq.html


[stsuid@ana-poc-01:~/HDP]$java -cp "./HDP/phoenix/hadoop-2/phoenix-4.0.0-incubating-client.jar:."
HelloWorld
Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:phoenix:ana-poc-01
at java.sql.DriverManager.getConnection(DriverManager.java:596)
at java.sql.DriverManager.getConnection(DriverManager.java:233)
at HelloWorld.main(HelloWorld.java:14)


My environment:
hadoop version: hadoop-2.2.0
hbase version: hbase-0.98.5
phoenix version: phoenix-4.0.0


I changed hbase.defaults.for.version over to 0.98.1-hadoop2 in hbase-defaul.xml in phoenix-4.0.0/hadoop-2/phoenix-4.0.0-incubating-client.jar
<property skipInDoc="true">
    <name>hbase.defaults.for.version</name>
    <value>0.98.1-hadoop2</value>
    <description>This defaults file was compiled for version ${project.version}. This
variable is used
    to make sure that a user doesn't have an old version of hbase-default.xml on the
    classpath.</description>
</property>


I copied phoenix-*.jar to HBase lib folder and restarted HBase.
I added the phoenix-4.0.0-incubating-client.jar to the classpath of ana-poc-01(my phoenix
client)


I only changed zookeeper name in java code:
Connection con = DriverManager.getConnection("jdbc:phoenix:ana-poc-01");


Then in command line, I run:
[stsuid@ana-poc-01:~/HDP]$javac HelloWorld.java
[stsuid@ana-poc-01:~/HDP]$java -cp "./HDP/phoenix/hadoop-2/phoenix-4.0.0-incubating-client.jar:."
HelloWorld


What may cause this problem? Anyone has some ideas?


Thanks,
Liang

Mime
View raw message