Generally speaking, for all JPA users, we are going to gather all use
cases. It will allow us to check if it works fine and evnetually update
the documentation.
Since Karaf 4.0.2, we received questions/issues about JPA support in
Karaf. Achim, Christian and I will work on this topic.
Thanks,
Regards
JB
On 11/24/2015 03:41 PM, Jason Reilly wrote:
Hi all,
I am trying to migrate an application to Karaf 4.0.3 & am using Java8. I
have tried a few permutations of persistence providers (hibernate,
openjpa, & eclipselink). I got Hibernate to work, but ran into a number
of problems (like not having all the collections in a @NamedEntityGraph
loaded & this bug: https://hibernate.atlassian.net/browse/HHH-9270).
Wanting to continue with JPA 2.1, I tried out eclipselink. One of the
problems I had with eclipselink was the following:
2015-11-23 16:28:10,754 | INFO | rint Extender: 3 |
BlueprintContainerImpl | 31 - org.apache.aries.blueprint.core
- 1.4.5 | Bundle hearsay-dao-jpa/0.0.46.SNAPSHOT is waiting for
namespace handlers [http://aries.apache.org/xmlns/transactions/v2.0.0]
I have transaction & jpa features installed, but the hearsay-dao-jpa
bundle is never activated when I use a blueprint xml file to register
the services. When I use the pax-cdi annotations (as in Christian's
KarafTutorial example), the hearsay-dao-jpa bundle is activated, but
throws an NPE on getEntityManager() despite using the PersistentContext
annotation. I think this might be related to the Aries JPA 2.2.0
problem mentioned in another thread (Problem with JPA 2.2.0 in Karaf
4.0.2).
When I try openjpa/2.4.0 & JPA 2.0, the openjpa bundle is in a resolved
state. When I try to start that bundle the following is thrown:
ERROR: Bundle org.apache.aries.jpa.container [55] EventDispatcher: Error
during dispatch. (java.lang.NoClassDefFoundError:
javax/transaction/Synchronization)
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
However, the packages are available:
karaf@root()> exports | grep javax.transaction
javax.transaction.xa
| 0.0.0 | 0 | org.apache.felix.framework
javax.transaction.xa
| 1.1.0 | 122 | org.apache.geronimo.specs.geronimo-jta_1.1_spec
javax.transaction.xa
| 1.2.0 | 256 | javax.transaction-api
javax.transaction
| 0.0.0 | 0 | org.apache.felix.framework
javax.transaction
| 1.1.0 | 122 | org.apache.geronimo.specs.geronimo-jta_1.1_spec
javax.transaction
| 1.2.0 | 256 | javax.transaction-api
I also see the following in the log after messing with which
transaction-api/persistence-api features I have installed:
Caused by: java.lang.NoClassDefFoundError:
javax/transaction/SystemException
at
org.apache.openjpa.persistence.osgi.PersistenceActivator.start(PersistenceActivator.java:61)
Before reverting back to Karaf 3.0.5...is there anything else I can
try? Suggestions?
Thanks,
Jason
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com