Hi all,
despite there are lots of examples and suggestions about jpa-osgi integration, I couldn't get rid of this error: "No Persistence Provider For EntityManager named deneme".
I am using karaf-4.0.0.M2 and try to integrate hibernate. In log file, I can see mapping is done succesfully.
HHH000204: Processing PersistenceUnitInfo [ name: deneme ...]
HHH000412: Hibernate Core {4.3.6.Final}
HHH000206: hibernate.properties not found
HHH000021: Bytecode provider name : javassist
Hibernate Commons Annotations {4.0.4.Final}
HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect
HHH000397: Using ASTQueryTranslatorFactory
HHH000229: Running schema validator
HHH000102: Fetching database metadata
HHH000261: Table found: NBSDEV.DENEME
HHH000037: Columns: [aaa, sssorj
I got two bundles. One includes .xhtml pages and other one includes entity(called "Deneme") and beans. In entity-bean bundle, I got persistence and blueprint xml files under src/main/resources directory.
I also have "datasource-oracle.xml" in deploy folder.
persistence.xml:
<persistence version="2.0"
<persistence-unit name="deneme" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>jpa.entity.Deneme</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.hbm2ddl.auto" value="validate" />
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@//test11g-cluster/deneme" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
blueprint.xml:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint default-activation="eager"
<bean id="denemeService" class="jpa.entity.impl.DenemeServiceImpl">
<jpa:context unitname="deneme" property="entityManager" />
<tx:transaction method="*" value="Required" />
</bean>
<service ref="denemeService" interface="jpa.entity.DenemeService"/>
</blueprint>
I got the error when I try to create EntityManagerFactory object:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("deneme", System.getProperties());
I also used "JPA-PersistenceUnits" and "Meta-Persistence" tags in manifest file as suggested.
Thanks for the help...