Spring Integrated MONGODB report nosuchmethoderror error

Source: Internet
Author: User

Just started to check the relevant information on the Internet for some configuration, reference link: http://www.open-open.com/lib/view/open1454374782167.html

MAVEN's dependencies are as follows:

<Dependency>      <groupId>Org.springframework</groupId>      <Artifactid>Spring-core</Artifactid>      <version>4.2.3.RELEASE</version>      <Exclusions>        <exclusion>          <groupId>Commons-logging</groupId>          <Artifactid>Commons-logging</Artifactid>        </exclusion>      </Exclusions>      <type>Jar</type>      <Scope>Compile</Scope></Dependency><Dependency>      <groupId>Org.springframework.data</groupId>      <Artifactid>Spring-data-mongodb</Artifactid>      <version>1.8.2.RELEASE</version></Dependency>

Spring-mongo.xml

<Beansxmlns= "Http://www.springframework.org/schema/beans"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xmlns:p= "http://www.springframework.org/schema/p"Xmlns:mongo= "Http://www.springframework.org/schema/data/mongo"Xmlns:context= "Http://www.springframework.org/schema/context"xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0. XSD http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data /repository/spring-repository-1.5.xsd Http://www.springframework.org/schema/data/mongo HTTP://WWW.SP            Ringframework.org/schema/data/mongo/spring-mongo-1.5.xsd Http://www.springframework.org/schema/context Http://www.springframework.org/schema/context/spring-context.xsd "><mongo:db-factoryID= "Mongodbfactory"Host= "127.0.0.1"Port= "27017"dbname= "Webusi" /><BeanID= "Mongotemplate"class= "Org.springframework.data.mongodb.core.MongoTemplate"> <Constructor-argname= "Mongodbfactory"ref= "Mongodbfactory" /> </Bean> </Beans>

After testing has been prompted, Mongotemplate created times wrong:

class [Org.springframework.data.mongodb.core.MongoTemplate]: Constructor threw exception; Nested exception is Java.lang.NoSuchMethodError

Later re-adjusted the version of Spring-core to 4.1.3.RELEASE, OK, is it really incompatible with the issue of version??

Again, the Spring-core version is adjusted to 4.0.6, incredibly not an error, really weird ...

Spring Integrated MONGODB report nosuchmethoderror error

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.