Bundle随机进入GracePeriod

时间:2017-02-27 13:57:42

标签: java jpa osgi blueprint-osgi aries

我有一个持久性捆绑包,大部分时间它完全正常,但每隔一段时间它就会卡在GracePeriod中,当发生这种情况时,缺少的依赖性是EntityManager:< / p>

karaf@root>bundle:diag 237
framework-connect-persistence (237)
 -----------------------------------
Status: GracePeriod
Blueprint
2/27/17 2:48 PM
Missing dependencies:
(&(osgi.unit.name=PersistenceUnitPrimary)(objectClass=javax.persistence.EntityManager))

但是,正如您所看到的,有一个EntityManager

karaf@root>service:list EntityManager
[javax.persistence.EntityManager]
 ---------------------------------
osgi.unit.name = PersistenceUnitPrimary
service.bundleid = 237
service.id = 427
service.scope = singleton
Provided by :
framework-connect-persistence (237)

重新启动捆绑包不会改变任何内容。但是,重新启动软件包org.apache.aries.jpa.blueprint可以解决问题

有什么想法吗?

谢谢

编辑:

bundle:list

feature:list

MANIFEST.MF

logs

的persistence.xml:

<?xml version="1.0" encoding="UTF-8"?><persistence version="2.1"
         xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/                http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">  

<persistence-unit name="ConztanzEntityManagerFactoryPrimary" transaction-type="JTA">            
    <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
    <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=ConztanzDB)</jta-data-source>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>            
        <property name="hibernate.connection.release_mode"   value="auto"/>
        <property name="hibernate.dialect" value="com.conztanz.persistence.dialect.PostgreSQLConztanzDialect"/>n setting -->
        <property name="hibernate.current_session_context_class" value="jta"/>
        <property name="hibernate.transaction.jta.platform"      value="com.conztanz.persistence.jta.ConztanzJtaPlatform"/>
        <property name="hibernate.jdbc.batch_size" value="25"/> 
        <property name="hibernate.order_inserts" value="true"/>
        <property name="hibernate.order_updates" value="true"/>
        <property name="hibernate.show_sql"         value="true"/>
        <property name="hibernate.format_sql"       value="true"/>
        <property name="hibernate.use_sql_comments" value="false"/>
    </properties>
</persistence-unit>

0 个答案:

没有答案