Requesting API service from docker container fails - java

I have a docker container running java program, which is using API service of a third party. When I run the jar file on ec2 machine, it works well and gets connected to service and fetches the data also but when I containerize the jar file, it doesn't connect to the API service. API service exposes itself on port 14002. I do understand that container can send the things out but cant receive anything unless we tell it to do.
Can anybody tell me, how do I tell my java program to get the service of API running on 14002 port?
Thanks

thanks all for your comments here. I was able to resolve this issue, simply by changing the base image from FROM openjdk:8-jdk-alpine to FROM openjdk:8-jdk. In the alpine image, I was not able to ping the api dns from inside the container usining telnet. But after changing it to only openjdk:8-jdk, I was able to ping the external dns. So it was the issue in image

Related

How to make a local test server for an android app?

I basically need to create a test server, something that I can use locally to perform tasks for my application.
So my android app is basically a search engine, however the search queries will be made on the server and the results then fetched from the server on the mobile device as JSON objects.
Is there any way to replicate this functionality locally? I would just like to set up a server, include the Spring framework, the Google Custom Search API and develop it all in Java, then ship it to a live server directly when it's finished. (Most presumably a free tier Amazon AWS server, either EC2 or Lambda, not sure what the difference is).
Not quite sure where or how to get started so any help is appreciated, thank you!
p.s. I may try dabbling in some machine learning at a later date, but I don't know if this will affect anything, this will most likely be after I've got a live server up and running.
EDIT: Sorry, so how would I fetch data from a local server from my mobile device? Do I need special software? Do I need to configure a local server? How can my mobile device fetch data from a second project when its being run on the first?
My app will fetch data from a server, so how can I create a dummy server, for it to fetch data from? Will I need to create a fully functioning online server, or can this just be done through creating a local server of some sort and then simply plugging my android device in and running the code? I have absolutely no idea how to test it without putting it online.
You can run a local installation of Tomcat server on your own machine.
Access the server by visiting "http://localhost:8080/" (or) http://127.0.0.1:8080". You can basically listening to your own local machine / host's 8080 port. Sometimes, it could be port 80 instead of 8080.
Please explore on how to host a Spring or Java application on a local server.
A good starting point would be to learn J2EE or Enterprise Java. You can configure Databases from your local installation.
If you opt for PHP as your language on server side, there is a pre-defined package called WAMP (for Windows), LAMP (for Linux), MAMP (for MAC) and XAMPP.
The above package are nothing but a package which contains a Server, Database and a Server side language usually PHP, if needed Python or Perl.
Please explain in which step you are getting issues so that anyone can help you exactly.

unable to access web application deployed on azure container service

I am trying out azure container services with docker swarm as orch. i am an aws guy and completely new to azure and it has been really tough to get it to work so far.
i followed the azure dashboard to create a container service which created a resource group. i was able to tunnel in to the swarm-master and run docker commands on the swarm-master. the containers launched successfully too but im unable to access the deployed web app. i tried 80 and 8080 ports. i tried pinging the public IP and dns of the swarm-agent, the pings timed out with message Request timeout for icmp_seq 0 in aws similar issues can be resolved by setting inbound security rules but in azure it seemed like they are already set. Can someone please tell me if im missing something.
following is the guide i followed:https://www.youtube.com/watch?v=-wjxpng6jYs
Please try looking at this guide: https://blogs.msdn.microsoft.com/jcorioland/2016/04/25/create-a-docker-swarm-cluster-using-azure-container-service/
The service should be available by accessing the service port on the agent's load balancer's public ip.
If it's not running on port 80, you need to open NSG ports manually.
Please offer more details about the steps you've taken exactly if this doesn't unblock you. What container image? Why are you trying both 80 and 8080? Etc.

How can I access a service installed on Kubernetes from anywhere?

I am working on a mac machine and installed the latest Kubernetes and followed the example here (this is for dev’t purpose). All went smooth but I was hoping that Kubernetes provide me an ip address and port number where my service will be listening to so that I can access it from anywhere.
Please correct me if I am wrong.
I was able to run ifconfig as well as curl $(minikube service hello-minikube --url) and I was able to see the ip address and port but I wasn’t able to access it outside command line where Kubernetes lives in.
The reason I am trying to access it outside the VM is because we have other projects that run on other machines and I wanted to call the REST service I installed while we are on dev env. This way we don’t have to wait until the service is pushed to production.
FYI: This is my first micro service project and I would appericiate your feedback.
I followed the steps in the article you linked and it works as expected.
Just do:
minikube service hello-minikube --url
You will get a url like http://192.168.99.100:32382/ - the port and IP could and will change for you. Also note that the exposed port will be a random port like the 32382 and not 8080 that the pod uses.
Use the url in your browser, say and you should be able to see the output of the service.

How to access Jade Main Container via internet?

I am working on an Agent based application and i want to access agents running on a container in a machine. I am using jadeGateWay to connect to Main container. It is working in localhost but when i run the jadeGateWay on a server it doesn't connect eventhough correct IP address of the jade main container are given. Can anybody suggest me a work around? Thanks in advance.
I suggest you, for the beginning, that you try to make the connection using jadegateway in the same machine, if works, try to do the same in other machine, as you want. If do not works, you could send more information about the problem.
And if you did not read yet, it's interesting read the jadegateway api on: http://jade.tilab.com/doc/api/jade/wrapper/gateway/JadeGateway.html.

Not able to access webservice from same network java

My webservice is running on jboss and client is on the tomcat
both client and webservice is running perfect on my local machine.
but if i setup client on another machine, the client program giving an error message 404 not found
I have shared my jboss over network and i am able to access webservice wsdl from another machine using http:192.168.1.26:8080/FalconServer/SearchService?wsdl
I set the same url in Client code.
but it won't work, any help
I wanted to put this as a comment, but i dont seem to find a comment button.
Did you start your jboss binding to your ip address. One way to do that:
run -b

Categories

Resources