spring-data-jpa & org.springframework compatibility -
i updated parent pom file our (child) projects declare. in said pom file, updated "org.springframework" dependencies (spring-webmvc, spring-web ...) version 4.0.7.release 4.1.6.release.
in child project/pom, i'm using org.springframework.data spring-data-jpa. before update parent pom file, tests passing. after update, i'm seeing error:
caused by: java.lang.nosuchmethoderror: org.springframework.beans.factory.xml.xmlreadercontext.getenvironment()lorg/springframework/core/env/environment; @ org.springframework.context.annotation.componentscanbeandefinitionparser.parse(componentscanbeandefinitionparser.java:81) @ org.springframework.beans.factory.xml.namespacehandlersupport.parse(namespacehandlersupport.java:74) @ org.springframework.beans.factory.xml.beandefinitionparserdelegate.parsecustomelement(beandefinitionparserdelegate.java:1426) @ org.springframework.beans.factory.xml.beandefinitionparserdelegate.parsecustomelement(beandefinitionparserdelegate.java:1416) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.parsebeandefinitions(defaultbeandefinitiondocumentreader.java:179) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.doregisterbeandefinitions(defaultbeandefinitiondocumentreader.java:149) @ org.springframework.beans.factory.xml.defaultbeandefinitiondocumentreader.registerbeandefinitions(defaultbeandefinitiondocumentreader.java:103) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.registerbeandefinitions(xmlbeandefinitionreader.java:510) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:392)
i tried update spring-data-jpa version 1.7.1.release 1.8.0.release error message same.
i have read several posts suggesting there dependency/jar conflict no explanation conflict occurring not how resolve it. can gather, changes in org.springframework causing this.
in case following line in class org.springframework.data.repository.config.repositorybeandefinitionparser
:
public beandefinition parse(element element, parsercontext parser) { xmlreadercontext readercontext = parser.getreadercontext(); try { environment e = readercontext.getenvironment();
caused: java.lang.nosuchmethoderror: org.springframework.beans.factory.xml.xmlreadercontext.getenvironment()
.
repositorybeandefinitionparser in spring-data-commons
dependency of spring-data-jpa
pom.xml file:
<dependency> <groupid>${project.groupid}</groupid> <artifactid>spring-data-commons</artifactid> <version>${springdata.commons}</version> </dependency>
so, when upgraded org.springframework.data:spring-data-jpa
dependency higher version 1.9.2.release (while having spring-beans of 4.1.0.release), started exception, because xmlreadercontext
didn't have method getenvironment()
required repositorybeandefinitionparser.parse(element element, parsercontext parser)
method.
Comments
Post a Comment