osgi中的bundle如何更改所依赖bundle的版本号
id State Bundle
0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
9 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
10 ACTIVE javax.servlet_2.5.0.v200806031605
12 ACTIVE org.eclipse.equinox.http.jetty_2.0.0.v20090520-1800
13 ACTIVE org.eclipse.equinox.http.servlet_1.0.200.v20090520-1800
14 ACTIVE org.mortbay.jetty.server_6.1.15.v200905151201
15 ACTIVE org.apache.commons.logging_1.0.4.v200904062259
16 ACTIVE org.mortbay.jetty.util_6.1.15.v200905182336
20 ACTIVE org.eclipse.equinox.ds_1.1.1.R35x_v20090806
21 ACTIVE org.eclipse.equinox.util_1.0.100.v20090520-1800
23 ACTIVE org.springframework.osgi.core_1.2.1
24 ACTIVE org.springframework.osgi.extender_1.2.1
25 ACTIVE org.springframework.osgi.io_1.2.1
26 ACTIVE org.springframework.aop_2.5.6.SEC01
27 ACTIVE com.springsource.org.aopalliance_1.0.0
28 ACTIVE org.springframework.beans_2.5.6.SEC01
29 ACTIVE org.springframework.context_2.5.6.SEC01
30 ACTIVE org.springframework.core_2.5.6.SEC01
31 ACTIVE org.springframework.osgi.web_1.2.1
32 ACTIVE org.springframework.web.servlet_2.5.6.SEC01
33 ACTIVE org.springframework.osgi.catalina.osgi_5.5.23.SNAPSHOT
34 ACTIVE org.springframework.osgi.catalina.start.osgi_1.0.0
35 ACTIVE com.springsource.javax.servlet_2.4.0
36 ACTIVE org.springframework.osgi.web.extender_1.2.1
37 ACTIVE org.springframework.web_2.5.6.SEC01
42 ACTIVE javax.servlet.jsp_2.0.0.v200806031607
46 ACTIVE org.apache.commons.el_1.0.0.v200806031608
47 ACTIVE org.apache.jasper_5.5.17.v200903231320
48 ACTIVE org.springframework.bundle.spring_2.5.6.v201004171400
50 ACTIVE utils_1.0.0
51 INSTALLED Bootstrap_1.0.0
52 INSTALLED org.springframework.jdbc_3.0.1.RELEASE-A
53 INSTALLED org.springframework.transaction_3.0.1.RELEASE-A
osgi> start 52
org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.commons.logging; version="[1.1.1,2.0.0)"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1313)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1297)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:309)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:272)
at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:253)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:303)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:288)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:224)
at java.lang.Thread.run(Thread.java:619)
osgi>
我电脑上的版本为org.apache.commons.logging_1.0.4.v200904062259.jar
在网上找了找,要将org.apache.commons.logging; version="[1.1.1,2.0.0)"
这个版本改为org.apache.commons.logging_1.0.4.v200904062259.jar
不知是不是这样的,有没有其它的办法可解决这个问题?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,你需要的不应该是改版本号,你只要在Eclipse Equinox里装入新版本的 Apache Commons Logging (版本大于1.1.1)就可以了。
另外,我必须提醒你Spring的OSGi项目(Spring DM)已经死了,据说一部分代码会Merge进Equinox,建议你引入Spring。在OSGi规范R4里,专门有IoC的框架规范,名字叫OSGi Blueprint。
开源的实现为Apche Aries http://aries.apache.org/ 我个人喜欢使用Apache Felix + Apache Aries,但我很确信Eclipse Equinox + Apache Aires也没问题。
OSGi的优势就在于有完美且高效的底层框架设计,你在设计你的项目时应当仔细的考虑如何利用这些优势。