1. 程式人生 > >Spring結合mongotemplate遇到的問題

Spring結合mongotemplate遇到的問題

Spring整合mongotemplate遇到的問題

需要jar包有:spring-data-commons,spring-data-mongodb

  • mongodb版本在1.6以上,需要Spring版本在4.0以上
  • 降了mongodb版本的同時,還需要降低commons的版本(我的Spring是3.2)
  • 最終mongodb是1.5.2,commons是1.11.2,問題又來了
  • java.lang.NoClassDefFoundError: org/springframework/core/DefaultParameterNameDiscoverer
  • This class is available since 4.0. Look at here

    Class DefaultParameterNameDiscoverer

    You should upgrade spring-core artifact to 4.0 version.

  • 最終還是沒能在3.2的Spring中整合使用mongotemplate

最後的最後,希望有大神級別的大神能夠告知一下如何操作!!!!謝謝!!!!!