0

Обще я встречаю исключение работает проект с использованием JPA пружинных данныевесной 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. 
 

Я прочитал много докторов и блог, и я думаю, что это, возможно, вызвано несовместимостью весенних JPA данных и яровые данных общих пакетов.

Теперь я использую

  • весны-данные-Обще-жильные-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"/> 
+0

'repository: repositories' должно быть' jpa: repositories' ... Для управления вашими зависимостями используйте что-то вроде maven или gradle, не ищите сами. –

+0

Я использовал jpa: репозиторий – OrlandoL

+0

@Deinum Я использовал jpa: репозиторий, этот репозиторий: репозиторий должен поступать из xml. Я добавил к сообщению, пожалуйста, проверьте. – OrlandoL

ответ

0

Я нашел корни в весенне-repository.xsd Весной-jpa.xsd есть строка с реф в хранилище: аудит-атрибуты:

<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> 

В то время как в весенне-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.

+0

Есть ли какие-либо идеи, где находится этот spring-repository.xsd? Я не могу найти его в любой банке. – OrlandoL

+0

Поскольку это, похоже, еще одна проблема, я просто начал другой поток http: // stackoverflow./ Вопросы/ком 30542876/может-имя не-Решимость-repositoryrepositories-к-ан-типа определение-Comp – OrlandoL