hi guys, i am getting ```finishConnect(..) failed:...
# spring
g
hi guys, i am getting
Copy code
finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80; nested exception is io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80
org.springframework.web.reactive.function.client.WebClientRequestException: finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80; nested exception is io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /[0:0:0:0:0:0:0:1]:80
from a rather simple springboot-kotlin code. Has anyone encountered this? Thanks in advance 🙂
Repo: Controller:
Copy code
@SpringBootApplication
class SpringVarPathIssueApplication

fun main(args: Array<String>) {
    runApplication<SpringVarPathIssueApplication>(*args)
}

@RestController
class SimpleRestReactiveController {

    @GetMapping("/get")
    suspend fun getMapping(): String {
        return "todo"
    }

}
Test:
Copy code
@SpringBootTest
class SpringVarPathIssueApplicationTests {

    private val webClient = WebClient.builder().build()

    @Test
    fun testSimpleController(): Unit = runBlocking {

        val response = webClient
            .get()
            .uri("/get")
            .retrieve()
            .awaitBody<String>()

        println("response: $response")
    }
}
c
you’re making an http call to an IP address where no one is listening. looks like the code doesn’t specify a hostname.
g
you mean like this
Copy code
uri("localhost:8080/api")
?
yup i indeed missed the hostname... (i am dumb 🙃) Thanks for the help!
927 Views