Connection refused by Spring boot app running in different docker container - rest

I have three apps running in 3 containers on the same host.
CONTAINER ID IMAGE COMMAND PORTS
3f938111c1bf registration "java -jar registration.jar" 0.0.0.0:8030->8030/tcp
cb9c4782194e security "java -jar security.jar" 0.0.0.0:8020->8020/tcp
60005507a246 main "java -jar main.jar" 0.0.0.0:8000->8000/tcp
I am able to access an endpoint of the security app from main app using an Ajax request.
The registration app calls an endpoint of security app from a java method using a RestTemplate object. This call is refused by the security app as follows.
I/O error on POST request for "http://localhost:8020/security/register": Connect to localhost:8020 [localhost/127.0.0.1] failed: Connection refused (Connection refused); nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:8020 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
I am not able to identify the issue. Note that this call is working perfectly fine when I run these apps locally through eclipse.
I am very new to the dockers. Is there a possibility that I am missing out something? Any leads would be helpful.
Thanks a lot!

When you work with docker containers/images so you need to set your configurations on them. So you must change localhost to your container name. For example:
http://localhost:8020/security/register
http://authentication:8020/security/register

Related

Unable to run the test for the webapps running in cloud/remote server ( application is accessible via browser only through VPN). Getting error

Unable to run the test for the webapps running in cloud ( application is accessible via browser only through VPN). Getting error.
You must first setup a tunnel from testRigor to your machine, then try accessing the page.
Read the tunnel documentation.
Set up a tunnel on your machine.
Request a port from testRigor support
Then run your test
Docs for setting up a tunnel:
https://docs.google.com/document/d/1MMQ9WBwRTSPUI589PKv5YxiyM7r5rE1K5iP_Dj5xl0Q/edit#

wildfly crashes with WFLYPRT0053: Could not connect to http-remoting

I have installed the wildfly application server on Ubuntu 16.04; version: 10.1.0.Final, release-version: 2.2.0.Final
The server is configured with an port-offset of 100 so that:
Http management interface listening on http://127.0.0.1:10090/management
Admin console listening on http://127.0.0.1:10090
Everything seems to work for a while:
The management interface is accessible and I have also deployed a tiny sample application which works correctly (already undeployed, therefore shouldn't be the problem). After some minutes I suddenly get the following:
jboss-cli.sh[15286]: Failed to connect to the controller: The controller is not available at localhost:9990: java.net.ConnectException: WFLYPRT0053: Could not connect to http-remoting://localhost:9990. The connection failed: WFLYPRT0053: Could not connect to http-remoting://localhost:9990. The connection failed: Connection refused
I didn't do anything, just waited. Afterwards the instance seems to be unreachable.
After days of research I'm now ending up with asking you what's wrong with my configuration or what I'm missing.
And what is trying to connect to http-remoting://localhost:9990 (it's not me) and especially why is it doing so?
Thank you very much!
It's because your management controller is unreachable.
Possible reasons could be either your jboss is down or network is not allowing you to connect to it.
You can check that by typing command: telnet
It will show you the connection

HttpHostConnectException when Validating Account in Creation of IBM Bluemix Server

Unable to communicate with server - I/O error on GET request for "https://api.ng.bluemix.net/info":Connect to 10.81.82.132:80 [/10.81.82.132] failed: Connection timed out: connect; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to 10.81.82.132:80 [/10.81.82.132] failed: Connection timed out: connect
I am getting this error when trying to create a Bluemix server in Eclipse, specifically on click of Validate Account button. I have downloaded and installed the IBM Bluemix for Eclipse plug-in but still having connectivity issues. Any help is appreciated.
The connection error is depending from the wrong IP address your internet ISP/provider is returning for api.ng.bluemix.net
Check your DNS configuration, you could run the following command
nslookup api.ng.bluemix.net
to check which DNS server is returning the wrong IP address.

Error code 503 com.microsoft.sqlserver.jdbc.sqlserverexception the tcp/ip connection to host failed

Developed a SUP HWC application that will fetch data from SQL server 2005 using stored procedure.
Application deployed successfully to the server.And I'm able to view the application from my iPhone simulator.But, when I'm trying to retrieve the data on click of a menu,getting following error.
"Error code 503 com.microsoft.sqlserver.jdbc.sqlserverexception the tcp/ip connection to host failed"
I changed my settings as per this:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed
But, still getting same error.Please help.Thanks.
Note: I have virtual MAC(where iPhone simulator is running) on my windows 7 PC.
Well, My problem got solved...As I was in client VPN, I got a different IP address.Now, I mapped to client VPN generated IP address and its working like a champ... :)

Debug points not working in eclipse for a remote application

I have a Java application running on a WebLogic server. I have kept breakpoints in the doPost() method of the servlet I want to invoke on that server.
When I invoke that servlet, it is not stopping at any of the debug points. The WebLogic port used by the application is 3304. When I give this port in the debug configuration it throws the following error:
Failed to connect to remote VM. Connection refused.
Connection refused: connect
If I give any other ports, e.g. 3305, 3303 it opens the debug view, but the application cannot be debugged.
The JVM will be running on debug port 3304 only. So other ports will not work. The error you get may be because, the debug connection to this port is already made by another machine or client, or an existing connection started by you was not terminated. You will get the exact stacktrace from eclipse, when you click on More details>.
Quick Try: Restart the JVM.(Sorry for this tip if its a production server)
Have you started the VM with these params, which exposes the correct port and starts the server in debug mode.
-Xdebug -Xrunjdwp:transport=dt_socket,address=<port number>