Created 06-11-2019 11:45 AM
Hi,
My nifi flow is a simple one where i fetchs3object and put it into a AWS Postgresql DB using PUTSQL method.
Below is my Connection set up:
Database Connection URL
jdbc:postgresql://xxxxxxxx.amazonaws.com:5432/dhwdh
Database Driver Class Name
org.postgresql.Driver
Database Driver Location(s)
/xx/xx/xx/nifi-1.9.2/lib/jdbc-postgresql.jar
Kerberos Credentials Service
No value set
Database User
dev
Password
Sensitive value set
Max Wait Time
500 millis
I'm getting this error in PUTSQL processor:
2019-06-11 06:55:56,426 ERROR [Timer-Driven Process Thread-8] o.apache.nifi.processors.standard.PutSQL PutSQL[id=016b102c-cd19-10b1-b7d8-960311cdf697] PutSQL[id=016b102c-cd19-10b1-b7d8-960311cdf697] failed to process session due to java.lang.AbstractMethodError: org.postgresql.jdbc3g.Jdbc3gConnection.isValid(I)Z; Processor Administratively Yielded for 1 sec: java.lang.AbstractMethodError: org.postgresql.jdbc3g.Jdbc3gConnection.isValid(I)Z
java.lang.AbstractMethodError: org.postgresql.jdbc3g.Jdbc3gConnection.isValid(I)Z
.
.
.
.
.
2019-06-11 06:55:56,426 WARN [Timer-Driven Process Thread-8] o.a.n.controller.tasks.ConnectableTask Administratively Yielding PutSQL[id=016b102c-cd19-10b1-b7d8-960311cdf697] due to uncaught Exception: java.lang.AbstractMethodError: org.postgresql.jdbc3g.Jdbc3gConnection.isValid(I)Z
java.lang.AbstractMethodError: org.postgresql.jdbc3g.Jdbc3gConnection.isValid(I)Z
can some one please suggest me how to resolve this.
Created 06-11-2019 11:50 AM
Is there any specific reason that you are using Postgres JDBC Driver3 ? Somewhere in your NiFI lib/Classpath it has incorrect portgres JDBC 3 Driver.
We see the following error
java.lang.AbstractMethodError: org.postgresql.jdbc3g.Jdbc3gConnection.isValid(I)
It looks like you are not using correct JDBC driver. So can you please try downloading the correct JDBC 4 postgres driver and then test again.
.
Based on your Postgres version you can download the JDBC4 Postgres Driver from here: https://jdbc.postgresql.org/download.html
Created 06-11-2019 03:21 PM
Hi Jay,
I'm not sure which jar i have to download for postgresql DB driver.
I tried with below 2 jars and placed them in nifi_home/lib folder and pointed the location in "Database Driver location".
jdbc-postgresql.jar
postgresql-42.2.5.jar
I get the same error that I pasted above for both the jars.
Can you let me know which jar/link to dowload the jar that I have to use for postgres DB driver.
Created 06-11-2019 03:44 PM
Sorry I missed to read your complete reply.
As i mentioned, i tried with jar " postgresql-42.2.5.jar " which is JDBC 4 postgres driver . But i get the same error again . I'm not sure why its reffereing to jdbc3g.Jdbc3gConnection in the error though its JDBC 4 driver.
I tried giving the absolute path too in the Driver location.
Created 06-13-2019 02:52 AM
Please try this to find out which JAR is the culprit here:
$JAVA_HOME/bin/javap -cp /PATH/TO/jdbc-postgresql.jar org.postgresql.jdbc3g.Jdbc3gConnection AND $JAVA_HOME/bin/javap -cp /PATH/TO/postgresql-42.2.5.jar org.postgresql.jdbc3g.Jdbc3gConnection
.
if you see the output of as following from any of the above JAR means it is actually a JDBC3 driver and might be the problem, and you will have to remove it.
# javap -cp /Users/jaysensharma/Downloads/jdbc-postgresql.jar org.postgresql.jdbc3g.Jdbc3gConnection Compiled from "Jdbc3gConnection.java" public class org.postgresql.jdbc3g.Jdbc3gConnection extends org.postgresql.jdbc3g.AbstractJdbc3gConnection implements java.sql.Connection { public org.postgresql.jdbc3g.Jdbc3gConnection(org.postgresql.util.HostSpec[], java.lang.String, java.lang.String, java.util.Properties, java.lang.String) throws java.sql.SQLException; public java.sql.Statement createStatement(int, int, int) throws java.sql.SQLException; public java.sql.PreparedStatement prepareStatement(java.lang.String, int, int, int) throws java.sql.SQLException; public java.sql.CallableStatement prepareCall(java.lang.String, int, int, int) throws java.sql.SQLException; public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException; public void setTypeMap(java.util.Map<java.lang.String, java.lang.Class<?>>) throws java.sql.SQLException; }
.
Created 06-13-2019 04:30 AM
The above was originally posted in the Community Help Track. On Thu Jun 13 04:29 UTC 2019, a member of the HCC moderation staff moved it to the Data Ingestion & Streaming track. The Community Help Track is intended for questions about using the HCC site itself.