You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by "Dong-iL, Kim" <ki...@gmail.com> on 2016/09/13 11:05:58 UTC

using MapReduce java.sql.SQLException: No suitable driver found for jdbc:phoenix occured.

Hi.
I've tested the map reduce code on homepage.
It coudln’t find the jdbc driver as below.
I've insert this code "Class.forName("org.apache.phoenix.jdbc.PhoenixDriver”);" in mred main method but there is no effect.
What shall I do?
Regards.


Error: java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181:/hbase;
    at org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:134)
    at org.apache.phoenix.mapreduce.PhoenixInputFormat.createRecordReader(PhoenixInputFormat.java:71)
    at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:524)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:767)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181:/hbase;
    at java.sql.DriverManager.getConnection(DriverManager.java:689)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at org.apache.phoenix.mapreduce.util.ConnectionUtil.getConnection(ConnectionUtil.java:98)
    at org.apache.phoenix.mapreduce.util.ConnectionUtil.getInputConnection(ConnectionUtil.java:57)
    at org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:116)
    ... 9 more


Re: using MapReduce java.sql.SQLException: No suitable driver found for jdbc:phoenix occured.

Posted by Josh Elser <jo...@gmail.com>.
Do you have the file "META-INF/services/java.sql.Driver" with (at least) 
the contents "org.apache.phoenix.jdbc.PhoenixDriver" in your custom jar?

It sounds like you incorrectly built the jar. Read up on how Java's 
ServiceLoader works for an explanation as to why your custom jar fails.

Dong-iL, Kim wrote:
> Hi.
> I created a fat jar with client.jar.
> there is thePhoenixDriver class in that fat jar.
> and class.forName call has no error.
> Can I have other check list?
> Regards.
>
>> On Sep 15, 2016, at 8:59 AM, Josh Elser<jo...@gmail.com>  wrote:
>>
>> phoenix-4.8.0-HBase-1.1-client.jar is the jar which should be used. The phoenix-4.8.0-HBase-1.1-hive.jar is to be used with the Hive integration.
>>
>> dalin.qin wrote:
>>> [root@namenode phoenix]# findjar . org.apache.phoenix.jdbc.PhoenixDriver
>>> Starting search for JAR files from directory .
>>> Looking for the class org.apache.phoenix.jdbc.PhoenixDriver
>>>
>>> This might take a while...
>>>
>>> ./phoenix-4.8.0-HBase-1.1-client.jar
>>> ./phoenix-4.8.0-HBase-1.1-server.jar
>>> ./phoenix-4.8.0-HBase-1.1-hive.jar
>>> ./phoenix-core-4.8.0-HBase-1.1-tests.jar
>>> ./phoenix-core-4.8.0-HBase-1.1.jar
>>> ./phoenix-core-4.8.0-HBase-1.1-sources.jar
>>>
>>> add phoenix-4.8.0-HBase-1.1-client.jar
>>> or phoenix-4.8.0-HBase-1.1-hive.jar(I'm not quite sure which one, you
>>> might try ) to your classpath might solve your problem .
>>>
>>> On Tue, Sep 13, 2016 at 7:05 AM, Dong-iL, Kim<kim.same@gmail.com
>>> <ma...@gmail.com>>  wrote:
>>>
>>>     Hi.
>>>     I've tested the map reduce code on homepage.
>>>     It coudln\u2019t find the jdbc driver as below.
>>>     I've insert this code
>>>     "Class.forName("org.apache.phoenix.jdbc.PhoenixDriver\u201d);" in mred
>>>     main method but there is no effect.
>>>     What shall I do?
>>>     Regards.
>>>
>>>
>>>     Error: java.lang.RuntimeException: java.sql.SQLException: No
>>>     suitable driver found for
>>>     jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181
>>>     <http://master.denma.ggportal.net:2181>:/hbase;
>>>          at
>>>     org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:134)
>>>          at
>>>     org.apache.phoenix.mapreduce.PhoenixInputFormat.createRecordReader(PhoenixInputFormat.java:71)
>>>          at
>>>     org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:524)
>>>          at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:767)
>>>          at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
>>>          at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
>>>          at java.security.AccessController.doPrivileged(Native Method)
>>>          at javax.security.auth.Subject.doAs(Subject.java:422)
>>>          at
>>>     org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
>>>          at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
>>>     Caused by: java.sql.SQLException: No suitable driver found for
>>>     jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181
>>>     <http://master.denma.ggportal.net:2181>:/hbase;
>>>          at java.sql.DriverManager.getConnection(DriverManager.java:689)
>>>          at java.sql.DriverManager.getConnection(DriverManager.java:208)
>>>          at
>>>     org.apache.phoenix.mapreduce.util.ConnectionUtil.getConnection(ConnectionUtil.java:98)
>>>          at
>>>     org.apache.phoenix.mapreduce.util.ConnectionUtil.getInputConnection(ConnectionUtil.java:57)
>>>          at
>>>     org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:116)
>>>          ... 9 more
>>>
>>>
>

Re: using MapReduce java.sql.SQLException: No suitable driver found for jdbc:phoenix occured.

Posted by "Dong-iL, Kim" <ki...@gmail.com>.
Hi.
I created a fat jar with client.jar. 
there is thePhoenixDriver class in that fat jar.
and class.forName call has no error.
Can I have other check list?
Regards.

> On Sep 15, 2016, at 8:59 AM, Josh Elser <jo...@gmail.com> wrote:
> 
> phoenix-4.8.0-HBase-1.1-client.jar is the jar which should be used. The phoenix-4.8.0-HBase-1.1-hive.jar is to be used with the Hive integration.
> 
> dalin.qin wrote:
>> [root@namenode phoenix]# findjar . org.apache.phoenix.jdbc.PhoenixDriver
>> Starting search for JAR files from directory .
>> Looking for the class org.apache.phoenix.jdbc.PhoenixDriver
>> 
>> This might take a while...
>> 
>> ./phoenix-4.8.0-HBase-1.1-client.jar
>> ./phoenix-4.8.0-HBase-1.1-server.jar
>> ./phoenix-4.8.0-HBase-1.1-hive.jar
>> ./phoenix-core-4.8.0-HBase-1.1-tests.jar
>> ./phoenix-core-4.8.0-HBase-1.1.jar
>> ./phoenix-core-4.8.0-HBase-1.1-sources.jar
>> 
>> add phoenix-4.8.0-HBase-1.1-client.jar
>> or phoenix-4.8.0-HBase-1.1-hive.jar(I'm not quite sure which one, you
>> might try ) to your classpath might solve your problem .
>> 
>> On Tue, Sep 13, 2016 at 7:05 AM, Dong-iL, Kim <kim.same@gmail.com
>> <ma...@gmail.com>> wrote:
>> 
>>    Hi.
>>    I've tested the map reduce code on homepage.
>>    It coudln’t find the jdbc driver as below.
>>    I've insert this code
>>    "Class.forName("org.apache.phoenix.jdbc.PhoenixDriver”);" in mred
>>    main method but there is no effect.
>>    What shall I do?
>>    Regards.
>> 
>> 
>>    Error: java.lang.RuntimeException: java.sql.SQLException: No
>>    suitable driver found for
>>    jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181
>>    <http://master.denma.ggportal.net:2181>:/hbase;
>>         at
>>    org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:134)
>>         at
>>    org.apache.phoenix.mapreduce.PhoenixInputFormat.createRecordReader(PhoenixInputFormat.java:71)
>>         at
>>    org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:524)
>>         at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:767)
>>         at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
>>         at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at javax.security.auth.Subject.doAs(Subject.java:422)
>>         at
>>    org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
>>         at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
>>    Caused by: java.sql.SQLException: No suitable driver found for
>>    jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181
>>    <http://master.denma.ggportal.net:2181>:/hbase;
>>         at java.sql.DriverManager.getConnection(DriverManager.java:689)
>>         at java.sql.DriverManager.getConnection(DriverManager.java:208)
>>         at
>>    org.apache.phoenix.mapreduce.util.ConnectionUtil.getConnection(ConnectionUtil.java:98)
>>         at
>>    org.apache.phoenix.mapreduce.util.ConnectionUtil.getInputConnection(ConnectionUtil.java:57)
>>         at
>>    org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:116)
>>         ... 9 more
>> 
>> 


Re: using MapReduce java.sql.SQLException: No suitable driver found for jdbc:phoenix occured.

Posted by Josh Elser <jo...@gmail.com>.
phoenix-4.8.0-HBase-1.1-client.jar is the jar which should be used. The 
phoenix-4.8.0-HBase-1.1-hive.jar is to be used with the Hive integration.

dalin.qin wrote:
> [root@namenode phoenix]# findjar . org.apache.phoenix.jdbc.PhoenixDriver
> Starting search for JAR files from directory .
> Looking for the class org.apache.phoenix.jdbc.PhoenixDriver
>
> This might take a while...
>
> ./phoenix-4.8.0-HBase-1.1-client.jar
> ./phoenix-4.8.0-HBase-1.1-server.jar
> ./phoenix-4.8.0-HBase-1.1-hive.jar
> ./phoenix-core-4.8.0-HBase-1.1-tests.jar
> ./phoenix-core-4.8.0-HBase-1.1.jar
> ./phoenix-core-4.8.0-HBase-1.1-sources.jar
>
> add phoenix-4.8.0-HBase-1.1-client.jar
> or phoenix-4.8.0-HBase-1.1-hive.jar(I'm not quite sure which one, you
> might try ) to your classpath might solve your problem .
>
> On Tue, Sep 13, 2016 at 7:05 AM, Dong-iL, Kim <kim.same@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Hi.
>     I've tested the map reduce code on homepage.
>     It coudln\u2019t find the jdbc driver as below.
>     I've insert this code
>     "Class.forName("org.apache.phoenix.jdbc.PhoenixDriver\u201d);" in mred
>     main method but there is no effect.
>     What shall I do?
>     Regards.
>
>
>     Error: java.lang.RuntimeException: java.sql.SQLException: No
>     suitable driver found for
>     jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181
>     <http://master.denma.ggportal.net:2181>:/hbase;
>          at
>     org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:134)
>          at
>     org.apache.phoenix.mapreduce.PhoenixInputFormat.createRecordReader(PhoenixInputFormat.java:71)
>          at
>     org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:524)
>          at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:767)
>          at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
>          at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
>          at java.security.AccessController.doPrivileged(Native Method)
>          at javax.security.auth.Subject.doAs(Subject.java:422)
>          at
>     org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
>          at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
>     Caused by: java.sql.SQLException: No suitable driver found for
>     jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181
>     <http://master.denma.ggportal.net:2181>:/hbase;
>          at java.sql.DriverManager.getConnection(DriverManager.java:689)
>          at java.sql.DriverManager.getConnection(DriverManager.java:208)
>          at
>     org.apache.phoenix.mapreduce.util.ConnectionUtil.getConnection(ConnectionUtil.java:98)
>          at
>     org.apache.phoenix.mapreduce.util.ConnectionUtil.getInputConnection(ConnectionUtil.java:57)
>          at
>     org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:116)
>          ... 9 more
>
>

Re: using MapReduce java.sql.SQLException: No suitable driver found for jdbc:phoenix occured.

Posted by "dalin.qin" <da...@gmail.com>.
[root@namenode phoenix]# findjar . org.apache.phoenix.jdbc.PhoenixDriver
Starting search for JAR files from directory .
Looking for the class org.apache.phoenix.jdbc.PhoenixDriver

This might take a while...

./phoenix-4.8.0-HBase-1.1-client.jar
./phoenix-4.8.0-HBase-1.1-server.jar
./phoenix-4.8.0-HBase-1.1-hive.jar
./phoenix-core-4.8.0-HBase-1.1-tests.jar
./phoenix-core-4.8.0-HBase-1.1.jar
./phoenix-core-4.8.0-HBase-1.1-sources.jar

add phoenix-4.8.0-HBase-1.1-client.jar
or phoenix-4.8.0-HBase-1.1-hive.jar(I'm not quite sure which one, you might
try ) to your classpath might solve your problem .

On Tue, Sep 13, 2016 at 7:05 AM, Dong-iL, Kim <ki...@gmail.com> wrote:

> Hi.
> I've tested the map reduce code on homepage.
> It coudln’t find the jdbc driver as below.
> I've insert this code "Class.forName("org.apache.phoenix.jdbc.PhoenixDriver”);"
> in mred main method but there is no effect.
> What shall I do?
> Regards.
>
>
> Error: java.lang.RuntimeException: java.sql.SQLException: No suitable
> driver found for jdbc:phoenix:internal.hadoop-
> master.denma.ggportal.net:2181:/hbase;
>     at org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(
> PhoenixInputFormat.java:134)
>     at org.apache.phoenix.mapreduce.PhoenixInputFormat.createRecordReader(
> PhoenixInputFormat.java:71)
>     at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>
> (MapTask.java:524)
>     at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:767)
>     at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
>     at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at javax.security.auth.Subject.doAs(Subject.java:422)
>     at org.apache.hadoop.security.UserGroupInformation.doAs(
> UserGroupInformation.java:1657)
>     at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
> Caused by: java.sql.SQLException: No suitable driver found for
> jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181:/hbase;
>     at java.sql.DriverManager.getConnection(DriverManager.java:689)
>     at java.sql.DriverManager.getConnection(DriverManager.java:208)
>     at org.apache.phoenix.mapreduce.util.ConnectionUtil.
> getConnection(ConnectionUtil.java:98)
>     at org.apache.phoenix.mapreduce.util.ConnectionUtil.
> getInputConnection(ConnectionUtil.java:57)
>     at org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(
> PhoenixInputFormat.java:116)
>     ... 9 more
>
>

Re: using MapReduce java.sql.SQLException: No suitable driver found for jdbc:phoenix occured.

Posted by Josh Elser <jo...@gmail.com>.
Hi,

The trailing semi-colon on the URL seems odd, but I do not think it 
would cause issues in parsing when inspecting the logic in 
PhoenixEmbeddedDriver#acceptsURL(String).

Does the Class.forName(..) call succeed? You have Phoenix properly on 
the classpath for your mappers?

Dong-iL, Kim wrote:
> Hi.
> I've tested the map reduce code on homepage.
> It coudln\u2019t find the jdbc driver as below.
> I've insert this code "Class.forName("org.apache.phoenix.jdbc.PhoenixDriver\u201d);" in mred main method but there is no effect.
> What shall I do?
> Regards.
>
>
> Error: java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181:/hbase;
>      at org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:134)
>      at org.apache.phoenix.mapreduce.PhoenixInputFormat.createRecordReader(PhoenixInputFormat.java:71)
>      at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:524)
>      at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:767)
>      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
>      at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
>      at java.security.AccessController.doPrivileged(Native Method)
>      at javax.security.auth.Subject.doAs(Subject.java:422)
>      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
>      at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
> Caused by: java.sql.SQLException: No suitable driver found for jdbc:phoenix:internal.hadoop-master.denma.ggportal.net:2181:/hbase;
>      at java.sql.DriverManager.getConnection(DriverManager.java:689)
>      at java.sql.DriverManager.getConnection(DriverManager.java:208)
>      at org.apache.phoenix.mapreduce.util.ConnectionUtil.getConnection(ConnectionUtil.java:98)
>      at org.apache.phoenix.mapreduce.util.ConnectionUtil.getInputConnection(ConnectionUtil.java:57)
>      at org.apache.phoenix.mapreduce.PhoenixInputFormat.getQueryPlan(PhoenixInputFormat.java:116)
>      ... 9 more
>