Pax-import-bundle 和 Spring DM 包

发布于 2024-08-04 01:00:50 字数 3323 浏览 12 评论 0原文

我正在遵循 Modular Java 中的示例,但我遇到了问题第 6 章并将 Spring DM 模块添加到我的项目中。

我跑:

pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.2 -- -DwidenScope -DimportTransitive

运行 pax-provision 时,Spring DM 捆绑包未解析。我收到关于缺少 spring.osgi.extender 和其他两个未解析包的导入包的投诉。我的预配置包列表如下所示:

0   ACTIVE      org.eclipse.osgi_3.5.0.v20090520
1   ACTIVE      org.eclipse.osgi.util_3.2.0.v20090520-1800
2   ACTIVE      org.eclipse.osgi.services_3.2.0.v20090520-1800
3   ACTIVE      org.ops4j.pax.logging.pax-logging-api_1.3.0
4   ACTIVE      org.ops4j.pax.logging.pax-logging-service_1.3.0
5   INSTALLED   org.springframework.osgi.extender_1.2.0
6   INSTALLED   org.springframework.osgi.core_1.2.0
7   INSTALLED   org.springframework.osgi.io_1.2.0
8   ACTIVE      com.springsource.slf4j.org.apache.commons.logging_1.5.0
9   ACTIVE      com.springsource.slf4j.api_1.5.0
                Fragments=10
10  RESOLVED    com.springsource.slf4j.log4j_1.5.0
                Master=9
11  ACTIVE      com.springsource.org.aopalliance_1.0.0
12  ACTIVE      com.springsource.edu.emory.mathcs.backport_3.1.0
13  ACTIVE      com.springsource.org.apache.log4j_1.2.15
14  ACTIVE      com.springsource.javax.jms_1.1.0
15  ACTIVE      com.springsource.javax.mail_1.4.0
16  ACTIVE      com.springsource.javax.transaction_1.1.0
17  ACTIVE      com.springsource.javax.activation_1.1.0
diag 5

给出以下输出:

initial@reference:file:../bundles/org.springframework.osgi.extender_1.2.0.jar/ [5]
  Direct constraints which are unresolved:
    Missing imported package org.springframework.beans_[2.5.6,4.0.0).
    Missing imported package org.springframework.beans.factory_[2.5.6,4.0.0).
    Missing imported package org.springframework.beans.factory.config_[2.5.6,4.0.0).
    Missing imported package org.springframework.beans.factory.xml_[2.5.6,4.0.0).
    Missing imported package org.springframework.context_[2.5.6,4.0.0).
    Missing imported package org.springframework.context.event_[2.5.6,4.0.0).
    Missing imported package org.springframework.core_[2.5.6,4.0.0).
    Missing imported package org.springframework.core.enums_[2.5.6,4.0.0).
    Missing imported package org.springframework.core.io_[2.5.6,4.0.0).
    Missing imported package org.springframework.core.task_[2.5.6,4.0.0).
    Missing imported package org.springframework.osgi_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.context_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.context.event_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.context.support_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.extensions.annotation_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.service.importer_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.service.importer.event_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.service.importer.support_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.util_[1.2.0,1.2.0].
    Missing imported package org.springframework.scheduling.timer_[2.5.6,4.0.0).
    Missing imported package org.springframework.util_[2.5.6,4.0.0).
    ...

I'm following the examples from Modular Java but I'm having trouble with chapter 6 and adding the Spring DM modules to my project.

I run:

pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.2 -- -DwidenScope -DimportTransitive

When running pax-provision the Spring DM bundles are not resolved. I get complaints about missing imported packages from the spring.osgi.extender and the other two unresolved bundles. My list of provisioned bundles look like this:

0   ACTIVE      org.eclipse.osgi_3.5.0.v20090520
1   ACTIVE      org.eclipse.osgi.util_3.2.0.v20090520-1800
2   ACTIVE      org.eclipse.osgi.services_3.2.0.v20090520-1800
3   ACTIVE      org.ops4j.pax.logging.pax-logging-api_1.3.0
4   ACTIVE      org.ops4j.pax.logging.pax-logging-service_1.3.0
5   INSTALLED   org.springframework.osgi.extender_1.2.0
6   INSTALLED   org.springframework.osgi.core_1.2.0
7   INSTALLED   org.springframework.osgi.io_1.2.0
8   ACTIVE      com.springsource.slf4j.org.apache.commons.logging_1.5.0
9   ACTIVE      com.springsource.slf4j.api_1.5.0
                Fragments=10
10  RESOLVED    com.springsource.slf4j.log4j_1.5.0
                Master=9
11  ACTIVE      com.springsource.org.aopalliance_1.0.0
12  ACTIVE      com.springsource.edu.emory.mathcs.backport_3.1.0
13  ACTIVE      com.springsource.org.apache.log4j_1.2.15
14  ACTIVE      com.springsource.javax.jms_1.1.0
15  ACTIVE      com.springsource.javax.mail_1.4.0
16  ACTIVE      com.springsource.javax.transaction_1.1.0
17  ACTIVE      com.springsource.javax.activation_1.1.0
diag 5

gives the following output:

initial@reference:file:../bundles/org.springframework.osgi.extender_1.2.0.jar/ [5]
  Direct constraints which are unresolved:
    Missing imported package org.springframework.beans_[2.5.6,4.0.0).
    Missing imported package org.springframework.beans.factory_[2.5.6,4.0.0).
    Missing imported package org.springframework.beans.factory.config_[2.5.6,4.0.0).
    Missing imported package org.springframework.beans.factory.xml_[2.5.6,4.0.0).
    Missing imported package org.springframework.context_[2.5.6,4.0.0).
    Missing imported package org.springframework.context.event_[2.5.6,4.0.0).
    Missing imported package org.springframework.core_[2.5.6,4.0.0).
    Missing imported package org.springframework.core.enums_[2.5.6,4.0.0).
    Missing imported package org.springframework.core.io_[2.5.6,4.0.0).
    Missing imported package org.springframework.core.task_[2.5.6,4.0.0).
    Missing imported package org.springframework.osgi_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.context_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.context.event_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.context.support_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.extensions.annotation_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.service.importer_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.service.importer.event_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.service.importer.support_[1.2.0,1.2.0].
    Missing imported package org.springframework.osgi.util_[1.2.0,1.2.0].
    Missing imported package org.springframework.scheduling.timer_[2.5.6,4.0.0).
    Missing imported package org.springframework.util_[2.5.6,4.0.0).
    ...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲影 2024-08-11 01:00:50

问题是缺少存储库和工件版本错误(1.2.0 而不是 1.2)的组合。

pax-add-repository -i springsource-repository-release -u http://repository.springsource.com/maven/bundles/release
pax-add-repository -i springsource-repository-external -u 
http://repository.springsource.com/maven/bundles/external

pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.2 -- -DwidenScope -DimportTransitive

解决了这个问题。

The problem was a combination of missing repositories and wrong version of the artifact (1.2.0 instead of 1.2).

pax-add-repository -i springsource-repository-release -u http://repository.springsource.com/maven/bundles/release
pax-add-repository -i springsource-repository-external -u 
http://repository.springsource.com/maven/bundles/external

pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.2 -- -DwidenScope -DimportTransitive

Fixed the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文