尝试在karaf中安装功能的依赖性问题

时间:2014-07-30 11:40:01

标签: dependency-management apache-karaf

我花了最近两天的时间尝试解决依赖问题,以便在karaf中安装一项功能。 Karaf版本:2.3.5,这里是我如何设置karaf:

创建jpa-hibernate.xml文件,例如在/ tmp:

<?xml version="1.0" encoding="UTF-8"?>
<features>
<feature name="jpa-hibernate" version="4.3.0-fuse-01-00">
    <bundle>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.java-persistence-api-1.1.1/1.5.0</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.2.2_5</bundle>
    <bundle>mvn:org.springframework/spring-jdbc/3.0.6.RELEASE</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_2</bundle>
    <bundle>mvn:org.antlr/com.springsource.antlr/2.7.7</bundle>
    <bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/1.5.3</bundle>
    <bundle>mvn:net.sourceforge.cglib/com.springsource.net.sf.cglib/2.2.0</bundle>
    <bundle>mvn:org.jboss.javassist/com.springsource.javassist/3.9.0.GA</bundle>
    <bundle>mvn:org.hibernate/com.springsource.org.hibernate.annotations.common/3.3.0.ga</bundle>
    <bundle>mvn:org.hibernate/com.springsource.org.hibernate.annotations/3.4.0.GA</bundle>
    <bundle>mvn:org.hibernate/com.springsource.org.hibernate.ejb/3.4.0.GA</bundle>
    <bundle>mvn:org.hibernate/com.springsource.org.hibernate/3.3.2.GA</bundle>
    <bundle>mvn:org.springframework/spring-orm/3.0.6.RELEASE</bundle>
</feature>
</features>

然后在客户端中,我安装了一些功能和捆绑包:

features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.8.3/xml/features
features:addurl mvn:org.apache.servicemix/apache-servicemix/4.4.0/xml/features
features:install cxf
features:install nmr
features:install camel
features:install camel-nmr
features:install camel-quartz
features:install camel-ftp
osgi:install -s wrap:mvn:org.apache.derby/derby/10.8.2.2
osgi:install -s wrap:mvn:mysql/mysql-connector-java/5.1.18
features:addurl file:///tmp/jpa-hibernate.xml
features:install jpa-hibernate

然而,当我运行它时,我得到一个似乎与不可解析的依赖关系相关的错误。在第一次运行中,我得到了:

Error executing command: Could not start bundle mvn:org.springframework/spring-jdbc/3.0.6.RELEASE in feature(s) jpa-hibernate-4.3.0-fuse-01-00, spring-jdbc-3.0.6.RELEASE: Unresolved constraint in bundle org.springframework.jdbc [259]: Unable to resolve 259.0: missing requirement [259.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.beans)(version>=3.0.6)(!(version>=3.0.7))) 

我认为这是由于org.springframework.beans无法使用。我认为maven会解决这个问题。无论如何,我手动安装这个包:

> osgi:install mvn:org.springframework/spring-beans/3.0.6.RELEASE
> features:install jpa-hibernate
Error executing command: Could not start bundle mvn:org.springframework/spring-jdbc/3.0.6.RELEASE in feature(s) jpa-hibernate-4.3.0-fuse-01-00, spring-jdbc-3.0.6.RELEASE: Unresolved constraint in bundle org.springframework.jdbc [307]: Unable to resolve 307.0: missing requirement [307.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.beans)(version>=3.0.6)(!(version>=3.0.7))) [caused by: Unable to resolve 304.0: missing requirement [304.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.core)(version>=3.0.6)(!(version>=3.0.7)))]
> osgi:install mvn:org.springframework/spring-core/3.0.6.RELEASE
> features:install jpa-hibernate
Error executing command: Could not start bundle mvn:org.springframework/spring-jdbc/3.0.6.RELEASE in feature(s) jpa-hibernate-4.3.0-fuse-01-00, spring-jdbc-3.0.6.RELEASE: Unresolved constraint in bundle org.springframework.jdbc [321]: Unable to resolve 321.0: missing requirement [321.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.context)(version>=3.0.6)(!(version>=3.0.7)))                           
> osgi:install mvn:org.springframework/spring-context/3.0.6.RELEASE
Bundle ID: 332
> features:install jpa-hibernate
Error executing command: Could not start bundle mvn:org.springframework/spring-jdbc/3.0.6.RELEASE in feature(s) jpa-hibernate-4.3.0-fuse-01-00, spring-jdbc-3.0.6.RELEASE: Unresolved constraint in bundle org.springframework.jdbc [335]: Unable to resolve 335.0: missing requirement [335.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.dao)(version>=3.0.6)(!(version>=3.0.7)))

我无法超越这个。我觉得很奇怪,因为当我检查dependencies of spring-jdbc spring-dao时没有列出。另外,没有spring-dao-3.0.6.RELEASE来手动安装,这将解决这个问题。

我该如何解决这个问题?

0 个答案:

没有答案