惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy International News Feed
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google Online Security Blog
Google Online Security Blog
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
云风的 BLOG
云风的 BLOG
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Announcements
Recent Announcements
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LangChain Blog
The GitHub Blog
The GitHub Blog
aimingoo的专栏
aimingoo的专栏
Scott Helme
Scott Helme
腾讯CDC
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
Cloudbric
Cloudbric
K
Kaspersky official blog
B
Blog RSS Feed
博客园_首页
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
G
Google Developers Blog
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
Vercel News
Vercel News
The Last Watchdog
The Last Watchdog
S
Schneier on Security
T
Tor Project blog
雷峰网
雷峰网
博客园 - 司徒正美
H
Hacker News: Front Page
I
Intezer
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Martin Fowler
Martin Fowler
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Help Net Security
Help Net Security
WordPress大学
WordPress大学
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
V
Vulnerabilities – Threatpost
Forbes - Security
Forbes - Security
Google DeepMind News
Google DeepMind News
T
Threatpost

博客园 - 萧风的风

mac系统下Eclipse + pydev配置python Interpreter mybatis在spring(Controller) 中的事务配置问题 IT经理工作职责 淘宝数据魔方技术架构解析 使用 python 开发 Web Service 安装配置Django开发环境(Eclipse + Pydev) 又拍网架构-又一个用到python的网站 SQL SERVER分页写法 nhibernate的分页方法 令人崩溃的nhibernate配置 SQL Server 2008 收缩日志 清空删除大日志文件 访问IIS时,名称以无效字符开头。。。解决方案 IIS fastcgi 超时处理 Delphi错误:Stack overflow的解决方法 某公司面试是在的解决方法 jsforum研究。一个比较简单的论坛。 关于eclipse无法自动编译的问题 Myeclipse 文件夹src下的内容、WEB-INF\classes下的内容 - 萧风的风 - 博客园 OSChina底层数据库操作的类(QueryHelper)源码
spring 整合mongodb报NoSuchMethodError错误
萧风的风 · 2016-10-06 · via 博客园 - 萧风的风

刚开始通过网上查到相关的资料进行了一些配置,参考链接:http://www.open-open.com/lib/view/open1454374782167.html

maven的dependencies如下:

<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

<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: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.springframework.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-factory id="mongoDbFactory" host="127.0.0.1" port="27017" dbname="webusi" />
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> </bean> </beans>

测试后一直提示,mongoTemplate创建时报错:

Error creating bean with name 'mongoTemplate' defined in ServletContext resource [/WEB-INF/mvc-dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.data.mongodb.core.MongoTemplate]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError

后来重新调整了spring-core的版本为4.1.3.RELEASE后,就ok了,难道真是版本不兼容的问题??

再次将spring-core版本调整为4.0.6,居然又不报错了,真是够诡异的。。。