在 Tomcat 7 中包括 DB2JCC4

发布于 2024-12-23 16:34:16 字数 652 浏览 5 评论 0原文

我刚刚升级到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

虐人心 2024-12-30 16:34:16

尝试更改 $TOMCAT_HOME/conf/catalina.properties 并将 DB2JCC4.jar 添加到 tomcat.util.scan.DefaultJarScanner.jarsToSkip 属性值。它用于关闭类路径扫描(在 JavaEE 6 规范实现中使用)。

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).

探春 2024-12-30 16:34:16

如果您想知道为什么会出现此问题,而不仅仅是解决方法,您可以找到答案 这里。 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文