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

Viewed 16282

When adding db2jcc4.jar to the system class path, Tomcat 8.0 raises a FileNotFoundException on a jar file that has no apparent reference to my project, pdq.jar.

I couldn't find it anywhere on my system or where it might come from, except through a search which turned up the answer below.

In this case, I have my CATALINA_HOME pointed to C:\tomcat8.0\apache-tomcat-8.0.41 and my project has the following maven dependency defined:

<dependency>
        <groupId>com.ibm.db2.jcc</groupId>
        <artifactId>db2jcc4</artifactId>
        <version>10.1</version>
        <scope>system</scope>
        <systemPath>${env.CATALINA_HOME}/lib/db2jcc4-10.1.jar</systemPath>
</dependency>
4 Answers

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

Kayvan Tehrani's answer explains what's going on here and that this error can be ignored.

Another alternative to clean up the logs is to create a dummy pdq.jar and place it into tomcat's lib folder.

jar -cf pdq.jar ""

(The ": no such file or directory" message from this command is expected.)

Related