Reputation: 1121
PredictionIO-0.10.0-incubating on ubuntu 16.04 returns error "Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/pio" when I run bin/pio import --appid 1 --input engine/data/stopwords.json
where is pio looking for the driver?
No issues when i run bin/pio status.
[INFO] [Console$] Inspecting PredictionIO...
[INFO] [Console$] PredictionIO 0.10.0-incubating is installed at /home/homedir/mnt/predictionio/apache-predictionio-0.10.0-incubating/PredictionIO-0.10.0-incubating
[INFO] [Console$] Inspecting Apache Spark...
[INFO] [Console$] Apache Spark is installed at /home/homedir/mnt/predictionio/apache-predictionio-0.10.0-incubating/PredictionIO-0.10.0-incubating/vendors/spark-1.5.1-bin-hadoop2.6
[INFO] [Console$] Apache Spark 1.5.1 detected (meets minimum requirement of 1.3.0)
[INFO] [Console$] Inspecting storage backend connections...
[INFO] [Storage$] Verifying Meta Data Backend (Source: PGSQL)...
[INFO] [Storage$] Verifying Model Data Backend (Source: PGSQL)...
[INFO] [Storage$] Verifying Event Data Backend (Source: PGSQL)...
[INFO] [Storage$] Test writing to Event Store (App Id 0)...
[INFO] [Console$] (sleeping 5 seconds for all messages to show up...)
[INFO] [Console$] Your system is all ready to go.
postgreSQL jdbc jar is installed at /usr/lib/jvm/postgresql-42.0.0.jar
bin/pio import --appid 1 --input engine/data/stopwords.json
[INFO] [Remoting] Starting remoting
[INFO] [Remoting] Remoting started; listening on addresses :[akka.tcp://[email protected]:41940]
[WARN] [MetricsSystem] Using default name DAGScheduler for source because spark.app.id is not set.
Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/pio
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$$anonfun$getConnector$1.apply(JDBCRDD.scala:188)
at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$$anonfun$getConnector$1.apply(JDBCRDD.scala:181)
at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.createConnection(JdbcUtils.scala:39)
at org.apache.spark.sql.DataFrameWriter.jdbc(DataFrameWriter.scala:253)
at org.apache.predictionio.data.storage.jdbc.JDBCPEvents.write(JDBCPEvents.scala:162)
at org.apache.predictionio.tools.imprt.FileToEvents$$anonfun$main$1.apply(FileToEvents.scala:101)
at org.apache.predictionio.tools.imprt.FileToEvents$$anonfun$main$1.apply(FileToEvents.scala:68)
at scala.Option.map(Option.scala:145)
at org.apache.predictionio.tools.imprt.FileToEvents$.main(FileToEvents.scala:68)
at org.apache.predictionio.tools.imprt.FileToEvents.main(FileToEvents.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:672)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:120)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Upvotes: 1
Views: 1075
Reputation: 58
By default, it looks under directory '$PIO_HOME/lib/postgresql-9.4-1204.jdbc41.jar' .
This is as per defined in file $PIO_HOME/conf/pio-env.sh.
For example:POSTGRES_JDBC_DRIVER=$PIO_HOME/lib/postgresql-9.4-1204.jdbc41.jar
Upvotes: 0
Reputation: 1121
tell pio where to find the jar
bin/pio import --appid 1 --input engine/data/emails.json -- --driver-class-path /usr/lib/jvm/postgresql-42.0.0.jar
Upvotes: 1