ServerSocket in Java application running in Azure Virtual Machine with Ubuntu? - java

I've created an Ubuntu Virtual Machine in Microsoft Azure and uploaded a Java application which uses a java.net.ServerSocket to handle incoming messages I send - with java.net.Socket - to port 20000. This application works perfectly in any machines, but it can't receive any connections when running in Azure VM.
I realized that the VM won't answer for pings and traceroutes, but I can connect to it using SSH (PuTTY) and also send files using PSCP. I've already configured endpoints on Azure - with the public and private ports (20000). I also tried to disable firewalls on VM, but never successfully. VM isn't reachable.
What more can I try? Thanks in advance.

Related

Remote Profiling in Jprofiler

I have my sample java application running on port 9010 in one of my Azure VM with an IP let say xxx.xx.xx.254. I have installed Jprofiler in another Azure VM, with IP xxx.xx.xx.159. How can i profile the application from xxx.xx.xx.159 (Both machines are Windows)?
I have tried remote profile using direct connection, but it couldn't connect. Also checked with SSH, that too failed as 'Connection timeout'
Is there any step by step process for this connection?
Solution to the problem, how to connect and profile the Remote application from my local machine using JProfiler
"Direct connection" means that you can connect to remote machine on the selected profiling port (8849 by default). This is usually not the case unless the remote machine is on a private network because firewalls will prevent the connection. Also, in that case you must have added the -agentpath VM parameter for loading the JProfiler agent to the start command of the profiled JVM. This parameter can be obtained by invoking the "Session->Integration Wizards->New Remote Integration" wizard.
With SSH connections in JProfiler, you can tunnel the connection through SSH. This will work if you have an SSH server running on the remove machine. SSH connections work for VMs where the JProfiler agent has been loaded with the -agentpath VM parameter as well as in attach mode for all JVMs that are running on the remote system.
The related documentation is available at
https://www.ej-technologies.com/resources/jprofiler/help/doc/main/profiling.html

Hosting Java Server on LInux Virtual Machine

I am trying to host a Java server on Linux (Ubuntu 13) virtual machine on VirtualBox. I have to connect a client locally to the server via sockets. I am having trouble setting up the ip address and port for the client to find the server socket on the virtual machine.
you should get the IP address on the VM
then ping the IP address from your CMD, if it's ok, then trying to run Java program, if not, you should focus on the VM configuration.
About your code, you can always run a Java socket server just on Windows and using a Java client to connect, after successfully test the code. You can launch the server code in VM.

Why are there other apps trying to connect to my Azure port?

I'm new in Azure and I'm having some troubles here. I'm implementing a JAVA server application on my Azure VM. It's listening for requests from an Android client. I have tested the java server app on my machine and it works great. When I run the same java server application on my Azure VM it looks like there are other apps trying to connect through the same port. I have checked and every single time I change the port it happens again (it happens when the firewall is down, when I don't shut down the firewall it doesn't even receive a single request).
I have a message showing when there is a connection through the port 4567 and couple seconds after I start my server app it shows that there is a connection from a similar IP than the one I have assigned and I haven't yet run my android app. I configured the endpoints, and I even shut down the firewall and it is giving the same issue. The client app and the server app are working perfectly if I run the server on my local machine. Help would be really appreciated, thanks in advance.
What you might be seeing is the way Azure manages/monitors public Endpoints. When you expose a public endpoint for your VM Azure will behind the scenes periodically test that port to make sure it is up and listening for traffic. This is part of the way Azure manages load balancing for public Endpoints. Because of this, if you watch connections to your the local port on your VM to which the public endpoint is mapped, you will see connections from Azure internal IPs.

connect remote MQ using Java?

Friends,
I installed IBM explorer 7.1 which have server and GUI. Locally I connected the queue using inter process communication. Now I need to connect the server QM from remote machine using java standalone program.
In server I have created a queue, port and server channel. when I trying to connect using host name , unable to get the connection. Is this the right way?. else I have to install client where I tried connect that server.but getting error code 2035 when i run that java program. listener and queue manage is running in remote machine. Some forum i seen that AMQCLCHL.TAB file using for client connection. I had confusion whether i have to use that for client connection. if yes how i can use that?

Testing a client/server Java application on a virtual machine using VirtualBox

I'm testing a client-server based Java application where a specific scenario involves having both the client and server running on the same host (i.e., the client connects to the server running on localhost). This seems to work fine except for when I test this scenario on a virtual machine (running 32bit Windows 7) using VirtualBox.
Note: Everything henceforth is running inside the virtual machine. I start the server and try to connect to it using the client but the connection times out. Surprisingly, I tried connecting to the server using putty and the connection behaved as expected. Both the Java client and putty tried to connect to localhost - the client failed but putty succeeded.
Does anyone have a possible explanation for why this might be happening?
Note: This is not a duplicate of Addressing localhost from a virtualbox virtual machine
How do you connect to the localhost? By connecting to the hostname "localhost"? You could try connecting to the InetAddress returned by getLocalHost()

Categories