I would stick with OpenJPA in OSGi. It will cause you a lot less headaches, especially when combined with Aries JPA. Take a look at why OpenJPA won't start. It's probably its serp dependency.
On Fri, May 18, 2012 at 5:23 AM, Balázs Zsoldos <[email protected]> wrote: > Hi, > > you may be interested in the sample project > at https://source.everit.biz/svn/everit-osgi/trunk/samples/hibernate > This is an amazingly simple sample that does not contain any business logic > but one insert and a query based on Hibernate, JPA and Aries. It works on > Equinox and on Felix for sure as the tests run at the integration-phase of > the compilation. > > To get started: > > Check out https://source.everit.biz/svn/everit-osgi/trunk/samples/hibernate > (guest/guest) > Run mvn install (This will compile everything and run a test on equinox and > one on Felix in the maven integration-test phase) > If you want to see the exact dependencies that were used on the OSGI > container: > > Go to core folder > Run "mvn package > org.everit.osgi.testing:everit-osgi-plugin:0.3.0-SNAPSHOT:linkFolder" > command. You will need the followings for this command: > > Java 7 > Admin command line in windows (do not know why). In linux you do not need > any rights > > Go to the folder core/target/bundleDependencies and you will see a shortcut > to all of the jar files that were running in the started OSGI container. If > you want, you can simply copy them out to a felix or equinox downloaded by > you manually. > > If you need a tutorial how to start the sample in Eclipse go > to http://everit.org/osgi/testing/step-by-step-guide.html > > Please let me know if it helped or if you have any further question > concerning to the sample. > > Regards, > Balazs Zsoldos > Software Architect > Mobile: +36-70/594-92-34 > > Everit Kft. > https://www.everit.biz > > > On Fri, May 18, 2012 at 11:01 AM, Michiel Vermandel <[email protected]> > wrote: >> >> Hi all, >> >> I am trying to get started with Aries JPA and Apache Felix, though without >> success. >> >> My question: >> >> >> * in short: How do I get started with Aries JPA in combination with Apache >> Felix? >> >> * in detail: >> >> >> I am trying to get started with Aries JPA in Felix but until now all my >> attempts failed. >> >> There doesn't seem to be some easy way such as >> >> - install these bundles in a clean Apache Felix >> - start all bundles and explore this URL >> >> - examine this source of the example. >> >> Of course there are some samples like >> "http://aries.apache.org/modules/samples/blog-sample.html" >> But they all require quite some setup. >> In the case above (blog-sample), one should start building the Aries >> development stream and then run the example in "Eclipse Equinox" (not Felix >> !?!). >> >> I tried building but - as I am not so good at Maven - I cant get the code >> of the Aries development stream to compile. >> I get some Maven issues (in Eclipse Indigo, m2e 1.0.200) such as >> - Plugin execution not covered by lifecycle configuration: >> org.apache.maven.plugins:maven-antrun-plugin:1.2:run (execution: >> create-prop, phase: initialize) >> >> - Missing artifact biz.aQute:bndlib:jar:0.0.313 >> - maven-enforcer-plugin (goal "enforce") is ignored by m2e. >> >> Next I tried just to download the ready-built bundles from >> - http://aries.apache.org/downloads/currentrelease.html >> But I could not find a nice checklist and thus it was guessing which >> bundles to install. >> I ended up with this set: >> >> ------------------------------------------------------------------------------ >> START LEVEL 1 >> ID|State |Level|Name >> 0|Active | 0|System Bundle (4.0.2) >> 1|Active | 1|Apache Derby JDBC (10.5.1.1) >> 2|Active | 1|Apache Felix Bundle Repository (1.6.6) >> 3|Active | 1|Apache Felix Configuration Admin Service (1.2.8) >> 4|Active | 1|Apache Felix EventAdmin (1.2.14) >> 5|Active | 1|Apache Felix File Install (3.2.0) >> 6|Active | 1|Apache Felix Gogo Command (0.12.0) >> 7|Active | 1|Apache Felix Gogo Runtime (0.10.0) >> 8|Active | 1|Apache Felix Gogo Shell (0.10.0) >> 9|Active | 1|Apache Felix Http Jetty (2.2.0) >> 10|Active | 1|Apache Felix Log Service (1.0.1) >> 11|Active | 1|Apache Felix Web Management Console (3.1.8) >> 12|Active | 1|Apache Aries blog sample web component (0.3.0) >> 13|Active | 1|Commons Collections (3.2.1) >> 14|Active | 1|Apache Aries Blueprint Bundle (0.4.0) >> 15|Active | 1|Apache Jakarta log4j Plug-in >> (1.2.15.v201012070815) >> 16|Installed | 1|OpenJPA Aggregate Jar (2.2.0) >> 17|Active | 1|Apache Aries Util (0.4.0) >> 18|Active | 1|Apache Geronimo JSR-317 JPA 2.0 Spec API (1.1.0) >> 19|Active | 1|Aries JPA Container blueprint integration for >> Aries blueprint (0.3.0) >> 20|Active | 1|asm (3.1.0) >> 21|Active | 1|Aries JPA Container Managed Contexts (0.3.0) >> 22|Active | 1|Aries JPA Container API (0.3.0) >> 23|Active | 1|Apache Aries blog sample (0.3.0) >> 24|Active | 1|slf4j-api (1.6.4) >> 25|Installed | 1|Apache Aries blog sample persistence (0.3.0) >> 26|Active | 1|Commons Lang (2.4.0) >> 27|Resolved | 1|slf4j-log4j12 (1.6.4) >> 28|Active | 1|Apache Aries blog sample API (0.3.0) >> 29|Active | 1|Commons DBCP (1.4.0) >> 30|Active | 1|Apache Derby 10.8 (10.8.2000002.1181258) >> 31|Active | 1|Aries JPA Container (0.3.0) >> 32|Active | 1|Apache Aries Proxy Bundle (0.4.0) >> 33|Active | 1|Commons Pool (1.5.4) >> 34|Active | 1|geronimo-jta_1.1_spec (1.1.1) >> >> ------------------------------------------------------------------------------ >> This is a combination of >> 1) Clean Apache Felix 4.0.2 >> 2) Aries bundles (blueprint, jpa, proxy) >> 3) OpenJPA 2.2.0 >> 4) asm-3.1-osgi.jar (I had to download somewhere) >> 5) slf4j and log4j (I had to download somewhere) >> >> When starting up I get >> >> ERROR: Bundle org.apache.openjpa [16] Error starting >> file:/C:/Data/tools/felix-framework-4.0.2-Aries/plugins/openjpa-2.2.0.jar >> (org.osgi.framework.BundleException: Uses constraint >> violation. Unable to resolve bundle revision org.apache.openjpa [16.0] >> because it is exposed to package 'javax.transaction.xa' from bundle >> revisions org.apache.geronimo.specs.geron >> imo-jta_1.1_spec [34.0] and org.apache.felix.framework [0] via two >> dependency chains. >> >> Chain 1: >> org.apache.openjpa [16.0] >> import: >> (&(osgi.wiring.package=javax.transaction.xa)(version>=1.1.0)(!(version>=1.2.0))) >> | >> export: osgi.wiring.package=javax.transaction.xa >> org.apache.geronimo.specs.geronimo-jta_1.1_spec [34.0] >> >> Chain 2: >> org.apache.openjpa [16.0] >> import: >> (&(osgi.wiring.package=javax.persistence)(version>=1.1.0)(!(version>=2.1.0))) >> | >> export: osgi.wiring.package=javax.persistence; uses:=javax.sql >> org.apache.geronimo.specs.geronimo-jpa_2.0_spec [18.0] >> import: (osgi.wiring.package=javax.sql) >> | >> export: osgi.wiring.package=javax.sql; uses:=javax.transaction.xa >> export: osgi.wiring.package=javax.transaction.xa >> org.apache.felix.framework [0]) >> >> I have no Idea how to fix (can't leave out >> geronimo-jta_1.1_spec-1.1.1.jar) >> >> >> --------------------------------------------------------------------------------------------------------------------- >> >> --------------------------------------------------------------------------------------------------------------------- >> So does anyone know about a clean check-list of how to get started? >> - Install this set of bundles (Aries, openJPA, log,... ?) >> - Install these sample bundles >> - Ready >> ? >> >> --------------------------------------------------------------------------------------------------------------------- >> >> --------------------------------------------------------------------------------------------------------------------- >> >> Thanks a lot! >> >> ----------------- >> http://www.codessentials.com - Your essential software, for free! >> Follow us at http://twitter.com/#!/Codessentials > >
