2016-12-13 155 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的功能进行安装。