nested exception is java.lang.NoClassDefFoundError: com/mongodb/MongoSocketException

Below are my project details.

POM.xml:


    
    
    
        org.springframework
        spring-core
        4.0.6.RELEASE
    

    
        org.springframework
        spring-beans
        4.0.6.RELEASE
    
    
        org.springframework
        spring-aop
        4.0.6.RELEASE
    
    
        org.springframework
        spring-context
        4.0.6.RELEASE
    

    
    
        org.springframework
        spring-web
        3.2.1.RELEASE
    

    
        org.springframework
        spring-orm
        4.0.6.RELEASE
    

    
    
        org.springframework
        spring-webmvc
        4.0.6.RELEASE
    

    
        org.springframework.data
        spring-data-commons
        1.8.2.RELEASE
    

    
    
        org.mongodb
        mongo-java-driver
        2.11.0
        
    

    
    
    
        jstl
        jstl
        1.2
    

    
    
    


    
    
    

    
        org.springframework
        spring-tx
        4.0.6.RELEASE
    


    
    
        org.springframework.data
        spring-data-mongodb
        1.5.2.RELEASE
        
    

    

    
        commons-net
        commons-net
        2.2
    
    
        commons-io
        commons-io
        2.0.1
    
    
        org.apache.commons
        commons-lang3
        3.0
    
    
        commons-logging
        commons-logging
        1.1.1
    
    
        org.slf4j
        slf4j-api
        1.5.8
    
    
        org.slf4j
        slf4j-log4j12
        1.5.8
    
    
        org.slf4j
        jcl-over-slf4j
        1.5.8
    
    
        taglibs
        standard
        1.1.2
    

    
        asm
        asm
        3.3.1
    
    
        aspectj
        aspectjweaver
        1.5.3
    
    
        cglib
        cglib
        2.2.2
    
    
        commons-codec
        commons-codec
        1.3
    
    
        commons-collections
        commons-collections
        3.2.1
    
    
        commons-httpclient
        commons-httpclient
        3.1
    
    
        com.google.guava
        guava
        13.0
    

    
        org.apache.xbean
        xbean-spring
        3.2
    
WEB.XML is:

SpringMVCMongo

    index.jsp



    contextConfigLocation
    /WEB-INF/dispatcher-servlet.xml



    org.springframework.web.context.ContextLoaderListener



    SpringMVCMongo
    org.springframework.web.servlet.DispatcherServlet
    
        contextConfigLocation
        /WEB-INF/dispatcher-servlet.xml
    
    1  



    SpringMVCMongo
    /



Dispatcher-servlet.xml is:


    
    
    


    
    
    


    
    
    

 



    
    
    

You should upgrade mongo-java-driver version to at least 2.12.0. This is the first version to introduce MongoSocketException (an unchecked exception replacement to a former one).


spring-data-mongodb version 1.5.2.RELEASE is compiled with mongo-java-driver version 2.12.1 which is "older" than the one you've declared in your pom (2.11.0).


You should set it as the fixed dependency version for mongo-java-driver. Meaning change mongo-java-driver from 2.11.0 to 2.12.1



你可能感兴趣的:(MongoDB)