*Regards,Suman K+91-9886748169* On Tue, Jun 6, 2017 at 6:15 PM, Jack [via Karaf] < [email protected]> wrote:
> I used Hibernate ORM with PostgresSql. > > And below is the persistence.xml for Hibernate ORM with PostgresSql. > > <?xml version="1.0" encoding="UTF-8"?> > <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence > http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> > > <persistence-unit name="store" transaction-type="JTA"> > <provider>org.hibernate.jpa.HibernatePersistenceProvider</ > provider> > <jta-data-source>osgi:service/javax.sql.DataSource/(osgi. > jndi.service.name=store)</jta-data-source> > <class>com.data.vo.Store</class> > > <properties> > <property name="hibernate.dialect" > value="org.hibernate.dialect.PostgreSQLDialect"/> > <property name="hibernate.hbm2ddl.auto" value="update"/> > <property name="hibernate.connection.url" > value="jdbc:postgresql://localhost:5432/RMA" /> > <property name="hibernate.connection.driver_class" > value="org.postgresql.Driver" /> > <property name="hibernate.connection.username" > value="postgres" /> > <property name="hibernate.connection.password" > value="admin" /> > </properties> > </persistence-unit> > > </persistence> > > I have fine the persistence.xml in the MANIFEST using the following > configuration statement to the maven-bundle-plugin: > > <Meta-Persistence>META-INF/persistence.xml</Meta-Persistence> > > I have placed my persistence.xml file in location > src/main/resources/META-INF/persistence.xml. > > When I try to get the persistence object using > Persistence.createEntityManagerFactory, > I get the below exception > Exception in thread "main" javax.persistence.PersistenceException: No > Persistence provider for > EntityManager named store > > > I tried below options also. > > 1) Tried changing to MYSQL/PostgresSQL drivers for connecting to the DB > 2) Made configuration changes in eclipse to remove the resource folder's > excluded list from *.* to None. > 3) Tried with Eclipselink also > 4) Tried setting the ContextClassLoader to a classloader that can see the > persistence provider as well as the database drivers. > > > But none of the above option solved by issue. I need some help on this. > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://karaf.922171.n3.nabble.com/Hibernate-ORM-with- > PostgresSql-with-Karaf-4-1-0-tp4050580.html > To start a new topic under Karaf - User, email ml+s922171n930749h25@n3. > nabble.com > To unsubscribe from Karaf - User, click here > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=c3NoZXR0eTR1QGdtYWlsLmNvbXw5MzA3NDl8NTc2MDI5NzEw> > . > NAML > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://karaf.922171.n3.nabble.com/Re-Hibernate-ORM-with-PostgresSql-with-Karaf-4-1-0-tp4050581.html Sent from the Karaf - User mailing list archive at Nabble.com.
