Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including DB2JCC4 in Tomcat 7

Tags:

tomcat7

db2

I have just upgraded to Tomcat v7. I am trying to include a jar in the lib that my java classes need. It is DB2JCC4.JAR. I use this to access DB2 on an IBM mainframe. This used to work fine in Tomcat6.

When I include the jar, then I get errors such as:


    Deploying web application directory C:\tomcat7\webapps\dbs
    org.apache.catalina.core.ContainerBase addChildInternal
    SEVERE: ContainerBase.addChild: start: 
    org.apache.catalina.LifecycleException: Failed to start component
    .....

    caused by: org.apache.tomcat.util.bcel.classfile.ClassFormatException: null is 
    not a Java .class file....

I have tried putting URIEncoding in the Server.XML but that does not help.

When I take out the DB2JCC4 jar file, I do not get startup errors. Of course, then I cannot access DB2! I appreciate any suggestions.

like image 480
TomcatUser Avatar asked Dec 31 '11 01:12

TomcatUser


1 Answers

Try changing $TOMCAT_HOME/conf/catalina.properties and add DB2JCC4.jar to tomcat.util.scan.DefaultJarScanner.jarsToSkip property value. It is used to turn off classpath scanning (which is used across JavaEE 6 specs implementations).

like image 66
Grzegorz Grzybek Avatar answered Oct 29 '22 00:10

Grzegorz Grzybek