Интеграция JPA/Hibernate в Apache Felix

Вопрос:

Привет, я запускаю экземпляр Apache Felix, встроенный в tomcat. Мне нужна интеграция JPA (Hibernate 4.2.7), но я получаю это исключение при создании EntityManagerFactory. Для записи, если я переключаюсь на OpenJPA, все работает нормально, но это решение недопустимо

У меня два пакета:

dbconnection-ds: blueprint.xml

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0"
xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.1.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">


<!-- BASIC CONFIGURATION -->
<bean id="dataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource">
<property name="url" value="jdbc:mysql://127.0.0.1:3306/test"/>
<property name="user" value="root"/>
<property name="password" value=""/>
</bean>

<service interface="javax.sql.XADataSource" ref="dataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/test"/>
</service-properties>
</service>

</blueprint>

dbconnection: blueprint.xml

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0"
xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.1.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">


<bean id="dbService" class="examples.DBService">
<jpa:context property="em" unitname="testPU" />
<tx:transaction method="*" value="Required"/>
</bean>

<service ref="dbService" interface="examples.IDBService" >
<service-properties>
<entry key  ="osgi.jndi.service.name"
value="hibernate/dbService"/>
</service-properties>
</service>

</blueprint>

dbconnection: perisitence.xml

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0">

<persistence-unit name="testPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>osgi:service/javax.sql.XADataSource/(osgi.jndi.service.name=jdbc/test)</jta-data-source>
<properties>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://127.0.0.1:3306/test" />
</properties>
</persistence-unit>

</persistence>

Вот это мой стек

 INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.felix.framework.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jndi.url.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.hibernate.osgi.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: classmate.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.felix.fileinstall.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jpa.blueprint.aries.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.servicemix.bundles.serp.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.proxy.impl.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.geronimo.specs.geronimo-jta_1.1_spec.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: null.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: com.fasterxml.jackson.core.jackson-databind.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.blueprint.api.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.karaf.jndi.core.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.felix.shell.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.servicemix.bundles.antlr.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jpa.container.context.
INFO  | main             | o.a.a.j.c.context                |  -  -  | No quiesce support is available, so managed persistence units will not participate in quiesce operations.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.hibernate.common.hibernate-commons-annotations.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.felix.shell.remote.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.util.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.jboss.spec.javax.security.jacc.jboss-jacc-api_1.4_spec.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.blueprint.core.
INFO  | main             | o.a.a.b.c.BlueprintExtender      |  -  -  | No quiesce support is available, so blueprint components will not participate in quiesce operations
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: com.fasterxml.jackson.core.jackson-core.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.geronimo.specs.geronimo-jpa_2.0_spec.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: javassist.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: com.springsource.org.apache.catalina.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jndi.api.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.felix.configadmin.
DEBUG | rint Extender: 1 | o.a.a.j.b.aries                  |  -  -  | Managed persistence context support is now available for use with the Aries Blueprint container
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jndi.legacy.support.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jndi.rmi.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.felix.log.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.jboss.logging.jboss-logging.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.blueprint.cm.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.proxy.api.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.proxy.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.transaction.blueprint.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.servicemix.bundles.dom4j.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.xbean.naming.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.servicemix.bundles.ant.
INFO  | rint Extender: 1 | o.a.a.b.c.BlueprintContainerImpl |  -  -  | Bundle org.apache.aries.transaction.blueprint is waiting for dependencies [(objectClass=javax.transaction.TransactionManager)]
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jpa.api.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: com.fasterxml.jackson.core.jackson-annotations.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.transaction.manager.
INFO  | main             | o.a.a.j.c.context                |  -  -  | A TransactionSynchronizationRegistry service is now available in the runtime. Managed persistence contexts will now integrate with JTA transactions using [org.apache.aries.transaction.AriesTransactionManager, javax.transaction.TransactionManager, javax.transaction.TransactionSynchronizationRegistry, javax.transaction.UserTransaction, org.apache.geronimo.transaction.manager.RecoverableTransactionManager].
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.hibernate.core.
WARN  | es.transaction]) | o.a.a.j.c.context                |  -  -  | The TransactionSynchronizationRegistry used to manage persistence contexts is no longer available. Managed persistence contexts will no longer be able to integrate with JTA transactions, and will behave as if  no there is no transaction context at all times until a new TransactionSynchronizationRegistry is available. Applications using managed persistence contexts may not work correctly until a new JTA Transaction services implementation is available.
INFO  | es.transaction]) | o.a.a.j.c.context                |  -  -  | A TransactionSynchronizationRegistry service is now available in the runtime. Managed persistence contexts will now integrate with JTA transactions using [org.apache.aries.transaction.AriesTransactionManager, javax.transaction.TransactionManager, javax.transaction.TransactionSynchronizationRegistry, javax.transaction.UserTransaction, org.apache.geronimo.transaction.manager.RecoverableTransactionManager].
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jndi.core.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.hibernate.entitymanager.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | Starting bundle: org.apache.aries.jpa.container.
INFO  | main             | o.a.a.j.container                |  -  -  | The file org.apache.aries.jpa.container.properties was not found in bundle org.apache.aries.jpa.container/1.0.1.SNAPSHOT. The default properties {} will be used.
DEBUG | main             | o.a.a.j.container                |  -  -  | Adding a provider: [javax.persistence.spi.PersistenceProvider]
INFO  | main             | o.a.a.j.container                |  -  -  | No quiesce support is available, so managed persistence units will not participate in quiesce operations.
INFO  | main             | e.u.n.c.s.d.ProvisionActivator   |  -  -  | System bundles installed.
INFO  | Thread-4         | o.a.f.fileinstall                |  -  -  | Installing bundle db-connection / 1.0.0.SNAPSHOT
DEBUG | a\ucg\components | o.a.a.j.container                |  -  -  | Located Persistence descriptors: [META-INF/persistence.xml] db-connection_1.0.0.
DEBUG | a\ucg\components | o.a.a.j.container                |  -  -  | Located Persistence units: [Persistence unit testPU in bundle db-connection_1.0.0.
INFO  | Thread-4         | e.u.n.c.e.db-connection          |  -  -  | BundleEvent INSTALLED
org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.2.7.Final}
org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
org.hibernate.ejb.Ejb3Configuration configure
INFO: HHH000204: Processing PersistenceUnitInfo [
name: testPU
...]
org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator instantiateExplicitConnectionProvider
INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
INFO  | main             | .w.s.h.BeanNameUrlHandlerMapping |  -  -  | Mapped URL path [/errors/*] onto handler '/errors/*'
INFO  | main             | o.s.b.f.c.PropertiesFactoryBean  |  -  -  | Loading properties file from class path resource [request-dispatcher.properties]
WARN  | a\ucg\components | o.a.a.j.container                |  -  -  | Error creating EntityManagerFactory
java.lang.IllegalStateException: The bundle db-connection/1.0.0.SNAPSHOT is not started.
at org.apache.aries.jpa.container.unit.impl.JndiDataSource.getDs(JndiDataSource.java:62) ~[org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource.getConnection(DelayedLookupDataSource.java:36) ~[org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:70) ~[na:na]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:242) ~[na:na]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:117) ~[na:na]
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:76) ~[na:na]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:160) ~[na:na]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:132) ~[na:na]
at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1822) ~[na:na]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1780) ~[na:na]
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96) ~[na:na]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914) ~[na:na]
at org.hibernate.osgi.OsgiPersistenceProvider.createContainerEntityManagerFactory(OsgiPersistenceProvider.java:99) ~[na:na]
at org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.createEntityManagerFactories(EntityManagerFactoryManager.java:331) [org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.bundleStateChange(EntityManagerFactoryManager.java:175) [org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.apache.aries.jpa.container.impl.PersistenceBundleManager.modifiedBundle(PersistenceBundleManager.java:300) [org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:479) [org.apache.felix.framework-4.4.0.jar:na]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:414) [org.apache.felix.framework-4.4.0.jar:na]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [org.apache.felix.framework-4.4.0.jar:na]
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:869) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:790) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:515) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4409) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.StatefulResolver.fireResolvedEvents(StatefulResolver.java:1126) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:439) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3973) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2043) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1245) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1217) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:509) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
INFO  | Thread-4         | e.u.n.c.e.db-connection          | -  -  | BundleEvent RESOLVED
org.hibernate.ejb.Ejb3Configuration configure
INFO: HHH000204: Processing PersistenceUnitInfo [
name: testPU
...]
org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator instantiateExplicitConnectionProvider
INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
ERROR | a\ucg\components | o.a.a.j.container                | -  -  | The DataSource osgi:service/javax.sql.XADataSource/(osgi.jndi.service.name=jdbc/test) required by bundle db-connection/1.0.0.SNAPSHOT could not be found.
javax.naming.NoInitialContextException: Unable to find the InitialContextFactory org.apache.naming.java.javaURLContextFactory.
at org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHelper.java:150) ~[na:na]
at org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:49) ~[na:na]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684) ~[na:1.7.0_60]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307) ~[na:1.7.0_60]
at javax.naming.InitialContext.init(InitialContext.java:242) ~[na:1.7.0_60]
at javax.naming.InitialContext.<init>(InitialContext.java:216) ~[na:1.7.0_60]
at org.apache.aries.jpa.container.unit.impl.JndiDataSource.getDs(JndiDataSource.java:64) ~[org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource.getConnection(DelayedLookupDataSource.java:36) [org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:70) [hibernate-entitymanager-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:242) [hibernate-core-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:117) [hibernate-core-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:76) [hibernate-core-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:160) [hibernate-core-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:132) [hibernate-core-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1822) [hibernate-core-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1780) [hibernate-core-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96) [hibernate-entitymanager-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914) [hibernate-entitymanager-4.2.7.Final.jar:4.2.7.Final]
at org.hibernate.osgi.OsgiPersistenceProvider.createContainerEntityManagerFactory(OsgiPersistenceProvider.java:99) [hibernate-osgi-4.2.7.Final.jar:4.2.7.Final]
at org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.createEntityManagerFactories(EntityManagerFactoryManager.java:331) [org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.registerEntityManagerFactories(EntityManagerFactoryManager.java:242) [org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.bundleStateChange(EntityManagerFactoryManager.java:185) [org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.apache.aries.jpa.container.impl.PersistenceBundleManager.modifiedBundle(PersistenceBundleManager.java:300) [org.apache.aries.jpa.container-1.0.1-SNAPSHOT.jar:1.0.1-SNAPSHOT]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:479) [org.apache.felix.framework-4.4.0.jar:na]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:414) [org.apache.felix.framework-4.4.0.jar:na]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [org.apache.felix.framework-4.4.0.jar:na]
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:869) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:790) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:515) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4409) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2142) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2070) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976) [org.apache.felix.framework-4.4.0.jar:na]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1245) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1217) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:509) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310) [org.apache.felix.fileinstall-3.4.0.jar:3.4.0]

Я установил следующие Bundles, чтобы Hibernate работал:

<dependency><groupId>org.apache.geronimo.specs</groupId><artifactId>geronimo-jta_1.1_spec</artifactId><version>1.1.1</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.aries.jpa</groupId><artifactId>org.apache.aries.jpa.api</artifactId><version>1.0.0</version></dependency>
<dependency><groupId>org.apache.aries.jpa</groupId><artifactId>org.apache.aries.jpa.blueprint.aries</artifactId><version>1.0.1</version></dependency>
<dependency><groupId>org.apache.aries.jpa</groupId><artifactId>org.apache.aries.jpa.container</artifactId><version>1.0.1</version></dependency>
<dependency><groupId>org.apache.aries.jpa</groupId><artifactId>org.apache.aries.jpa.container.context</artifactId><version>1.0.1</version></dependency>

<!--hibernate 4.2.7 -->
<dependency><groupId>org.apache.servicemix.bundles</groupId><artifactId>org.apache.servicemix.bundles.antlr</artifactId><version>2.7.7_5</version></dependency>
<dependency><groupId>org.apache.servicemix.bundles</groupId><artifactId>org.apache.servicemix.bundles.ant</artifactId><version>1.8.2_2</version></dependency>
<dependency><groupId>org.apache.servicemix.bundles</groupId><artifactId>org.apache.servicemix.bundles.dom4j</artifactId><version>1.6.1_5</version></dependency>
<dependency><groupId>org.apache.servicemix.bundles</groupId><artifactId>org.apache.servicemix.bundles.serp</artifactId><version>1.14.1_1</version></dependency>
<dependency><groupId>com.fasterxml</groupId><artifactId>classmate</artifactId><version>0.9.0</version></dependency>
<dependency><groupId>org.javassist</groupId><artifactId>javassist</artifactId><version>3.18.1-GA</version></dependency>
<dependency><groupId>org.jboss.spec.javax.security.jacc</groupId><artifactId>jboss-jacc-api_1.4_spec</artifactId><version>1.0.2.Final</version></dependency>
<dependency><groupId>org.jboss</groupId><artifactId>jandex</artifactId><version>1.1.0.Final</version></dependency>
<dependency><groupId>org.jboss.logging</groupId><artifactId>jboss-logging</artifactId><version>3.1.4.GA</version></dependency>
<dependency><groupId>org.hibernate.common</groupId><artifactId>hibernate-commons-annotations</artifactId><version>4.0.4.Final</version></dependency>
<dependency><groupId>org.hibernate</groupId><artifactId>hibernate-core</artifactId><version>4.2.7.Final</version></dependency>
<dependency><groupId>org.hibernate</groupId><artifactId>hibernate-entitymanager</artifactId><version>4.2.7.Final</version></dependency>
<dependency><groupId>org.hibernate</groupId><artifactId>hibernate-osgi</artifactId><version>4.2.7.Final</version></dependency>

<!-- JTA -->
<dependency><groupId>org.apache.aries.transaction</groupId><artifactId>org.apache.aries.transaction.blueprint</artifactId><version>1.0.1</version></dependency>
<dependency><groupId>org.apache.aries.transaction</groupId><artifactId>org.apache.aries.transaction.manager</artifactId><version>1.1.0</version></dependency>

<!-- JNDI -->
<dependency><groupId>org.apache.xbean</groupId><artifactId>xbean-naming</artifactId><version>3.16</version></dependency>
<dependency><groupId>org.apache.aries.jndi</groupId><artifactId>org.apache.aries.jndi.api</artifactId><version>1.0.0</version></dependency>
<dependency><groupId>org.apache.aries.jndi</groupId><artifactId>org.apache.aries.jndi.core</artifactId><version>1.0.0</version></dependency>
<dependency><groupId>org.apache.aries.jndi</groupId><artifactId>org.apache.aries.jndi.rmi</artifactId><version>1.0.0</version></dependency>
<dependency><groupId>org.apache.aries.jndi</groupId><artifactId>org.apache.aries.jndi.url</artifactId><version>1.0.0</version></dependency>
<dependency><groupId>org.apache.aries.jndi</groupId><artifactId>org.apache.aries.jndi.legacy.support</artifactId><version>1.0.0</version></dependency>

<dependency><groupId>org.apache.aries.proxy</groupId><artifactId>org.apache.aries.proxy</artifactId><version>1.0.1</version></dependency>

Ответ №1

Это ошибка в aries jpa 1.0.0. См. Проблема aries-1160. Он исправлен в версии 1.0.1, на которую в настоящее время проголосовали. Таким образом, вы должны найти эту версию в центре maven через несколько дней.

Тем временем вы можете протестировать исправление в промежуточном репозитории. Просто обменивайтесь версией java jar aries в вашем развертывании. Btw. новая версия также должна позволить использовать версии hibernate 4.3, так как она совместима с jpa 2.1.

Оцените статью
TechArks.Ru
Добавить комментарий