简体   繁体   中英

Windows - jboss on docker, connection refused to local oracle database

I have Jboss running in a docker container. On jboss I have defined a connection to the xa-datasource database as the ip address of my computer and not localhost because I work in Windows 10 . Despite the correct ip and port to the database ( oracle ) I keep getting the connection refused error . I run jboss with the command

docker run -d -p 8080:8080 -p 9990:9990 myjboss

Can anyone help me, or do I need any additional settings in my docker. I will add that I also test alpine and in the container ( exec ) I can ping my ip address.

Thanks a lot for all the answers. I would like to add that I tested all other solutions contained in similar questions, but unfortunately I did not get the expected results.

If you can ping your host IP, but you can't connect to the database, granted that the DB is running and the listener is up...

I'd advise you to check the Windows Firewall settings.

Maybe try disabling it to check if you can actually connect to the database, if so, add an Inbound Rule to the firewall to allow connections on port 1521 (or whatever port your listener is running on)

I solved this problem by using not ip/localhost but host.docker.internal as described here -> https://docs.docker.com/docker-for-windows/networking/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM