org.osgi.framework.BundleException:无法解析模块:org.eclipse.jetty.plus

时间:2019-02-25 05:47:26

标签: java osgi osgi-bundle osgi-fragment

从Karaf缓存日志中,当我在karaf中部署捆绑软件时,我多次收到以下错误消息

!ENTRY org.eclipse.jetty.jndi 4 0 2019-02-21 16:27:11.500
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jetty.jndi [77]
  Unresolved requirement: Import-Package: javax.mail; version="[1.4.0,2.0.0)"

    at org.eclipse.osgi.container.Module.start(Module.java:444)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

1 个答案:

答案 0 :(得分:1)

捆绑软件org.eclipse.jetty.jndi依赖于javax.mail; version="[1.4.0,2.0.0)"。出现此错误的原因有两个。

  1. 捆绑软件中没有一个导出javax.mail,或者主机未将软件包javax.mail添加为SYSTEM_PACKAGE。
  2. 主机已将javax.mail添加为SYSTEM_PACKAGE,但是版本可能不在1.4.0和2.0.0之间。

P.S:主持人是Equinox