What causes FileNotFoundException: ...pdq.jar with db2jcc4?

This might happen in the newer versions of Db2 jcc driver:

Beginning with version 4.16 of the IBM Data Server Driver for JDBC and SQLJ, which is shipped with Db2 10.5 on Linux, UNIX, or Windows operating systems, the MANIFEST.MF file for db2jcc4.jar contains a reference to pdq.jar.

IBM Support offers 2 options:

Resolving the problem To prevent the java.io.FileNotFoundException, you can take one of the following actions:

  • Edit the MANIFEST.MF file, and remove this line: Class-Path: pdq.jar

  • Edit the context.xml file for Apache Tomcat, and add an entry like the following one to set the value of scanClassPath to false.

Personally, I prefer the second approach, which can be done as following:

<Context>
   ...
   <JarScanner  scanClassPath="false" />
   ...
</Context>

According to this KB article on IBM, the problem comes from the MANIFEST, which lists pdq.jar, a third party optimization tool.

I had both db2jcc4.jar and db2jcc4.10.1.jar in my lib folder.

While the article suggests editing the MANIFEST file in db2jcc4.jar, version 10.1 does not include this entry at all.

Removing db2jcc4.jar solved my problem, so a solution in this case could also be to upgrade db2jcc4 from an older version to version 10.1, or if that is not possible, edit the manifest file as instructed.


You Just need to update jar db2jcc4.jar to be db2jcc4-10.1.jar

You can find maven dependency / Jar on that link

Tags:

Java

Jdbc