This week's book giveaway is in the JDBC and Relational Databases forum. We're giving away four copies of Resilient Oracle PL/SQL: Building Resilient Database Solutions for Continuous Operation and have Stephen Morris on-line! See this thread for details.
Caused by: java.lang.IllegalArgumentException: No PersistenceProvider specified in EntityManagerFactory configuration, and chosen PersistenceUnitInfo does not specify a provider class name either
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:250)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 37 more
My app context contains:
My persistence file (located in META-INF under classes). hibernate.cfg.xml is located in WEB-INF but I specified WEB-INF as part of my classpath when I ran the program.
There are the following issues in your configuration
1- You need to give a persistance provider in persistance.xml file. JPA2 has many implementations e.g. Hibernate, OpenJPA, EclipseLink. In your case
provide a persistance provider. You can specify the same in jpaVendor property. Specify the hibernate dialect as well.
2- Why you are specifying session factory for hibernate? JPA uses entity manager. You don't need to give session-factory configuration.
Here is a sample integration project i created for you. My applicationContext.xml now looks like this
My persistance.xml is empty and looks like this
I am writing a small blog article for Spring 3 and JPA2 will be completed by tomorrow. You can have a look at that also in a day or so at my blog.
HTH,