Connection to localhost:5432 refused when starting spring app

Hello everyone. I have ssh tunnel on my computer, it works fine, i can brose DB etc. in my application.yaml i have this config:
spring:
datasource:
platform: postgres
url: jdbc:postgresql://localhost:5432/dev6
username:usr
password:pwd
spring:
datasource:
platform: postgres
url: jdbc:postgresql://localhost:5432/dev6
username:usr
password:pwd
but when i try to run my spring app, i get the error that Connection to localhost:5432 refused. i read countless posts and threads on the internet, but still no help. Asked LLMs, but still no luck. Am i doomed?
10 Replies
JavaBot
JavaBot4mo ago
This post has been reserved for your question.
Hey @bambizas19! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
bambizas19
bambizas19OP4mo ago
any help?
dan1st
dan1st4mo ago
Can you access the DB from your local machine in a different way? e.g. the psql tool or DBeaver
JavaBot
JavaBot4mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Plummip
Plummip4mo ago
Ud have to tell us more about the setup. The OS of each system, the tunnels target host (containerd, WSL, remote?), DB (containerd, WSL, remote?) You could try for now: Change postgresql config file, might want to change listen_addresses to * localhost & 127.0.0.1 (the loopback adresses) do not send a packet on the network wheras using your (192.168..) does.
JavaBot
JavaBot4mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
bambizas19
bambizas19OP4mo ago
dbeaver works fine from my computer
JavaBot
JavaBot4mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
dan1st
dan1st4mo ago
Can you show the DBeaver configuration? Can you show the stack trace of the Spring application?
JavaBot
JavaBot4mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?