Closed lburgazzoli closed 11 years ago
the same is for Karaf 2.3.1
@lgazo , is your bundle in a public repo? I'd be happy to pull it down and debug a bit. Some extra use cases are always helpful.
I've quickly copied sources here: https://github.com/lgazo/karaf-poc
Status:
fyi. I am quite new to osgi so some things might be set up incorrectly - I welcome any comments in this regard :)
I do not more have any NPE exception since the migration to 4.2.1-SNAPSHOT
I've installed the following bundles in Karaf 2.3.0
[ 76] [Active ] [ ] [ 80] Commons Lang (3.1.0) [ 83] [Active ] [ ] [ 80] HSQLDB (2.2.9) [ 109] [Active ] [ ] [ 80] Guava: Google Core Libraries for Java (13.0.0) [ 130] [Active ] [ ] [ 80] Apache ServiceMix :: Bundles :: serp (1.14.1.1) [ 132] [Active ] [ ] [ 80] geronimo-servlet_2.5_spec (1.2) [ 134] [Active ] [ ] [ 80] Commons Collections (3.2.1) [ 135] [Active ] [ ] [ 80] Apache ServiceMix :: Bundles :: commons-dbcp (1.4.0.3) [ 136] [Active ] [ ] [ 80] Commons Lang (2.6) [ 137] [Active ] [ ] [ 80] Commons Pool (1.5.4) [ 138] [Active ] [ ] [ 80] OpenJPA Aggregate Jar (2.2.1) [ 182] [Active ] [ ] [ 80] ClassMate (0.5.4) [ 184] [Active ] [ ] [ 80] Hibernate Validator (4.2.0.Final) [ 185] [Active ] [ ] [ 80] Apache Geronimo JSR-303 Bean Validation Spec API (1.1) [ 186] [Active ] [ ] [ 80] Apache ServiceMix :: Bundles :: antlr (2.7.7.5) [ 187] [Active ] [ ] [ 80] Apache ServiceMix :: Bundles :: ant (1.8.2.2) [ 188] [Active ] [ ] [ 80] Apache ServiceMix :: Bundles :: dom4j (1.6.1.5) [ 189] [Active ] [ ] [ 80] Javassist Java Programming Assistant (3.15.0.GA) [ 190] [Active ] [ ] [ 80] JACC 1.4 API (1.0.2.Final) [ 191] [Active ] [ ] [ 80] wrap_mvn_org.jboss_jandex_1.1.0.Alpha1 (0) [ 192] [Active ] [ ] [ 80] JBoss Logging 3 (3.1.0.GA) [ 195] [Active ] [ ] [ 80] wrap_mvn_http___snapshots.jboss.org_maven2_org.hibernate.common_hibernate-commons-annotations_4.0.1-SNAPSHOT (0) [ 211] [Active ] [ ] [ 80] H2 Database Engine (1.3.170) [ 215] [Active ] [Created ] [ 80] Karaf Examples :: JPA :: DataSource (1.0.0.SNAPSHOT) [ 227] [Active ] [ ] [ 80] Servlet 3.0 (1.0) [ 228] [Active ] [ ] [ 80] hibernate-core (4.2.0.CR2) [ 229] [Active ] [ ] [ 80] hibernate-entitymanager (4.2.0.CR2) [ 230] [Active ] [ ] [ 80] hibernate-osgi (4.2.0.CR2) [ 231] [Active ] [Created ] [ 80] Karaf Examples :: JPA :: Utils (1.0.0.SNAPSHOT) [ 233] [Active ] [Created ] [ 80] Karaf Examples :: JPA :: Hibernate (1.0.0.SNAPSHOT)
And then when I try to run a little test that work with OpenJPA and Eclipselink I have an NPE exception:
java.lang.NullPointerException at org.apache.aries.jpa.container.impl.CountingEntityManagerFactory.createEntityManager(CountingEntityManagerFactory.java:65)[59:org.apache.aries.jpa.container:1.0.0] at Proxy735ba6d6_df91_4682_9974_d420f75b1cf1.createEntityManager(Unknown Source)[:] at lb.examples.karaf.jpa.hibernate.data.ApplicationManagedDataService.add(ApplicationManagedDataService.java:55)[233:jpa-hibernate:1.0.0.SNAPSHOT] at lb.examples.karaf.jpa.hibernate.cmd.ItemAddCommand.execute(ItemAddCommand.java:55)[233:jpa-hibernate:1.0.0.SNAPSHOT] at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.jline.Console.run(Console.java:175)[14:org.apache.karaf.shell.console:2.3.0] at java.lang.Thread.run(Thread.java:722)[:1.7.0_15]
I do not know if it is because of a misconfiguration in my sample or a bug:
OSGi Blueprint:
Persistence.xml: