Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' entitymanagerfactory ' defined In class path resource [Beans.xml]: Invocation to Init method failed; Nested exception is java.lang.IllegalArgumentException:No persistenceprovider specified in Entitymanagerfactory Configuration, and chosen Persistenceunitinfo does not specify a provider class name either
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1338)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:473)
At Org.springframework.beans.factory.support.abstractautowirecapablebeanfactory$1.run ( abstractautowirecapablebeanfactory.java:409)
At Java.security.AccessController.doPrivileged (Native method)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:380)
At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:264)
At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:222)
At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:261)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:185)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:164)
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:423)
At Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:728)
At Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:380)
At Org.springframework.context.support.classpathxmlapplicationcontext.<init> ( classpathxmlapplicationcontext.java:139)
At Org.springframework.context.support.classpathxmlapplicationcontext.<init> ( CLASSPATHXMLAPPLICATIONCONTEXT.JAVA:83)
At Com.test.ProductTest.runtest (producttest.java:27)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:39)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:25)
At Java.lang.reflect.Method.invoke (method.java:597)
At Org.junit.runners.model.frameworkmethod$1.runreflectivecall (frameworkmethod.java:44)
At Org.junit.internal.runners.model.ReflectiveCallable.run (reflectivecallable.java:15)
At org.junit.runners.model.FrameworkMethod.invokeExplosively (frameworkmethod.java:41)
At Org.junit.internal.runners.statements.InvokeMethod.evaluate (invokemethod.java:20)
At Org.junit.internal.runners.statements.RunBefores.evaluate (runbefores.java:28)
At Org.junit.internal.runners.statements.RunAfters.evaluate (runafters.java:31)
At Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:73)
At Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:46)
At Org.junit.runners.ParentRunner.runChildren (parentrunner.java:180)
At org.junit.runners.parentrunner.access$000 (parentrunner.java:41)
At Org.junit.runners.parentrunner$1.evaluate (parentrunner.java:173)
At Org.junit.internal.runners.statements.RunBefores.evaluate (runbefores.java:28)
At Org.junit.internal.runners.statements.RunAfters.evaluate (runafters.java:31)
At Org.junit.runners.ParentRunner.run (parentrunner.java:220)
At Org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (junit4testreference.java:46)
At Org.eclipse.jdt.internal.junit.runner.TestExecution.run (testexecution.java:38)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:467)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:683)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (remotetestrunner.java:390)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (remotetestrunner.java:197)
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:207)
At Org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet ( abstractentitymanagerfactorybean.java:291)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1369)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1335)
... More
Solution added in Persistence.xml
<provider>org.hibernate.ejb.HibernatePersistence</provider>
Can