在 Tomcat 7 中包括 DB2JCC4
我刚刚升级到 Tomcat v7。我试图在我的 java 类需要的库中包含一个 jar 。它是 DB2JCC4.JAR。我用它来访问 IBM 大型机上的 DB2。 这在 Tomcat6 中曾经工作得很好。
当我包含 jar 时,我会收到如下错误:
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....
我尝试将 URIEncoding 放入 Server.XML 中,但这没有帮助。
当我取出 DB2JCC4 jar 文件时,没有出现启动错误。当然,那么我就无法访问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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试更改
$TOMCAT_HOME/conf/catalina.properties
并将DB2JCC4.jar
添加到tomcat.util.scan.DefaultJarScanner.jarsToSkip
属性值。它用于关闭类路径扫描(在 JavaEE 6 规范实现中使用)。Try changing
$TOMCAT_HOME/conf/catalina.properties
and addDB2JCC4.jar
totomcat.util.scan.DefaultJarScanner.jarsToSkip
property value. It is used to turn off classpath scanning (which is used across JavaEE 6 specs implementations).如果您想知道为什么会出现此问题,而不仅仅是解决方法,您可以找到答案 这里。 IBM 已承认该问题并提供了解决该问题的选项。本质上,一些类文件已损坏。
If you were wondering why the issue is happening in the first place and not just a workaround you can find the answer here. IBM has acknowledged the issue and has provided options for fixing it. Essentially a few of the class files are corrupt.