0
votes

I'm using spring-boot with web flux and have been trying to hit a basic get on postman which just is supposed to return a string but I'm getting an internal server error. I'm using IntelliJ. Also, no error in the console, and when I try to debug it doesn't get into any class. Below is the code I have:

@RestController
@RequestMapping("/home")
public class Controller {

    @GetMapping
    public Mono<String> printHome() {
        return Mono.just("Welcome to Home");
    }
}

Application.properties: 

server.port=8080

spring.data.mongodb.database=home
spring.data.mongodb.port=27017
spring.data.mongodb.host=localhost

spring.main.web-application-type=none
1
What is the Error log in the server? without that no one will be able to help you at all. - ThilankaD
@ThilankaD I'm unable to reproduce the issue because of a lot of changes that I did in my code now but the it looks something like the below but a 500 internal server error { "timestamp": "2021-07-15T19:57:27.205+00:00", "path": "/", "status": 404, "error": "Not Found", "message": null, "requestId": "68373fe6-28" } - RenuR
Try to use only @RestController on the class and @GetMapping("/home") on the method. Then call localhost:8080/home on the browser - Felipe
Also use spring.main.web-application-type=REACTIVE or complete remove that line from your config - Felipe
this question is impossible to answer with the amount of information given. Voted to close - Toerktumlare

1 Answers

1
votes

try this-

just remove this line

spring.main.web-application-type=none  //Delete it