You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Michiel Vermandel <mv...@yahoo.com> on 2012/05/18 08:21:52 UTC

Apache Felix and Aries JPA

Hi all,

Not sure I can post this question here, so if not, maybe someone knows where I should ask it.

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

Re: Apache Felix and Aries JPA

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 5/18/12 2:21, Michiel Vermandel wrote:
> Hi all,
>
> Not sure I can post this question here, so if not, maybe someone knows where I should ask it.
>
> 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)

I don't really know anything about Aries JPA, but I understand this 
error message. One thing you could do is try to resolve 
org.apache.openjpa before resolving other bundles (i.e., start it 
first). This might kick the Felix resolver into finding a compatible set 
of candidates.

You probably need to ask on the Aries list if it makes sense whether 
org.apache.geronimo.specs.geronimo-jpa_2.0_spec is ultimately exposed to 
javax.transaction.xa from the system bundle or not. The system bundle 
packages around transactions are often problematic and not what app 
servers need because they are incomplete, which is probably why these 
bundles provider another version.

One reason why this might not show up on Equinox, for example, is that 
Equinox doesn't model "uses" constraints on the system bundle exports, 
but the Felix framework does. So, technically, I find this error very 
nice. ;-) But, you could also blissfully ignore it by editing the Felix 
framework configuration to remove this "uses" constraint from javax.sql 
to javax.transaction.xa...still, that could lead to other problems later.

-> richard

>
> ---------------------------------------------------------------------------------------------------------------------
> ---------------------------------------------------------------------------------------------------------------------
> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org