【问题标题】:Exception with Hibernate(4.2.7) JPA in Karaf(3.0) with Aries使用 Aries 的 Karaf(3.0) 中的 Hibernate(4.2.7) JPA 异常
【发布时间】:2014-05-19 16:38:00
【问题描述】:

我正在使用 Karaf 3.0.0、Hibernate 4.2.7.Final、容器管理的 jpa。

持久性捆绑包在启动时进入 GracePeriod 状态,然后进入失败状态。以下是启动捆绑包时来自 Karaf 日志的错误。

2014-04-07 16:46:01,716 |信息 |本地用户 karaf | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 |捆绑ecomm.dao.impl.hibernate正在等待依赖项[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=ecomm))(objectClass=javax.persistence.EntityManagerFactory )), (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=ecomm))(objectClass=javax.persistence.EntityManagerFactory))]

在安装 hibernate 之前,我已经安装了 jpa、transaction 和 jndi 功能。我还没有安装 openjpa 功能。

此外,Aries JPA Container Managed ContextsAries JPA Container 捆绑包都处于活动状态。还注意到Jpa-hibernate error while starting the service

建议没有 EntityManagerFactory 服务

下面是休眠包的快照。

karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
 ID | State       | Lvl | Version            | Name
------------------------------------------------------------------------------------
115 | Active      |  80 | 3.0.0              | Apache Karaf :: JNDI :: Command
121 | Active      |  80 | 0.9.0              | ClassMate
122 | Active      |  80 | 2.7.7.5            | Apache ServiceMix :: Bundles :: antlr
123 | Active      |  80 | 1.8.2.2            | Apache ServiceMix :: Bundles :: ant
124 | Active      |  80 | 1.6.1.5            | Apache ServiceMix :: Bundles :: dom4j
125 | Active      |  80 | 1.14.1.1           | Apache ServiceMix :: Bundles :: serp
126 | Active      |  80 | 3.18.1.GA          | Javassist
127 | Active      |  80 | 1.0.2.Final        | JACC 1.4 API
128 | Active      |  80 | 0                  | wrap_mvn_org.jboss_jandex_1.1.0.Final
129 | Active      |  80 | 3.1.3.GA           | JBoss Logging 3
130 | Active      |  80 | 4.0.4.Final        | hibernate-commons-annotations
135 | Active      |  80 | 4.2.7.Final        | hibernate-core
136 | Active      |  80 | 4.2.7.Final        | hibernate-entitymanager
137 | Active      |  80 | 4.2.7.Final        | hibernate-osgi
138 | Active      |  80 | 1.1.0.201404041646 | Ecomm Store
139 | Active      |  80 | 1.1.0.201404041646 | Ecomm Dao
140 | GracePeriod |  80 | 1.4.0.201404071644 | Ecomm DAO Impl

我的配置中是否缺少某些内容?

谢谢。

【问题讨论】:

    标签: hibernate jpa osgi karaf


    【解决方案1】:

    我为您的其他问题指出了一个可能的解决方案,该解决方案也应适用于此处。见Jpa-hibernate error while starting the service

    无论如何,请确保暂时远离 Hibernate 4.3.x,因为 aries jpa 到目前为止还不支持它。不过 4.2.7 应该可以工作。

    【讨论】:

    • 感谢克里斯蒂安的回复。我会试试你的建议。
    【解决方案2】:

    在更改捆绑包的启动顺序后,该问题现已得到解决。 持久性单元包(在我的例子中是“Ecomm DAO Impl”)必须在 hibernate-osgi 包启动之前启动。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-22
      • 2015-02-09
      • 1970-01-01
      • 2017-08-18
      • 2018-10-19
      • 2020-03-23
      • 1970-01-01
      相关资源
      最近更新 更多