Jackson ObjectMapper() constructor throws NoSuchMethod

后端 未结 9 1829
忘掉有多难
忘掉有多难 2020-12-09 03:40

I\'m using Jackson sample code to deserialize a POJO:

ObjectMapper m = new ObjectMapper();

This line throws a NoSuchMethodError:

         


        
9条回答
  •  隐瞒了意图╮
    2020-12-09 03:52

    Yes, anyone who is facing this issue, he should definetely investigate the dependencies with

    mvn dependency:tree -Dincludes=org.codehaus.jackson
    

    In my case, I had a jackson dependency on Atmosphere-Socket-io :

    
            org.atmosphere
            atmosphere-socketio
            2.2.1
            
                
                    org.codehaus.jackson
                    jackson-mapper-lgpl
                
                
                    org.codehaus.jackson
                    jackson-core-lgpl
                
            
        
    

    It took me several hours to track that down, thank you all guys for the above solutions which inspired me! Keep up the good work!

提交回复
热议问题