Ich konfrontiert mit einem bestimmten Problem: Mein Ruhe-Controller funktioniert für einige Stunden, als ich nicht weiß, warum, wenn ich eine Anfrage an sie. Es reagiert nicht. Ladeprozess im Browser wartet auf eine Antwort für eine Weile. Wenn ich eine Anfrage mit einem POST senden möchte, kann ich sehen, dass diese Anfrage an den Controller ging, aber keine Antwort erhalten hat. Ich habe versucht, App zu debuggen, ich habe einige geplante verarbeitet - sie arbeiten. Aber Controller nicht. Die Anfrage erreicht den Controller nicht. Es blieb vorher hängen. Wie kann ich herausfinden, wo das passiert? Vielen Dank. Das ist meine Controller-Klasse:Feder MVC Controller stucked und nicht reagiert
@RestController
@RequestMapping("/quotes")
public class QuotesController {
private final QuotesService quotesService;
@Autowired
public QuotesController(QuotesService quotesService) {
this.quotesService = quotesService;
}
@RequestMapping(value="", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<LoadedFileInfo>> getLoadedFilesData(){
List<LoadedFileInfo> result = quotesService.getLoadedFilesData();
return new ResponseEntity<List<LoadedFileInfo>>(result, HttpStatus.OK);
}
@RequestMapping(value="/currencyPairs", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<CurrencyPair>> getCurrencyPairs(){
return new ResponseEntity<List<CurrencyPair>>(quotesService.getCurrencyPairs(), HttpStatus.OK);
}
@RequestMapping(value="/oneMinute", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getOneMinuteQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getOneMinuteQuotes(from, to, currencyPair), HttpStatus.OK);
}
@RequestMapping(value="/fiveMinutes", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getFiveMinutesQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getFiveMinuteQuotes(from, to, currencyPair), HttpStatus.OK);
}
@RequestMapping(value="/fifteenMinutes", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getFifteenMinutesQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getFifteenMinuteQuotes(from, to, currencyPair), HttpStatus.OK);
}
@RequestMapping(value="/thirtyMinutes", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getThirtyMinutesQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getThirtyMinuteQuotes(from, to, currencyPair), HttpStatus.OK);
}
@RequestMapping(value="/oneHour", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getOneHourQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getOneHourQuotes(from, to, currencyPair), HttpStatus.OK);
}
@RequestMapping(value="/fourHours", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getFourHourQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getFourHourQuotes(from, to, currencyPair), HttpStatus.OK);
}
@RequestMapping(value="/oneDay", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getOneDayQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getOneDayQuotes(from, to, currencyPair), HttpStatus.OK);
}
@RequestMapping(value="/oneWeek", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getOneWeekQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getOneWeekQuotes(from, to, currencyPair), HttpStatus.OK);
}
@RequestMapping(value="/oneMonth", method= RequestMethod.GET, produces = "application/json; charset=utf-8")
public ResponseEntity<List<Number[]>> getOneMonthQuotes(@RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime from, @RequestParam @DateTimeFormat(iso= DateTimeFormat.ISO.DATE_TIME) LocalDateTime to, @RequestParam Integer currencyPair){
return new ResponseEntity<List<Number[]>>(quotesService.getOneMonthQuotes(from, to, currencyPair), HttpStatus.OK);
}
}
helfen kann, ist es für alle Controller oder nur eine? Sehen Sie Fehler in den Protokollen? Hast du einen Thread-Dump versucht? Hast du eine visualVM angeschlossen? Welcher Anwendungsserver? –
Es ist ein SpringBoot. Ich habe nur einen Controller. Es gibt keine Fehler in den Protokollen.Ich habe Thread-Dump nicht ausprobiert und VisualVM nicht verbunden – migAlex
Können Sie Controller-Code, den Sie für den REST erstellt haben, veröffentlichen. – srinivas