Jprofiler Connection error from GUI to remote server - java

As I am testing Jprofiler, I was able to connect from my local GUI to remote server for couple of days. Now suddenly I am getting connection error. Nothing is changed on my local machine or remote machine. Java-version and path is correct for both local and remote server. The port is listening to no other application.
error is
"Either an old version of the native library is used or another application is listening on port 8849. Please check your PATH environment variable and your port configuration"

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

How to connect remotely via tcp to the h2 database?

I am trying to start H2 in server mode to connect an application from another computer. But no matter how hard I have tried, I have not succeeded.
I have seen the documentation and to start the server from the command line is executed:
java -cp h2-2.1.214.jar org.h2.tools.Server -tcpAllowOthers
output:
TCP server running at tcp://127.0.1.1:9092 (others can connect)
PG server running at pg://127.0.1.1:5435 (only local connections)
Web Console server running at https://127.0.1.1:8082 (others can connect)
now from the other pc, as I understand I must execute the connection in the following way:
jdbc:h2:tcp://[server][:port]/[path]/[databaseName]
then it should be:
jdbc:h2:tcp://127.0.1.1:9092/home/mateo/database
But I have read that 127.0.1.1 only works locally. I have also noticed that when I open H2 Console in the examples I have seen, the machine's ip appears, that is to say: 192.168.X.
What am I doing wrong?
(Update)
I am currently using Linux.
I have launched the server from Windows and managed to connect it from Linux successfully following the above steps. But, I still don't understand why it doesn't work in Linux, in Windows it loads the server with the IP address of the machine. It makes me think that I have to do some additional configuration for Linux.
server running
You need to replace local IP address in your JDBC URL with real non-local IP address of your server (jdbc:h2:tcp://127.0.1.1:9092/*** -> jdbc:h2:tcp://192.168.1.4:9092/***, for example). H2 listens all network interfaces of the host, it doesn't matter which address was reported in “runnig at …” message.
You also may need to protect ports 8082 and 9092 from connections from untrusted systems if you have them in your internal network and from connections from external network (make sure your router or whatever you have doesn't redirect connections to the host with database server).

Open a port on VMWare Player: Connection Refused error

I need to open a port on a VMWare Player VM but getting Connection Refused error.
(I have read many other Q&A on same, but many of them focus on VMWare workstation.)
Scenario:
I need to remote debug a Java application running inside a VM.
Host OS and VM OS are both Ubuntu.
I can access Webserver running inside VM via browser, using https. Which mean 8443 is open on VM. For this I didn't have to do anything.
Now, I have my code in IntelliJIdea running on host. I want to attach the debugger to process running inside guest VM. I have tried to open port 6006 and 8998.
I have ensured:
firewall ufw is inactive in both host and guest
Java app debug port is open. I checked this by running a debugger (jdb) locally on guest. I could connect to Java debug process. But same thing from host OS doesn't work.
What I have tried already:
editing /etc/vmware/vmnet8/nat/nat.conf and restarting vmware process after that.
SSH tunnelling: mapped local port to remote port using
sh -L 6006:<guest_name>:6006 <user>#<guest_name>
In all cases, I keep getting connection refused error.
Appreciate your help in advance.

Apache tomcat - how to open the browser in remote machine

I have a local machine , say A with IP (a.a.a.a) and a linux server, say B with IP (b.b.b.b)
Now I have created a war file with name 'example' and deployed it in Apache tomcat in our linux server.
I want to open the browser in my local machine by typing the following in address bar :
http://b.b.b.b:8080/example
But I am not able to open it.
Could any one please suggest where in lies the issue?
Note : We can connect from A to B using only VNC viewer and not able to connect it through remote desktop connection application.
Does this implies that there is some issue in network connectivity or what? I think as we are able to connect B using VNC viewer, the problem should not be there.
Please help.
++++++++++++++++
extended
I have installed the apache tomcat server in my linux server which doesnot have any internet connecttion and deployed the war file in the server successfully.
and want to open browser from my local machine using (linux_IP)//8080//war_file_name
Note : local machine connects linux server through VNC only.
Could any one suggest is it possible in this scenario?
If you can only open server B using VNC, then there is a definite possibility that port 8080 is not open. The port 8080 should be open on the server. To check that you could try :
telnet host port
so for you:
telnet b.b.b.b 8080
from your machine.
Another thing to do is to start tomcat with IP address of your linux server to listen. Start tomcat with parameters:
-b b.b.b.b (ip address of your linux machine).
To me if definitely feels like a firewall problem.

Remote Debugging in eclipse

I have an application running in server A. The dev environment is in server B.
I am trying to do remote debugging of app running in server A.
In server A i added following command to service start script
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4554,server=y,suspend=n
And service is running in server A.
When i try to launch remote debugging configuration it gives
Failed to connect to remote VM. Connection refused. Connection refused
port 4554 is free in server A.
What other configuration need to be done for this?
Regards
Dheeraj Joshi
Try this.
Set suspend=y, just to make sure you got the JVM line right. This should stop the VM on startup until you connect.
If you're on Unix, bring up the terminal and try telnet [host] [port] - this will quickly let you know if there's anything listening to that port on that host.
Make sure the connection properties in Eclipse are set correctly. Note that the port defaults to 8000.
Use the IP address instead of the host name, to rule out DNS/hostfile problems.
Another way of starting the JVM that I use successfully is:
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y
Check if there is a firewall between and/or on the two servers.

Categories