Error in file .xml on Spring MVC



I'm using Spring MVC for a web application. I recently read about JPARepository, and I liked its simplicity to create the DAO. But the servlet-context.xml file throws me the following error. It's weird because I have not changed anything in the configuration of the documentation:



org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 36 in XML document from ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://ift.tt/1j6yiKs; lineNumber: 36; columnNumber: 63; src-resolve: No se puede resolver el nombre 'repository:auditing-attributes' para un componente 'attribute group'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)


I also put the servlet-context file:



<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://ift.tt/1bHqwjR"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns:beans="http://ift.tt/GArMu6"
xmlns:context="http://ift.tt/GArMu7"
xmlns:tx="http://ift.tt/OGfeU2"
xmlns:aop="http://ift.tt/OpNdV1"
xmlns:util="http://ift.tt/OGfeTW"
xmlns:jpa="http://ift.tt/1iMF6wA"
xsi:schemaLocation="http://ift.tt/1bHqwjR
http://ift.tt/1fmimld
http://ift.tt/GArMu6
http://ift.tt/1jdM0fG
http://ift.tt/1iMF6wA
http://ift.tt/1j6yiKs
http://ift.tt/GArMu7
http://ift.tt/1bGeTcI
http://ift.tt/OGfeU2 http://ift.tt/1cQrvTl">


<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
<context:annotation-config />
<!-- Enables the Spring MVC @Controller programming model -->
<annotation-driven />

<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />

<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value="" />
</beans:bean>

<context:component-scan base-package="com.prueba.web" />


<jpa:repositories base-package="com.prueba.web.repository" />


<!-- Data Source -->
<beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<beans:property name="driverClassName" value="org.postgresql.Driver" />
<beans:property name="url" value="jdbc:postgresql://localhost:5432/EjercicioArticulo" />
<beans:property name="username" value="postgres" />
<beans:property name="password" value="postgres" />
<beans:property name="maxActive" value="100" /> <!-- indica el número máximo de conexiones que pueden usarse. -->
<beans:property name="maxIdle" value="30"/> <!-- indica el límite de conexiones que debe haber disponibles en el pool. -->
<beans:property name="maxWait" value="10000"/> <!-- indica el tiempo en ms que esperará Tomcat a que haya una conexión libre en caso de que no hubiera ninguna libre en ese instante. -->
</beans:bean>

<!-- Entity Manager Factory -->
<beans:bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="persistenceUnitName" value="puProyectoPrueba" />
<beans:property name="jpaVendorAdapter">
<beans:bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<beans:property name="showSql" value="true" />
</beans:bean>
</beans:property>
<beans:property name="jpaPropertyMap">
<beans:map>
<beans:entry key="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<beans:entry key="hibernate.hbm2ddl.auto" value="update" />
<beans:entry key="hibernate.format_sql" value="true" />
</beans:map>
</beans:property>
</beans:bean>

<!-- Support Annotation -->
<beans:bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<!--
<beans:bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
-->

<!-- Transaction Manager -->
<tx:annotation-driven />
<beans:bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<beans:property name="entityManagerFactory" ref="entityManagerFactory"/>
</beans:bean>

No comments:

Post a Comment