I am trying to run sample Spring JPA application. But, I am getting the below error - l
og4j:WARN No appenders could be found for logger (org.springframework.beans.factory.access.Singleto nBeanFactoryLocator).
log4j:WARN Please initialize the log4j system properly.
org.springframework.beans.factory.access.Bootstrap Exception: Unable to return specified BeanFactory instance: factory key [hello-jpa], from group with resource name [classpath*:beanRefFactory.xml]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'crr-xcm' defined in URL [file:/C:/MyProjects/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlAp plicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 1 in XML document from class path resource [config/persistence.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'persistence'.
persistence.xml
----------------
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="my-pu" transaction-type="RESOURCE_LOCAL">
<class>com.test.Student</class>
</persistence-unit>
</persistence>
Please suggest hoe to get rid of this error.
Thanks


Reply With Quote