通过POM条目运行应用程序时如何避免bcprov-jdk16-1.45.jar [英] How to avoid bcprov-jdk16-1.45.jar while running the application through POM entry

查看:739
本文介绍了通过POM条目运行应用程序时如何避免bcprov-jdk16-1.45.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Weblogic 12.1.3中运行的Java 8应用程序.该应用程序使用iText 5.5.9,所需的BC最低版本为1.49.该应用程序将作为WAR文件部署在Weblogic中.我可以看到战争档案具有正确的BC版本.但是在运行时,它取自WebLogic maven插件路径并使用BC 1.45.有什么方法可以通过编辑POM条目或通过编辑WebLogic.xml来避免这种情况.如果我从本地服务器上删除BC 1.45 jar,则其运行成功.但是我无法从更高环境的服务器中删除jar.所以请帮忙.谢谢.

I have a Java 8 application running in Weblogic 12.1.3. The application uses iText 5.5.9 and minimum version of BC required is 1.49 . The application is deploying as a WAR file in Weblogic . I could see the war file is having the proper version of BC . But during run time its taking from WebLogic maven plugin path and using BC 1.45. Is there any way we can avoid this by editing POM entry or by editing WebLogic.xml . If i remove BC 1.45 jar from my local server its running successfully. But i cannot remove the jar from higher environment server . So Please help. Thanks.

推荐答案

这是一个已知问题. BC中断了它们的API之间的版本,并且当CLASSPATH中有两个不同的BC版本时,您会得到非常奇怪的错误(根据首先加载的版本可能有所不同).我发现您仍在使用旧的iText(不是iText 7),这意味着您可以切换到iTextG.

This is a known problem. BC broke their API in-between versions, and when you have two different BC versions in your CLASSPATH, you can get very strange errors (which might differ depending on which version was loaded first). I see that you're still using the old iText (not iText 7), which means you can switch to iTextG.

iTextG中的G代表Google,而iTextG的创建是为了避免某些问题.例如:

The G in iTextG stands for Google, and iTextG was created to avoid some problems. For instance:

  • 未列入供GAE或Android使用的白名单的Java类已删除,
  • 调整了在云环境中没有意义的特定文件操作,
  • Bouncycastle被SpongyCastle取代了.

BouncyCastle和SpongyCastle相同,除了它们的软件包名称和安全提供程序的名称("BC"与"SC").由于存在这些差异,所以两个不同的版本(例如WebLogic中的BC 1.45版和iTextG应用程序中的SpongyCastle 1.49版)不会发生冲突.

BouncyCastle and SpongyCastle are identical, except for their package names and the name of the security provider ("BC" versus "SC"). Because of these differences, two different versions, such as version 1.45 of BC in WebLogic and version 1.49 of SpongyCastle in your iTextG application won't clash.

这对于在Android上使用iText是必要的,因为Android附带了旧版本的BC(就像您的WebLogic附带了旧版本一样).

This was necessary for use of iText on Android, because Android shipped with an old version of BC (just like your WebLogic ships with an old version).

这篇关于通过POM条目运行应用程序时如何避免bcprov-jdk16-1.45.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆