Hi Christian, I managed to get the example working by installing pax-jdbc/derbyclient/pool-dbcp2. Many thanks for your assistance.
JT On 17/02/16 18:11, Christian Schneider wrote:
Just for completeness as we discussed on irc. The DataSource service is missing. 2016-02-17 09:25:36,872 | INFO | nsole user karaf | DataSourceTracker | 59 - org.apache.aries.jpa.container - 2.2.0 | Tracking DataSource for punit recipe with filter (&(objectClass=javax.sql.DataSource)(osgi.jndi.service.name <http://osgi.jndi.service.name/>=jdbc/demo)) The easiest way to do this is to create the DataSource using pax jdbc. See https://ops4j1.jira.com/wiki/display/PAXJDBC/Pooling+and+XA+support+for+DataSourceFactory Christian 2016-02-17 10:34 GMT+01:00 JT <[email protected] <mailto:[email protected]>>: Hi, I'm trying to modify the example 'Chapter 7 :: Recipe 4'from the Karaf Cookbook to work in Karaf 4.0.3 using JPA 2. I have tried to follow the guidance on the aries.apache.org/modules/jpaproject <http://aries.apache.org/modules/jpaproject> to modify the Cookbook example to work with annotations but when I deploy the bundle it just waits for a dependency on 'EntityManager'. The log shows: 2016-02-17 09:25:36,851 | INFO | nsole user karaf | PersistenceBundleTracker | 59 - org.apache.aries.jpa.container - 2.2.0 | Found persistence unit recipe in bundle jpa-jta with provider org.apache.openjpa.persistence.PersistenceProviderImpl. 2016-02-17 09:25:36,852 | INFO | nsole user karaf | PersistenceProviderTracker | 59 - org.apache.aries.jpa.container - 2.2.0 | Found provider for recipe org.apache.openjpa.persistence.PersistenceProviderImpl 2016-02-17 09:25:36,860 | INFO | nsole user karaf | JPAWeavingHook | 59 - org.apache.aries.jpa.container - 2.2.0 | Adding transformer org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl 2016-02-17 09:25:36,872 | INFO | nsole user karaf | DataSourceTracker | 59 - org.apache.aries.jpa.container - 2.2.0 | Tracking DataSource for punit recipe with filter (&(objectClass=javax.sql.DataSource)(osgi.jndi.service.name <http://osgi.jndi.service.name>=jdbc/demo)) 2016-02-17 09:25:36,912 | WARN | nsole user karaf | JpaComponentProcessor | 58 - org.apache.aries.jpa.blueprint - 2.2.0 | No classname for shell-27 2016-02-17 09:25:36,913 | WARN | nsole user karaf | JpaComponentProcessor | 58 - org.apache.aries.jpa.blueprint - 2.2.0 | No classname for shell-28 2016-02-17 09:25:36,938 | INFO | nsole user karaf | BlueprintContainerImpl | 13 - org.apache.aries.blueprint.core - 1.4.5 | Bundle jpa-jta/1.0.0.SNAPSHOT is waiting for dependencies [(&(osgi.unit.name <http://osgi.unit.name>=recipe)(objectClass=javax.persistence.EntityManager))] I'm using openjpa 2.4.0 and the transaction feature but I modified the openjpa-2.4.0 bundle's manifest manually to work with JTA-1.2 (See OpenJPA-2607) I think I have everything required installed, any suggestions? Thanks, JT -- -- Christian Schneider http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de> Open Source Architect http://www.talend.com <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
