Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

jdbc

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>
like image 831
J E Carter II Avatar asked Sep 22 '17 15:09

J E Carter II


1 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>
like image 98
Kayvan Tehrani Avatar answered Sep 22 '22 11:09

Kayvan Tehrani