簡體   English   中英

如何選擇要在OSGI捆綁包中使用的庫版本

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

我開發了jira插件,應該在其中發送包含圖片的電子郵件。 javax.mail-1.4.5中存在一個錯誤,該錯誤已在javax.mail-1.4.7中修復,我嘗試了很多,但是當部署在jira上的插件告知使用我的javax.mail版本時(1.4。 7)。 一直使用根類加載器中的javax.mail-1.4.5。 我一直都收到下一個異常:

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)

接下來的問題是:如何告訴OSGi,我想在這里使用其他版本的庫?

將特定的庫添加到您的項目的類路徑。 或者,如果您使用的是Maven,則只需編輯pom.xml文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM