Совместимость с JPA и JMS
Я встречаюсь с исключением запуска проекта с использованием Spring данных JPA
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 18 in XML document from class path resource [META-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/data/jpa/spring-jpa.xsd; lineNumber: 18; columnNumber: 51; src-resolve: Cannot resolve the name 'repository:repositories' to a(n) 'type definition' component.
Я прочитал много документов и блогов, и я думаю, что это, возможно, вызвано несовместимостью версий пакетов данных весны и весны.
Сейчас я пользуюсь
- весна-данные-Обще-ядро-1.4.1.Release
- весна-данные-Обще-1.10.0.release
- весна-данных JPA-1.8.0.
Любое предложение по управлению версиями, чтобы избавиться от такой ошибки?
Также я хотел бы попросить предложения, как сделать такой контроль версий проще (любой веб-сайт, документы или инструменты). Спасибо за совет заранее.
Ниже я использую пространство имен
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:repository="http://www.springframework.org/schema/data/repository"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository.xsd">
repository:repository
не из моего applicationContext.xml
, Я использовал jpa:repository
как
<jpa:repositories base-package="com.canreef.calendar"/>
1 ответ
Я нашел эти корни в spring-repository.xsd. В spring-jpa.xsd есть строка с ссылкой на репозиторий:auditing-attribute:
<xsd:element name="auditing">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation>
<tool:exports type="org.springframework.data.jpa.domain.support.AuditingEntityListener" />
<tool:exports type="org.springframework.data.auditing.AuditingHandler" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:attributeGroup ref="repository:auditing-attributes" />
</xsd:complexType>
</xsd:element>
В то время как в spring-repository.xsd есть боб:
-<xsd:attributeGroup name="auditing-attributes">
-<xsd:attribute name="auditor-aware-ref">
-<xsd:annotation>
-<xsd:documentation>
<![CDATA[ References a bean of type AuditorAware to represent the current principal. ]]>
</xsd:documentation>
-<xsd:appinfo>
-<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.domain.AuditorAware"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
...omitted...
</xsd:attributeGroup>
Поэтому это должно быть вызвано невозможностью получить файл repository.xsd.