title: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/naming/NameCode error in setting up restful webservice in spring 4.3.1
body: <p>I want to create rest controller in spring but I get this error : </p>
  
  <blockquote>
    <p>org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name
    'org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0'
    defined in ServletContext resource
    [/WEB-INF/mvc-dispatcher-servlet.xml]: Initialization of bean failed;
    nested exception is java.lang.NoClassDefFoundError:
    com/thoughtworks/xstream/io/naming/NameCoder</p>
  </blockquote>
  
  <p>These jar files were added to my project correctly :
  jackson-annotations:2.1.1/
  jackson-core:2.1.1/
  jackson-databind:2.1.2</p>
  
  <pre><code>&lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
                &lt;version&gt;${spring.version}&lt;/version&gt;
            &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;4.2.0.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.thoughtworks.xstream&lt;/groupId&gt;
              &lt;artifactId&gt;xstream&lt;/artifactId&gt;
              &lt;version&gt;1.3.1&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-oxm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
              &lt;version&gt;2.1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
  
      &lt;/dependencies&gt;
  </code></pre>