"No Persistence provider" exception

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"No Persistence provider" exception

orkun
Hello

I followed the steps in tutorial

I got this error message

Caused by: java.lang.ExceptionInInitializerError
        at util.JPAUtil.<clinit>(JPAUtil.java:17)
        at event.EventManager.createAndStoreEvent(EventManager.java:39)
        at event.EventManager.main(EventManager.java:25)
        ... 6 more
Caused by: javax.persistence.PersistenceException: No Persistence
provider for EntityManager named org.hibernate.events.jpa
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
        at util.JPAUtil.<clinit>(JPAUtil.java:14)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ü


I changed the persistent.xml as:

<persistence-unit name="org.hibernate.events.jpa"
        transaction-type="RESOURCE_LOCAL">
       
                <properties>
                        <property name="hibernate.dialect"
                                value="org.hibernate.spatial.dialect.postgis.PostgisDialect" />

                        <property name="hibernate.connection.driver_class"
value="org.postgresql.Driver" />
                        <property name="hibernate.connection.url"
value="jdbc:postgresql://localhost:5432:hstutorial"/>
                        <property name="hibernate.connection.username" value="orkun" />
                        <property name="hibernate.connection.password" value="222222" />
                        <property name="hibernate.connection.pool_size" value="5" />

                        <property name="hibernate.show_sql" value="true" />
                        <property name="hibernate.format_sql" value="true" />

                        <property name="hibernate.max_fetch_depth" value="5" />

                        <property name="hibernate.hbm2ddl.auto" value="update" />

                </properties>
        </persistence-unit>

I craeted an postgis db named events


what might the problem be ?

regards
--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı
Bilgi ve CBS grubu
Eskişehir Yolu 10. km.
Lodumlu / Ankara
Tel : 0 312 2872680 / 1535
________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: "No Persistence provider" exception

Karel Maesen
Administrator
Hi,

This kind of problem is usually due to some problem in configuration. Looks like your persistence.xml doesn't get picked up from the classpath.

This is not really a Hibernate Spatial problem, so you're better off looking through the Hibernate/JPA documentation.

Regards,

Karel

On 27 Sep 2012, at 13:55, Ahmet Temiz wrote:

> Hello
>
> I followed the steps in tutorial
>
> I got this error message
>
> Caused by: java.lang.ExceptionInInitializerError
> at util.JPAUtil.<clinit>(JPAUtil.java:17)
> at event.EventManager.createAndStoreEvent(EventManager.java:39)
> at event.EventManager.main(EventManager.java:25)
> ... 6 more
> Caused by: javax.persistence.PersistenceException: No Persistence
> provider for EntityManager named org.hibernate.events.jpa
> at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
> at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
> at util.JPAUtil.<clinit>(JPAUtil.java:14)
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ü
>
>
> I changed the persistent.xml as:
>
> <persistence-unit name="org.hibernate.events.jpa"
> transaction-type="RESOURCE_LOCAL">
>
> <properties>
> <property name="hibernate.dialect"
> value="org.hibernate.spatial.dialect.postgis.PostgisDialect" />
>
> <property name="hibernate.connection.driver_class"
> value="org.postgresql.Driver" />
> <property name="hibernate.connection.url"
> value="jdbc:postgresql://localhost:5432:hstutorial"/>
> <property name="hibernate.connection.username" value="orkun" />
> <property name="hibernate.connection.password" value="222222" />
> <property name="hibernate.connection.pool_size" value="5" />
>
> <property name="hibernate.show_sql" value="true" />
> <property name="hibernate.format_sql" value="true" />
>
> <property name="hibernate.max_fetch_depth" value="5" />
>
> <property name="hibernate.hbm2ddl.auto" value="update" />
>
> </properties>
> </persistence-unit>
>
> I craeted an postgis db named events
>
>
> what might the problem be ?
>
> regards
> --
> Ahmet Temiz
> Jeoloji Müh.
> Afet ve Acil Durum Yönetimi Başkanlığı
> Planlama ve Zarar Azaltma Dairesi Başkanlığı
> Bilgi ve CBS grubu
> Eskişehir Yolu 10. km.
> Lodumlu / Ankara
> Tel : 0 312 2872680 / 1535
> ________________________
>
> Ahmet Temiz
> Geological Eng.
> Information Systems - GIS Group
> Disaster and Emergency Management
> of Presidency
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users