【问题标题】:cq5, NoClassDefFoundError for SyndFeedImpl when using it within a OSGi environmentcq5,在 OSGi 环境中使用 SyndFeedImpl 时出现 NoClassDefFoundError
【发布时间】:2013-08-08 08:38:17
【问题描述】:

获取 NoClassDefFoundError:尝试使用 rome 1.0 创建 rss 提要时无法初始化类 com.sun.syndication.feed.synd.SyndFeedImpl。

我尝试了“-Drome.pluginmanager.useloadclass=true”设置,无论是真还是假都没有运气。

为什么 rome 包会成功加载但无法使用,却没有得到 noclassdeffound 的任何原因?

【问题讨论】:

  • 这种情况发生在 SyndFeedImpl 被发现但没有依赖它的时候。 wiki.osgi.org/wiki/… 看着 rome pom,似乎他们将所有依赖项都嵌入到包中(除了 jdom 和 junit)。你有完整的堆栈跟踪吗?
  • jdom osgi 兼容吗?
  • 堆栈跟踪?和设置?信息太少,无法提供答案。

标签: rss osgi noclassdeffounderror aem osgi-bundle


【解决方案1】:

如果使用 Maven Bundle 插件,可以通过在 pom.xml 中添加以下内容来解决这里的问题:

<Import-Package>!com.sun.syndication.*, *</Import-Package>

请看这里:Maven Bundle Plugin

如果您不使用 Maven 构建您的包,或者为您的 OSGi 包添加类似于您的 MANIFEST.MF 文件的内容。

Import-Package: !com.sun.syndication.*, *

我们成功地在一个项目中使用了 OSGi 化版本的 ROME。

【讨论】:

  • 这些都不适合我。最后,我们通过 JSP 创建了 rss 提要,没有使用 Rome。
猜你喜欢
  • 2023-03-18
  • 1970-01-01
  • 2014-07-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-20
  • 1970-01-01
相关资源
最近更新 更多