Unable to access my spring boot API on another computer when its port is in use on that computer - spring

I made an API on spring boot in one pc, and started it on localhost. I can access it on that pc and on any other pc using it's IP address.
However, I was got a time out error when attempting to access the API from a friend's laptop, and found out that he was running another spring boot api on the same port as the one my api was running on in my pc. After changing it, the api could be accessed.
I asked my project manager, and he says that this shouldn't happen, that there was no connection between the ports on my original pc and this one. However, this is practically not the case. Can anyone explain why this happened?

Related

unable to access spring boot application deployed in centos 9 server : request time out

My application was developed in Spring Boot, MySql. My server is running on CentOS 9 Stream. port 8080 is ocupied by Jenkins. So I have deployed it in a different port 8081. But my problem is when I am trying to access the API from the postman, it is taking a long time and at last showing message request time out.
How I can resolve it?
I am also facing the same issue in the time when trying to access the MySQL from DBear, it is taking a long time to connect and after that telling that request time out.
After searching in the i think the issue is with the port availability from the server. Guide me so that when I will deploy an application it will be available. I am also Apache web server.
maybe you have some rules on 8181 port, to check all the policy on Linux firewall get all the rules of iptables in cent-OS by this command.
sudo iptables -S

Not able to access REST APIs hosted on ubuntu VM from windows browsers

I'm working on windows 10 and installed ubuntu virtual machine on it. In ubuntu VM, Laravel REST API service is running on port 80. When my front-end application (on windows browser) tries to call/access these REST APIs, the application is getting "503 Service Unavailable" as response. But if I try to ping to this server, it is sending and receiving some bytes of data. Only curl call and windows browsers are not able to access these REST APIs.
However, In another ubuntu VM (say vm2), if I try to fetch resource from these REST APIs, sometimes it works and sometimes it gets the response same as that of windows browser (503). This is a weird behavior on vm2, since it cannot be predicted when the API call succeeds and when not.
I have checked:
hosts file in windows
port-forwarding in virtual box
apache2 configurations
But nothing worked so far. Any help would be appreciated.
Thank you.

Turning laptop into a server to run spring tool suite over the internet

I am trying to run a website from my computer using Spring Tool Suite (STS). Using pivotal tc Server I can access this website that I made by running the server and using localhost:8080 as a url.
My laptop contains other software that is permitted to only run in the laptop and it is needed to run my code in Spring tool suite.(School policy to SSH's into another computer to get access to my database; it is a requirement)
How would I be able to access that website that is running in my laptop that uses pivotal tc Server. Please assume I know nothing about IP address and DNS. Also, assume that I can move my laptop around like a mobile device.
To solve this problem you need to tunnel to your local machine

Work with Web API and Windows Phone

I am developing a solution that is composed of two elements: a web server, which publishes some REST services, and a mobile client, which consumes those services.
To implement the REST services I have used the Web API technology.
When I start the web project in debug, everything works fine. I can use the services by pointing to localhost:63954/api. A weird fact: if I change "localhost" with "127.0.0.1" or with the LAN address of the machine, 192.168.xxx.xxx, the server does not answer anymore!
Then, when I start the Windows Phone client, which runs in a virtualized emulator, it fails to connect to the web server! Even if the two components are running in the same machine.
Obviously, in Windows Phone I cannot use the "localhost", since the localhost of the phone is the phone itself. So I'm trying to use the 192.168.xxx.xxx address which is the address of the machine that is running the web service. But the mobile phone emulator fails to reach the webservice.
I need to run the Web Server in Visual Studio 2012, since I need to debug it, and to make it reachable from the Windows Phone Emulator, but I do not know how to do it. Can you help me? Any idea?
Thank you so much,
Riccardo.
EDIT: By following the link found here (Binding IIS Express to an IP Address) and by turning off my firewall I can run the web application outside VS12 and I can make it reachable from other pc in the network, and so also from the WP emulator. This could be a work-around, but I cannot debug the REST service in VS in this way and this is not good...
The Windows Phone 8 emulator works as a separate machine on your network, with it's own IP address and configuration. Therefore, for the emulator to be able to access your service you will need to make sure that the port you are trying to access is open for inbound connections.
As you mentioned the windows phone is running seprate in your client machine,One way of solving this problem is ,Binding your machine's Ip address to the Web Api,SO the Web api can be accessed using the Machine's Ip address.You can Bind the ip address to the project by using Microsoft Webmatrix.
So,You can access the web Api using the Ip address.Hope this helps.

Slow access to Tomcat web application from another PC

The access to my web application running Windows 2008 Server on localhost is fast; however, when I tried to access the web application through another PC (exp: http://xxx.xxx.xxx.xx:8080/appname) is takes about one minute to load a simple login page. Any input regarding this matter is much appreciated.
Further information, the firewall is already off and the setup within a LAN environment without Internet access.
With this little information it is almost impossible to debug your situation. However, I'll take a guess based on what you've provided.
If you're running on an internal LAN, the problem is likely that you don't have reverse DNS configured for your server. Your server has some made-up name for which only forward-DNS exists. When Tomcat receives a request it tries to look up the hostname based on the IP address, and this can take a long time to time-out.

Resources