Sto scrivendo una semplice API REST in base al tutorial Spring-Boot this. Sulle mie macchine di sviluppo locale (Ubuntu 15.04 e Windows 8.1) tutto funziona come un fascino.Applicazione avvio a molla: nessun convertitore trovato per il valore di ritorno di tipo
Ho un vecchio server Ubuntu 12.04 LTS a 32 bit in giro su cui volevo installare il mio servizio REST.
Il registro di partenza è ok, ma non appena ho inviare una richiesta GET per l'/ {id} endpoint/utente, ottengo il seguente errore:
java.lang.IllegalArgumentException: No converter found for return value of type: class ch.gmazlami.gifty.models.user.User
E poi giù per la stacktrace:
java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.LinkedHashMap
L'intero stacktrace viene inviato here.
Ho esaminato alcune risposte facendo riferimento a questo errore, ma quelle non sembrano essere applicabili al mio problema, dal momento che sto usando Spring-Boot, nessuna configurazione xml.
Il controllore è interessata:
@RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
public ResponseEntity<User> getUser(@PathVariable Long id){
try{
return new ResponseEntity<User>(userService.getUserById(id), HttpStatus.OK);
}catch(NoSuchUserException e){
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
}
Qualsiasi aiuto sarebbe molto apprezzato. È molto strano dal momento che le stesse identiche cose funzionano perfettamente su altre macchine.
Grazie in anticipo!
soluzione https://stackoverflow.com/questions/41719142/how-to-return-a-set-of-objects-with-spring-boot/46977580 # 46977580 –