karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dealbitte <anand.boc...@gmail.com>
Subject Re: JPA Usage: Strategy for using Hibernate + Postgresql
Date Mon, 29 Oct 2012 11:31:47 GMT
I started to work with openJPA and created a osgi bundle (simpleProject)
based on this example,
http://www.liquid-reality.de/display/liquid/2012/01/13/Apache+Karaf+Tutorial+Part+6+-+Database+Access

In karaf 2.3.0, I installed the following features & bundles:

features:install jndi jpa transaction
install -s mvn:org.apache.derby/derby/10.8.2.2
install -s mvn:commons-collections/commons-collections/3.2.1
install -s mvn:commons-pool/commons-pool/1.5.4
install -s mvn:commons-dbcp/commons-dbcp/1.4
install -s mvn:commons-lang/commons-lang/2.6
install -s wrap:mvn:net.sourceforge.serp/serp/1.13.1
install -s mvn:org.apache.openjpa/openjpa/2.1.1
install -s mvn:org.apache.aries/org.apache.aries.util/0.4

Then I dropped the following datasource-derby.xml (taken from
www.liquid-reality.de example above)

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                default-activation="eager">  
    <bean id="dataSource"
class="org.apache.derby.jdbc.EmbeddedXADataSource">
       <property name="databaseName" value="test"/>
       <property name="createDatabase" value="create" />
    </bean>
  
    <service ref="dataSource" interface="javax.sql.DataSource">
        <service-properties>
            <entry key="osgi.jndi.service.name" value="jdbc/derbyds"/>
        </service-properties>
    </service>

    <service ref="dataSource" interface="javax.sql.XADataSource">
        <service-properties>
            <entry key="osgi.jndi.service.name" value="jdbc/derbydsxa"/>
        </service-properties>
    </service>
  
</blueprint>

And once I install my OSGi bundle (simpleProject), the bundle blueprint
status remains in 'GracePeriod' and ultimately fails as shown below:

karaf@root> list
START LEVEL 100 , List Threshold: 50
   ID   State         Blueprint      Level  Name
[  67] [Active     ] [            ] [   80] Apache Derby 10.8
(10.8.2000002.1181258)
[  68] [Active     ] [            ] [   80] Commons Collections (3.2.1)
[  69] [Active     ] [            ] [   80] Commons Pool (1.5.4)
[  70] [Active     ] [            ] [   80] Commons DBCP (1.4)
[  71] [Active     ] [            ] [   80] Commons Lang (2.6)
[  72] [Active     ] [            ] [   80]
wrap_mvn_net.sourceforge.serp_serp_1.13.1 (0)
[  73] [Active     ] [            ] [   80] OpenJPA Aggregate Jar (2.1.1)
[  74] [Active     ] [            ] [   80] Apache Aries Util (0.4.0)
[  75] [Active     ] [Failure     ] [   80] openjpa.examplejpa OSGi Bundle
(0.1.0)
[  76] [Active     ] [Created     ] [   80] datasource-derby.xml (0.0.0)

>From log:
2012-10-29 12:30:05,506 | INFO  | rint Extender: 3 | BlueprintContainerImpl          
| container.BlueprintContainerImpl  330 | 7 -
org.apache.aries.blueprint.core - 1.0.1 | Bundle
my.own.examples.openjpa.examplejpa is waiting for dependencies
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=person))(objectClass=javax.persistence.EntityManagerFactory))]

It is not clear what is missing here because
"javax.persistence.EntityManagerFactory" is part of feature:jpa
installation. Please guide me here.









--
View this message in context: http://karaf.922171.n3.nabble.com/JPA-Usage-Strategy-for-using-Hibernate-Postgresql-tp4026586p4026601.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Mime
View raw message