首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我不能使用aries jpa/v2.0.0和transactions/v2.0.0

我不能使用aries jpa/v2.0.0和transactions/v2.0.0
EN

Stack Overflow用户
提问于 2016-03-05 15:12:08
回答 1查看 1.1K关注 0票数 1

我尝试了enable和int blueprint.xml,但是出错了。它是我的xml文件

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:jpa="http://aries.apache.org/xmlns/jpa/v2.0.0"
           xmlns:tx="http://aries.apache.org/xmlns/transactions/v2.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
           http://aries.apache.org/xmlns/jpa/v2.0.0
           http://aries.apache.org/xmlns/transactions/v2.0.0 ">
    <jpa:enable/>
    <tx:enable-annotations/>
    <service ref="userService" interface="domain.access.UserService"/>
    <bean id="userService" class="domain.access.impl.UserServiceImpl" scope="singleton">
    </bean>
</blueprint>

这是我在pom.xml中的依赖项,我包含了所有的库,可能我忘记了一些东西

代码语言:javascript
复制
<dependencies>
           <dependency>
               <groupId>sqljdbc41</groupId>
               <artifactId>sqljdbc41</artifactId>
               <version>4.1</version>
           </dependency>
           <dependency>
               <groupId>org.apache.servicemix.bundles</groupId>
               <artifactId>org.apache.servicemix.bundles.commons-dbcp</artifactId>
               <version>1.4_3</version>
           </dependency>
           <dependency>
               <groupId>org.apache.geronimo.specs</groupId>
               <artifactId>geronimo-jpa_2.0_spec</artifactId>
               <version>1.1</version>
           </dependency>
           <dependency>
               <groupId>org.apache.geronimo.specs</groupId>
               <artifactId>geronimo-validation_1.0_spec</artifactId>
               <version>1.1</version>
           </dependency>
           <dependency>
               <groupId>org.apache.geronimo.specs</groupId>
               <artifactId>geronimo-jta_1.1_spec</artifactId>
               <version>1.1.1</version>
           </dependency>
           <dependency>
               <groupId>org.apache.openjpa</groupId>
               <artifactId>openjpa</artifactId>
               <version>2.4.1</version>
           </dependency>
           <dependency>
               <groupId>kg.nurtelecom</groupId>
               <artifactId>access-module-api</artifactId>
               <version>1.0.0</version>
           </dependency>
           <dependency>
               <groupId>domain</groupId>
               <artifactId>platform-common</artifactId>
               <version>1.0.0</version>
           </dependency>
           <dependency>
               <groupId>javax.transaction</groupId>
               <artifactId>javax.transaction-api</artifactId>
               <version>1.2</version>
           </dependency>
       </dependencies>

当我启动捆绑包时,我有宽限期和日志

代码语言:javascript
复制
2016-03-05 12:34:37,732 | INFO  | l for user karaf | BlueprintContainerImpl           | 15 - org.apache.aries.blueprint.core - 1.4.4 | Bundle kg.nurtelecom.access.module.impl/1.0.0 is waiting for name
space handlers [http://aries.apache.org/xmlns/jpa/v2.0.0, http://aries.apache.org/xmlns/transactions/v2.0.0]
EN

回答 1

Stack Overflow用户

发布于 2016-03-05 16:01:31

在transaction 2.0.0名称空间中,xml元素被命名为<tx:enable/>,而不是<tx:enable-annotations/>。但这与您所描述的错误无关。

错误提示您没有安装正确的Aries JPA包。确保安装了所有必要的功能,就像在this example中一样。

pom中的依赖项仅涵盖构建时间。在运行时,您必须将依赖项作为karaf功能或单独的bundle提供。

还要确保您使用的是最新的Apache Karaf。较早的版本不包括aries transaction 2.0.0捆绑包。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35811260

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档