apache-karaf - 卡拉夫想要可选的进口?
问题描述
我正在尝试在 Karaf 中使用 org.eclipse.persistence.moxy 2.7.4。
卡拉夫 4.2.6 说:
Error executing command: Error executing command on bundles:
Error starting bundle 71: Unable to resolve HelloWorld [71](R 71.0): missing requirement [HelloWorld [71](R 71.0)] osgi.wiring.package; (osgi.wiring.package=com.sun.codemodel) Unresolved requirements: [[HelloWorld [71](R 71.0)] osgi.wiring.package; (osgi.wiring.package=com.sun.codemodel)]
我认为这是因为 moxy 的 META-INF 包括:
Manifest-Version: 1.0
Bundle-SymbolicName: org.eclipse.persistence.moxy
Require-Bundle: org.eclipse.persistence.core;bundle-version="2.7.4";visibility:=reexport,org.eclipse.persistence.asm;bundle-version="7.0.0" ;resolution:=optional
Bundle-ManifestVersion: 2
Bundle-Vendor: Eclipse.org - EclipseLink Project
Import-Package: com.sun.xml.bind;resolution:=optional,com.sun.xml.bind.annotation;resolution:=optional,com.sun.xml.bind.api;resolution:=optional,com.sun.xml.bind.api.impl;resolution:=optional,com.sun.codemodel;resolution:=optional;version="[2.2.11,3)"
Bundle-Name: EclipseLink MOXy
Bundle-Version: 2.7.4.v20190115-ad5b7c6b2a
笔记com.sun.codemodel;resolution:=optional;version="[2.2.11,3)
但它说“分辨率:=可选”。那么为什么这是一个未解决的要求,我怎样才能让 karaf 将其视为可选?
解决方案
请注意,在这里,抱怨找不到那个包的不是 moxy,而是你自己的服务。检查您Import-Package
的META-INF/MANIFEST.MF
,如果您使用 maven-bundle-plugin,则可能会通过您的 pom.xml 扫描依赖项,然后在您的Import-Package
子句中推断。
推荐阅读
- reactjs - 反应路由问题重定向
- javascript - innerHTML、innerText 和 textContent 仅返回文本中的第一个单词
- java - 使用 PUT 在 Springboot REST Api 中更新 JSON 日志的问题
- python - 从另一个项目导入时,Django 自定义用户模型元重叠
- r - 根据三个观测值的交集将观测值输入向量的程序
- swift - UICollectionViewCompositionalLayout 中的动态项目计数可能吗?
- eclipse - 在 Intellij 中更新 Kotlin 后在 Eclipse 中运行应用程序时出错
- java - 从 ComboBox 中选择值时如何处理 for 循环的大小变化
- mysql - Laravel mysql if else 条件
- c - 为什么指向结构的指针的指针在以下代码中有效,但在单个指针中无效