2016-12-13 153 views
1

我嘗試在FUSE中開發簡單的Hibernate集成應用程序,但無法找到我可以遵循的很好的參考文檔。我已經通過關於Hibernate集成的official documentation,但無法正確安裝依賴關係。JBoss Fuse Hibernate集成

我注意到hibernate應該配置在camel-context文件中,但不幸的是當我添加這種配置時,我得到了下面的錯誤。當我嘗試將我的應用程序安裝到Fuse中時。

enter image description here

Error executing command: Error installing bundles: 
    Unable to start bundle mvn:com.activemq.cxf/activemq/1.0.0-SNAPSHOT: Unresolved constraint in bundle DemoActiveMq1 [416]: Unable to resolve 416.0: missing requirement [416.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.orm.hibernate3)(version>=3.0.0)(!(version>=4.0.0))) [caused by: Unable to resolve 415.0: missing requirement [415.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.dao)(version>=3.0.5)(!(version>=3.0.6)))] 

但我檢查沒有版本3.0.5供的org.springframework.dao。根據this post,它僅適用於2.0.8。請解釋一下如何解決這個問題?

以下是我的POM休眠($ {春季版} == 3.0.5.RELEASE)

<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-core</artifactId> 
    <version>${spring-version}</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-context</artifactId> 
    <version>${spring-version}</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-tx</artifactId> 
    <version>${spring-version}</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-aop</artifactId> 
    <version>${spring-version}</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-dao</artifactId> 
    <version>2.0.8</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-orm</artifactId> 
    <version>${spring-version}</version> 
</dependency> 

回答

1

我不使用熔斷器自己相關的依賴關係和可能有一些特別的東西關於它。然而,有一個常見的誤解,重申OSGi如何在你的問題中起作用。它抱怨的org.springframework.dao不是一個神器,而是java包。該包可以由任何工件提供。小小的搜索結果顯示,從版本2.5.x開始,軟件包被移至spring-tx工件。我的猜測是,添加到您的依賴關係和/或將其部署到您的OSGi環境應該解決問題。由於Fuse使用Karaf,您可能可以使用Karaf的功能進行安裝。