简体   繁体   English

如何选择要在OSGI捆绑包中使用的库版本

[英]How to select version of library to use in OSGI bundle

I develop jira plugin, where I should send email with images. 我开发了jira插件,应该在其中发送包含图片的电子邮件。 There is one bug with javax.mail-1.4.5, that was fixed in javax.mail-1.4.7 I tried a lot, but was not able when plugin deployed on jira tell to use my version of javax.mail (1.4.7). javax.mail-1.4.5中存在一个错误,该错误已在javax.mail-1.4.7中修复,我尝试了很多,但是当部署在jira上的插件告知使用我的javax.mail版本时(1.4。 7)。 It all the time use javax.mail-1.4.5 from root class loader. 一直使用根类加载器中的javax.mail-1.4.5。 I all the time recieve next Exception: 我一直都收到下一个异常:

java.lang.LinkageError: loader constraint violation: when resolving overridden method "javax.mail.internet.MimeMessage.getDataHandler()Ljavax/activation/DataHandler;" the class loader (instance of org/apache/felix/framework/ModuleImpl$ModuleClassLoader) of the current class, javax/mail/internet/MimeMessage, and its superclass loader (instance of org/apache/catalina/loader/WebappClassLoader), have different Class objects for the type getDataHandler used in the signature
    at com.solarwinds.MailSenderJob.buildSimpleMessage(MailSenderJob.java:163)

My question is next: how to tell OSGi, that here I would like to use another version of library? 接下来的问题是:如何告诉OSGi,我想在这里使用其他版本的库?

Add the specific library to the class path of your project. 将特定的库添加到您的项目的类路径。 Or if you're using Maven, simply edit the pom.xml file. 或者,如果您使用的是Maven,则只需编辑pom.xml文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM