I have my web application running on java 8, which i need to connect through jconsole . I am able to connect jconsole without any change(i am not sure
if i did any change in the past) but my collegue is not able to connect through jconsole
We both are running java application separately on our windows machine with separate jconsole on same box.
So my question in general is do we need to do any configuration/setting to monitor java application/process from jconsole on same machine or remote machine?
Related
Can I use the Apache Guacamole API to allow a Java program to access a specific port on a Guacamole server's connection? When I say connection, I mean a machine that the Guacamole server is connected to - a machine that would show up in the Guacamole web interface.
Background:
I set up an Ubuntu virtual machine as a local Guacamole server/client. The virtual machine also runs a series of centOS (LXD) containers, each with a respective IP address. Outside of the virtual machine, on the host machine on the same network, I am able to access the Guacamole web interface via a web browser and SSH into the centOS containers just fine.
Let's say I have a Java program on my host machine that needs to communicate with one of those centOS containers. Is it possible to use the Guacamole API to allow the Java program on the host machine to programmatically access a specific port on one of the Guacamole connections/centOS containers?
If so, how would I go about doing that? I'd appreciate any specific examples or documentation related to this. If there's a better way to go about this, please let me know.
Thanks.
I have created a Java Web Application using Jetty (in Eclipse, using OSGI etc.). The application itself runs quite well (when being tested locally), so I wanted to run it on an Azure virtual machine in order to be accessible for external users (for testing reasons).
What I did so far:
created an Azure account
create a virtual machine with Windows Server running in it
downloaded all my eclipse files etc. to the virtual machine
started the application (in fact in eclipse, not the compiled jar) in the virtual machine; the application is published to port 8080
so, when i run a webbrowser in the VM and connect to localhost:8080, everything works well
but when I try to access the website from external (using my assigned domain of the VM, something.cloudapp.net:8080), it does not work
I also created endpoints in the azure management console for this VM (80, 8080, etc.)
Does anyone ever tried to run a java webapp on Azure or has a hint what could go wrong here?
By default, windows servers in Azure have the windows firewall enabled. This would block external connections to port 8080 by default. Try adding an appropriate exception to the windows firewall rules.
According to your description, I think you have correctly configured the new endpoints for the network traffic of Java Webapp. If not or incorrectly does, please refer to the article https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-create-nsg-arm-pportal/ to configure again.
Then, as #CtrlDot said, you need to configure the firewall for allowing the inbound traffic on Windows Server.
As reference, please see the article about allowing inbound traffic to a specified TCP or UDP port on Windows Server to do it.
How do I build, deploy and debug standalone java app on remote machine with IDEA ?
I have remote machine with certain hardware device connected to it. I want to develop standalone Java app on my PC, build it locally but the app should be deployed and running on remote machine accessible via SSH. Thus I'll be using Java remote debug.
I've googled extensively but couldn't understand if it's possible to achieve in IDEA (even though IDEA allows to do so for java servlet containers). I tried "Remote SSH External Tools" plugin. I'm not sure what to specify in following dialog (which seems to have bug)
What options do I have ?
If the machine is only reachable via SSH you need to do two things:
Configure your java application for remote debugging
Connect to the application via SSH
This tutorial should get you going: Remote Debug of a Java App Using SSH Tunneling
I have a java program in a weird condition where it has stopped running a certain thread.
I would like to connect to it using JMX, but I didn't provide the JMX arguments.
I could restart but then I would loss the information of the current condition.
I know that on Windows it can connect with jconsole on localhost without parameters, but my java app is running on a Linux server.
So any ideas on how to still be able to connect even without jmx parameters?
JConsole works on linux also. If the linux server have xhost or some remote displaying capability, I would just run jconsole on the linux server.
If you didn't enable JMX when the java program was started, you would not be able to connect remotely via JMX.
I found out that there is an option to dump the threads:
kill 3
Used it and found the reason.
Thank you.
I'd like to ask how I can profile REMOTELY a java application. For debugging I can say which port the JVM must listen etc since the machine I'm trying to access is behind an ssh gateway so I manually create an SSH tunnel but I've been googling about the same thing but when profiling and I couldn't seem to find. Basically I'm looking for the equivalent of this command:
java -agentlib:jdwp=transport=dt_socket,server=y,address=8000 -jar /bla/bla
but for profiling so that I can remotely attach a profiler.
Disclaimer: My company develops JProfiler
With JProfiler, the VM parameter is like this:
-agentpath:/path/to/libjprofilerti.so=port=8849
"/path/to/libjprofilerti.so" is the path to the native agent library, on Linux x86, for a 32-bit JVM it would be [JProfiler installation directory]/bin/linux-x86/libjprofilerti.so. With the port parameter, you can tell the agent to listen on a specific port. You can set this to the port of your SSH tunnel.
You can easily generate this VM parameter by invoking Session->Integration Wizards->New Remote Integration in JProfiler's main menu:
On your local machine, you create a new session of type "Attach to profiled JVM" and choose the local port of your SSH tunnel (10022 in the screen shot):