如何在XPages中使用JavaMail的更新版本? [英] How can I use an updated version of JavaMail in XPages?
问题描述
我有一个XPage应用程序,在其中一个托管bean中使用JavaMail.目前,我已将jar文件C:\Programme\IBM\Notes\framework\shared\eclipse\plugins\com.ibm.designer.lib.javamail_9.0.0.20130301-1431\lib\mail.jar
添加到被管理的bean的构建路径中.这很好.但是现在我想使用JavaMail的较新版本,因为Domino服务器使用1.3版,但是我需要1.4.x版.
我已经从Oracle下载了新的JavaMail jar文件.在Domino Designer(版本9)中,我将此jar文件添加到新的设计元素"Code/Jars"中,并从构建路径中删除旧的jar文件.
我的托管Bean仍可以根据需要进行编译和运行,但是如果我检查Bean所使用的版本,则仍报告1.3版.要检查版本号,我使用JavaMail的debug属性,并将其1.3版报告给Domino服务器控制台.
有没有办法告诉Domino服务器在应用程序(即nsf)中使用jar文件而不是他自己的文件?还有另一种更新JavaMail版本的方法吗?
I have a XPage application where I use JavaMail in one of my managed beans. Currently I have added the jar-file C:\Programme\IBM\Notes\framework\shared\eclipse\plugins\com.ibm.designer.lib.javamail_9.0.0.20130301-1431\lib\mail.jar
to the build-path of the manged bean. This works well. But now I want to use a newer version of JavaMail as the Domino server uses version 1.3 but I need version 1.4.x.
I have downloaded the new JavaMail jar-files from Oracle. In Domino Designer (version 9) I add this jar-file to the new design element "Code / Jars" and remove the old jar-files from the build path.
My managed bean is still compiling and running as desired, but if I check the version the bean is using it reports still version 1.3. To check the version number I use the debug property of JavaMail and it's reporting version 1.3 to the domino server console.
Is there a way to tell the domino server to use the jar-files in the application (i.e. the nsf) and not his own? Is there another approach to update the JavaMail version?
我要使用JavaMail的较新版本的原因如下:我想从使用ssl的imap服务器读取邮件.为了避免导入ssl证书的问题,我只想信任所有主机.可以通过MailSSLSocketFactory完成此操作,但是仅从1.4.2版开始可用.因此,我想使用JavaMail的较新版本.
The reason I want to use a newer version of JavaMail is as follows: I want to read mails from an imap server with ssl. To avoid the problem of importing ssl-certificates I simply want to trust all hosts. This can be be done via MailSSLSocketFactory, but this is only available since version 1.4.2. Therefore I want to use a newer version of JavaMail.
我要使用较新版本的另一个原因如下:"IMAPFolder"的方法"getSortedMessages"仅从1.4.4版本开始可用. (还有JavaMail的其他一些功能).
Another reason I want to use a newer version is as follows: the method "getSortedMessages" of "IMAPFolder" is only available since version 1.4.4. (and so are some other features of JavaMail).
推荐答案
您可以通过创建一个OSGi插件来解决该问题,该插件可以代替JavaMail库: com.ibm.designer.lib. javamail . 为此,请执行以下操作:
You can solve the problem by creating an OSGi plug-in that supersedes the one that sports the JavaMail library: com.ibm.designer.lib.javamail. In order to do that do the following:
- Create an OSGi plugin whose id is com.ibm.designer.lib.javamail (Dalsgaard's tutorial on how to do it)
- Set its version to a higher number than the one the Domino server is shipped with (to know the version type tell http osgi ss com.ibm.designer.lib.javamail). As of now using 9.0.1.qualifier should be fine
- Deploy the plugin either through an update site or by directly copying it under the domino\workspace\applications\eclipse\plugins folder.
- Restart the HTTP service. The higher version - the one you created - will now be used
这篇关于如何在XPages中使用JavaMail的更新版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!