Овен JPA - Приложение не запускается - Ожидание PersistenceFactory - Нет PersistenceContextProvider
Мы используем Предохранитель 6.1. Мы пытаемся использовать Aries JPA с Hibernate с планом. Я не могу получить Entity Manager. Вот моя конфигурация
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
<persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
<property name="hibernate.archive.autodetection" value="class, hbm"/>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@host:port:SID</property>
<property name="hibernate.connection.username">user</property>
</properties>
</persistence-unit>
</persistence>
Blueprint.xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
http://aries.apache.org/xmlns/jpa/v1.0.0 http://aries.apache.org/schemas/jpa/jpa.xsd
http://aries.apache.org/xmlns/transactions/v1.0.0 http://aries.apache.org/schemas/transaction/transactionv10.xsd">
<bean id="referenceDao"
class="com.common.reference.dao.impl.ReferenceDAOImpl">
<jpa:context unitname="default" property="entityManager" />
</bean>
</blueprint>
Feature.xml
<?xml version="1.0" encoding="UTF-8"?>
<features name="common-1.0.0">
<feature name="common" version="1.0.0">
<feature>transaction</feature>
<feature>jpa</feature>
<feature version="3.2.9.RELEASE_1">spring-orm</feature>
<bundle start-level="30" dependency="true">mvn:org.apache.aries.transaction/org.apache.aries.transaction.manager/1.0.0</bundle>
<bundle start-level="30" dependency="true">mvn:org.apache.aries.jpa/org.apache.aries.jpa.api/1.0.1</bundle>
<bundle start-level="30" dependency="true">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/1.0.1</bundle>
<bundle start-level="30" dependency="true">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container.context/1.0.1</bundle>
<bundle start-level="30" dependency="true">mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1</bundle>
<bundle dependency="true">mvn:com.fasterxml/classmate/0.9.0</bundle>
<bundle dependency="true">mvn:org.javassist/javassist/3.18.1-GA</bundle>
<bundle dependency="true">mvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.4_spec/1.0.2.Final</bundle>
<bundle dependency="true">wrap:mvn:org.jboss/jandex/1.1.0.Final</bundle>
<bundle dependency="true">mvn:org.jboss.logging/jboss-logging/3.1.4.GA</bundle>
<bundle dependency="true">mvn:org.hibernate.common/hibernate-commons-annotations/4.0.5.Final</bundle>
<bundle start-level="100" >mvn:org.hibernate/hibernate-core/4.3.6.Final</bundle>
<bundle start-level="100">mvn:org.hibernate/hibernate-entitymanager/4.3.6.Final</bundle>
<bundle start-level="100">mvn:myapplication/common/1.0.0</bundle>
<bundle start-level="100">mvn:org.hibernate/hibernate-osgi/4.3.6.Final</bundle>
</feature>
</features>
Ниже приведены характеристики / комплекты, применяемые в профиле, который применяется к контейнеру с предохранителями
fabric-agent
fabric-maven-proxy
myapp-support/1.0.0
spring-tx/3.2.9.RELEASE_1
jpa/1.0.1.redhat-610379
jndi/1.0.0
myapp/1.0.0
transaction/1.0.1.redhat-610379
spring/3.2.9.RELEASE_1
spring-orm/3.2.9.RELEASE_1
ojdbc14/10.2.0.3.0
fabric-agent-commands
spring-jdbc/3.2.9.RELEASE_1
common/1.0.0
Сообщение об ошибке:
Common bundle /1.0.0 является клиентом модуля персистентности по умолчанию со свойствами {org.apache.aries.jpa.context.type=TRANSACTION}, но во время выполнения недоступность PersistenceContextProvider. Чертеж для этого пакета не будет запускаться правильно, если контекст управляемой персистентности не зарегистрирован через какой-либо другой механизм.
Распространенный пакет ожидает зависимости [(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=default))(objectClass=javax.persistence.EntityManagerFactory))] 2015-02-19 18:04:44,955 | ОШИБКА | Rint Extender: 2 | BlueprintContainerImpl | ntainer.BlueprintContainerImpl$1 336 | 9 - org.apache.aries.blueprint.core - 1.0.1.redhat-610379 | Невозможно запустить контейнер чертежа для общего пакета из-за неразрешенных зависимостей [(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=default))(objectClass=javax.persistence.EntityManagerFactory))] java.util.concurrent.TimeoutException at org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:332)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] в java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_75] в java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_75] в Java. util.concurrent..util.concurre nt.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145) [: 1.7.0_75] в java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:615) [: 1.7.0_75] в java.lang. пробег (Thread.java:745)[:1.7.0_75]