title: HTTP Status 400 - Required String parameter 'walletName' is not present
body: <p>I work with <code>Java/ Spring MVC RESTful</code> app and get <code>400 HTTP status error</code> while doing a <code>POST</code> request. The <code>@RestController</code> method is provided, </p>
  
  <pre><code>@RequestMapping(value = "/generateAddress", method = RequestMethod.POST)
      public ResponseEntity&lt;WalletInfoWrapper&gt; generateAddress(@RequestParam("walletName") String walletName,
                                                               @RequestParam("currencyName") String currencyName) {
  
          logger.info("walletName {} and currencyName {}", walletName, currencyName);
  
          // return if the wallet name or the currency is null
          if (Objects.isNull(walletName) || Objects.isNull(currencyName)) {
              return new ResponseEntity&lt;WalletInfoWrapper&gt;(HttpStatus.NOT_ACCEPTABLE);
          }
  
          WalletInfo walletInfo = walletService.generateAddress(walletName, currencyName);
  
          if (Objects.isNull(walletInfo)) {
              return new ResponseEntity&lt;WalletInfoWrapper&gt;(HttpStatus.NOT_ACCEPTABLE);
          }
  
          WalletInfoWrapper walletInfoWrapper = new WalletInfoWrapper();
          walletInfoWrapper.setName(walletInfo.getName());
  
          return new ResponseEntity&lt;WalletInfoWrapper&gt;(walletInfoWrapper, HttpStatus.CREATED);
      }
  </code></pre>
  
  <p>The <code>POST</code> request in the <code>Postman</code> provided below, </p>
  
  <p><a href="https://i.stack.imgur.com/aUQvF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aUQvF.png" alt="enter image description here"></a></p>
  
  <p>The error message informs, <code>Required String parameter 'walletName' is not present</code></p>
  
  <p><a href="https://i.stack.imgur.com/otTuh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/otTuh.png" alt="enter image description here"></a></p>
  
  <p>I can also provide the code for the <code>services</code> and the <code>dataase</code> layers for observing the drop-down operations. What is the issue here?</p>
  
  <p><code>UPDATE</code></p>
  
  <p>I updated the <code>Postman</code> request like this and still having the same error, </p>
  
  <p><a href="https://i.stack.imgur.com/iEOR5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iEOR5.png" alt="enter image description here"></a></p>
  
  <p><code>UPDATE 1</code></p>
  
  <p>I still have the same issue, </p>
  
  <p>I <code>POST</code> with the data, </p>
  
  <pre><code>{"walletName":"puut","currencyName":"Bitcoin"}
  </code></pre>
  
  <p>The code is provided below, </p>
  
  <pre><code>@RequestMapping(value = "/generateAddress", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
      public ResponseEntity&lt;WalletInfoWrapper&gt; generateAddress(@RequestBody WalletWithMoneyRequest walletWithMoneyRequest) {
  
          String walletName = walletWithMoneyRequest.getWalletName();
  
          String currencyName = walletWithMoneyRequest.getCurrencyName();
  
          logger.info("walletName {} and currencyName {}", walletName, currencyName);
  
          // return if the wallet name or the currency is null
          if (Objects.isNull(walletName) || Objects.isNull(currencyName)) {
              return new ResponseEntity&lt;WalletInfoWrapper&gt;(HttpStatus.NOT_ACCEPTABLE);
          }
  
          WalletInfo walletInfo = walletService.generateAddress(walletName, currencyName);
  
          if (Objects.isNull(walletInfo)) {
              return new ResponseEntity&lt;WalletInfoWrapper&gt;(HttpStatus.NOT_ACCEPTABLE);
          }
  
          WalletInfoWrapper walletInfoWrapper = new WalletInfoWrapper();
          walletInfoWrapper.setName(walletInfo.getName());
  
          return new ResponseEntity&lt;WalletInfoWrapper&gt;(walletInfoWrapper, HttpStatus.CREATED);
      }
  </code></pre>
  
  <p>The <code>POJO</code> is provided,</p>
  
  <pre><code>private class WalletWithMoneyRequest {
  
          String walletName;
  
          String currencyName;
  
          public WalletWithMoneyRequest(String walletName, String currencyName) {
              this.walletName = walletName;
              this.currencyName = currencyName;
          }
  
          public WalletWithMoneyRequest() {
          }
  
          public String getWalletName() {
              return walletName;
          }
  
          public String getCurrencyName() {
              return currencyName;
          }
  
          public void setCurrencyName(String currencyName) {
              this.currencyName = currencyName;
          }
  
          public void setWalletName(String walletName) {
              this.walletName = walletName;
          }
      }
  </code></pre>
  
  <p>This is the error message,</p>
  
  <p><a href="https://i.stack.imgur.com/MMnt0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MMnt0.png" alt="enter image description here"></a></p>
  
  <p>Here ia the Tomcat server info, </p>
  
  <pre><code>org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver: 08/19/2017 19:45:55 - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of `mobi.puut.controllers.WalletRestController$WalletWithMoneyRequest` (although at least one Creator exists): can only instantiate non-static inner class by using default, no-argument constructor; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `mobi.puut.controllers.WalletRestController$WalletWithMoneyRequest` (although at least one Creator exists): can only instantiate non-static inner class by using default, no-argument constructor
   at [Source: (PushbackInputStream); line: 1, column: 2]
  </code></pre>
  
  <p><code>Tomcat Localhost log</code></p>
  
  <p><a href="https://i.stack.imgur.com/QvZzE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QvZzE.png" alt="enter image description here"></a></p>
  
  <p><code>Tomcat Catalina log</code>
  <a href="https://i.stack.imgur.com/w6osh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w6osh.png" alt="enter image description here"></a></p>