Postgresql JDBC Driver Plugin- ClassNotFoundException:org.postgresql.Driver

86 views
Skip to first unread message

hanees...@gmail.com

unread,
Jan 5, 2017, 3:36:12 PM1/5/17
to CDAP User
Hi,

I am trying to deploy postgresql jdbc plugin, but I am getting class not found exception as below. The jdbc jar is loaded in cdap artifacts. It is working on my standalone VM, but I got this error on distributed. please help



java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.postgresql.Driver
        at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:294)
        at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:281)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
        at co.cask.cdap.internal.app.runtime.distributed.AbstractProgramTwillRunnable.run(AbstractProgramTwillRunnable.java:305)
        at org.apache.twill.internal.container.TwillContainerService.doRun(TwillContainerService.java:130)
        at org.apache.twill.internal.AbstractTwillService.run(AbstractTwillService.java:179)
        at com.google.common.util.concurrent.AbstractExecutionThreadService$1$1.run(AbstractExecutionThreadService.java:52)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.postgresql.Driver
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at co.cask.cdap.internal.app.runtime.workflow.WorkflowDriver.executeAll(WorkflowDriver.java:580)
        at co.cask.cdap.internal.app.runtime.workflow.WorkflowDriver.run(WorkflowDriver.java:557)
        at com.google.common.util.concurrent.AbstractExecutionThreadService$1$1.run(AbstractExecutionThreadService.java:52)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)



This is the json file
{
  "parents": [ "system:cdap-data-pipeline[3.5.1,3.5.1]" ],
  "plugins":
  [
      {
      "name" : "postgresql",
      "type" : "jdbc",
      "className" : "org.postgresql.Driver",
      "description" : "Plugin for PostgreSQL JDBC driver"
    }
  ]
}


Thanks,
Haneesha
Auto Generated Inline Image 1

Shankar Selvam

unread,
Jan 5, 2017, 6:12:00 PM1/5/17
to cdap...@googlegroups.com
Hi Haneesha,

Which Hadoop Distribution and version are you using in your distributed environment?.

We have noticed an issue with using JDBC driver on HDP cluster and have resolved that issue in CDAP release 3.5.2. You can find more details about the issue here, https://issues.cask.co/browse/HYDRATOR-791

Its possible you might be hitting that issue as you are using CDAP version 3.5.1. 

Thanks
Shankar


--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+unsubscribe@googlegroups.com.
To post to this group, send email to cdap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/3eda6f91-68ce-4811-94fb-54c37957e06a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alexein...@gmail.com

unread,
Jan 6, 2017, 8:37:22 AM1/6/17
to CDAP User
We are using CDAP 3.5.1 running on Hortonworks HDP 2.4

Shankar, is there a way to use JDBC Plugins with 3.5.1? By applying a patch, etc. Some work-around?..
Or JDBC is not working in 3.5.1/HDP 2.4?

Thanks,
Alex Nekrassov
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.

Shankar Selvam

unread,
Jan 6, 2017, 8:26:02 PM1/6/17
to cdap...@googlegroups.com
Hi Alex,

Since this was fixed in Hydrator 1.4.1 release, you can upload the core-plugins from 1.4.1 release into your cluster and update system artifacts and use the 1.4.1 version of Database plugin in your pipeline.

Steps
2) Copy the core-plugins files, cdap-sdk-3.5.2/artifacts/core-plugins-1.4.1.jar and cdap-sdk-3.5.2/artifacts/core-plugins-1.4.1.json to your cluster <cdap-master-installation-location>/artifacts/
4) Build the pipeline using 1.4.1 version for Database (source/sink) plugin

Hope this helps.

Thanks
Shankar

To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+unsubscribe@googlegroups.com.

To post to this group, send email to cdap...@googlegroups.com.

hanees...@gmail.com

unread,
Jan 9, 2017, 2:30:57 PM1/9/17
to CDAP User
Thanks Shankar, It worked with CDAP-3.5.2 version.

/Haneesha
Reply all
Reply to author
Forward
0 new messages