title: Way to deserialize the byte array in spring java
body: <p>I doing project to upload the image, for that I converted the image into base64 string, now in my DTO i have deserialized the byte array as follows : </p>
  
  <pre><code>class DecodePhoto extends JsonDeserializer&lt;byte[]&gt; {
      @Override
      public byte[] deserialize(JsonParser jsonparser, DeserializationContext arg1)
              throws IOException, JsonProcessingException {
  
          String data = jsonparser.getText();
  
          try {
              byte[] decodedBytes = org.apache.commons.codec.binary.Base64.decodeBase64(data);
  
              return decodedBytes;
  
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
  
      }
  
  }
  </code></pre>
  
  <p>After ajax call in image, I have got the following error as follows :</p>
  
  <blockquote>
    <p>java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.decodeBase64(Ljava/lang/String;)</p>
  </blockquote>
  
  <p>What is the problem here? I have attached jar <strong>common-codec-1.9.jar</strong> and <strong>jackson-databind-2.3.2.jar</strong></p>
  
  <p>But in debugging mode (Class File Editor) it shows as follows</p>
  
  <blockquote>
    <p><strong>The JAR file jackson-databind-2.3.2.jar has no source attachment.</strong> </p>
  </blockquote>
  
  <p>Kindly do me favour to deserialize the byte array ?</p>