I have a Linux server where I'm running WildFly 10. I work on a Windows machine and I want to profile the remote application server. I've checked that port 9990 is enabled for access via http by accessing http://<ip>:9990/console and via JMX access from the JConsole client that comes in WildFly. For the latter, I downloaded WildFly to my machine, went to %WILDFLY_PATH%\bin\jconsole.bat, accesed through service:jmx:http-remoting-jmx://<ip>:9990 and used my credentials, it works properly. Now I want to access vía JMC, but I cannot achieve it. I tried the following:
Copied jboss-client.jar libraries from %WILDFLY_PATH%\bin\client to %JDK_HOME%\lib\missioncontrol\dropins and start JMC.
Executed JMC from cmd and added -cp:a <location of jboss-client.jar> param, like this:
jmc.exe -cp:a "C:\Program Files\Java\jdk1.8.0_72\lib\missioncontrol\dropins\jboss-client.jar"
None of these worked.
I tried access with VisualVM and worked using the last approach but replaced jmc.exe by jvisualvm.exe and I connected to the external VM with no issues. I wonder if there's any way to achieve this using JMC.
Since jmc doesn't accept the -cp flag, you have to run like this:
jmc.exe -vmargs -Xbootclasspath/a:<location of jboss-client.jar>
Some more clues might be here: https://community.oracle.com/thread/2592885?tstart=0
Related
I cannot get Apache Tomcat to start. I followed the instructions for installing Tomcat on the Mac found at https://www.dev2qa.com/how-to-install-tomcat-in-macos/.
After I type the command to start Tomcat, the response from the command line is that Tomcat has started.
However, when I go to the browser, the default page is not showing up. I further checked to see if the port was being used by using the command
lsof -nP -i4TCP:8080 | grep LISTEN
which showed that no program is using the port. I also read the 'RUNNING.txt' that instructed me on setting the environmental variables, which I did. Any suggestions on why Tomcat is not starting up.
I'm using jdk 1.8.0_202 and Apache Tomcat 9.0.14 that is running of Mac OS High Sierra.
BatChmod
After downloading a fresh version of Tomcat, I use the BatChmod app to alter the file permissions. Tomcat will not launch properly without altering the permissions.
I do not know the command-line equivalent, but here is a screenshot of the settings I have used for years successfully.
Plea for help
If anyone can write the equivalent as a shell script for macOS, please post!
Even better, explain how to wrap such a script as an AppleScript for drag-and-drop execution in Finder.
The problem turned out to be a permissions problem. When I installed Tomcat, I put the folder in the '/Library/Tomcat' directory. Even though the Tomcat files were changed to be executable, the user and group ownership remained the same. To get Tomcat to run, I moved the directory to 'Users/MyUserName/Tomcat'. Once I did that, the default Tomcat page ran.
I have a custom instance running on Windows Server 2016 where I need to monitor my Java processes.
I setup Stackdriver, installed the monitoring agent and followed this guide for JVM monitoring https://cloud.google.com/monitoring/agent/plugins/jvm
However no matter what I do I can not see any of my processes when setting up an Alerting policy within Stackdriver's console.
There are 2 steps in the guide I am unsure how to follow:
On your VM instance, download jvm-sun-hotspot.conf from the GitHub configuration repository and place it in the directory
/opt/stackdriver/collectd/etc/collectd.d/
Where exactly do I place the .conf file?
Edit the downloaded configuration file and replace JMX_PORT by the port on which your JVM is configured to allow JMX connections.
How do I get the port?
Sorry if this seems obvious but I'm pretty new to this.
Thanks in advance for your help.
All the steps and instructions on the JVM plugin page have instructions relevant for linux, and windows is not even mentioned there. So it could be quite possible that the JVM plugin is supported only on linux.
Since your code is already running on a JVM, you might want to consider if it is possible to move your application from a Windows VM to a linux VM.
Enabling the JVM monitoring plugin
Java Virtual Machines are monitored via JMX.
On your VM instance, download jvm-sun-hotspot.conf from the GitHub
configuration repository and place it in the directory
/opt/stackdriver/collectd/etc/collectd.d/:
(cd /opt/stackdriver/collectd/etc/collectd.d/ && curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/jvm-sun-hotspot.conf)
Edit the downloaded configuration file and replace JMX_PORT by the
port on which your JVM is configured to allow JMX connections.
After adding the configuration file, restart the monitoring agent by
running the following command:
sudo service stackdriver-agent restart
Information on other plugin configuration options can be found at
collectd.org.
I found following issue whenever i try to run tomcat server with intellijidea. I have tried adding hostname to localhost but didn't work. Any suggestions?
Take a closer look at the server's output, to see the reason, why was Tomcat not started:
java.net.UnknownHostException: nitesh-pc: nitesh-pc
That could mean, that you have a problem with your hosts file (in OS Windows it could be found at {WindowsFolder}\System32\drivers\etc\hosts). You just need to add your hostname to localhost ip-address (don't forget to uncomment it, if needed), like:
127.0.0.1 localhost nitesh-pc
And then try to restart your server again.
I had an issue where Tomcat appeared to have started inside IntelliJ, but when I tried to open the Tomcat homepage I was getting "HTTP 404 Not Found" in the browser.
Starting Tomcat standalone (running startup.bat from the command prompt) started Tomcat and I could see the homepage fine.
I compared the output of running both standalone and within IntelliJ and noticed that CATALINA_BASE was different.
So I created a setenv.bat file in Tomcat bin directory (it was initially not there) and set CATALINA_BASE there like:
set CATALINA_BASE=C:\apache-tomcat-8.5.14
After that, Tomcat starts from IntelliJ and I can access the homepage.
Just putting this out there because I was at a loss why the page was not available when Tomcat seemed to have started OK.
Hope this will help someone.
This may happen if the machine has multiple or changing IP adresses (e.g. when using VPN or Hyper-V, Docker or other virtualization).
The solution is to define the IP address Tomcat should use for RMI:
-Djava.rmi.server.hostname=127.0.0.1
(This is a sane default for a Tomcat running locally, but you’re setup might require a different one.)
This has to be set so it’s applied as a command-line argument for the JVM. This might be in IntelliJ or Tomcat itself (for Linux systems bin/setenv.sh in the Tomcat directory, for a Windows service it’s usually in HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\Tomcat9\Parameters\Java\Options.
All,
I have a remote server that I recently enabled VNC for using vnc4server and Chicken for mac as the client.
The purpose for doing so was to enable running Java's Jconsole to monitor an executable jar file that is running my server logic.
However, after logging into my server using VNC, I keep getting an error when I try to use Jconsole on vnc.
It states connection failed do you want to try again. Now I am logged in as the same user that started the process.
Is there something I am missing when using jconsole in VNC? Also can I monitor my executable jar file remotely using Jconsole on my local machine?
These are the options I am including to run the jar file: java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9005 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.remote.ssl=false -Djava.rmi.server.hostname=ipaddress -jar path
Thanks
These JVM options fixed things. Fix found here: You need to pass to the VM: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false
https://forums.oracle.com/thread/1177644
This does not seem like an VNC issue- either the ports are not open, they are being blocked b a firewall, or there is some kind of permission/authentication issue with the app itself related to monitoring it.
In order to eliminate VNC as the cause (and use localhost in a local connection on jconsole), do "ssh -X REMOTHOST -n jconsole" and see. This will also eliminate the overhead of running the full X server and VNC.
Also on linux you can find out what process holds a port open by doing:
netstat -ap | grep PORT_NUMBER on the remote host you want to run on.
Colin
I have a problem with starting Jetty via the startup command /etc/init.d/jetty. When I execute the command the following output is generated:
/etc/init.d/jetty start
Starting Jetty servlet engine.:
Jetty Rotate logs
Jetty servlet engine started, reachable on http://jagadguru:80/.: jetty.
It does start successfully when I type java -jar start.jar in my Jetty directory.
Can anyone help me with this?
This is likely a file permission issue. Even if you are running the start script with sudo, the script defines a jetty user (default is jetty). I had an issue similar to this where my permissions on /tmp prevented jetty from creating a file there. I adjusted the permissions on /tmp and all is well! The jetty user also needs permissions on the jetty folder of course.
Also, for checking if Jetty is finding java correctly, run sudo service jetty check
It's probably an issue due to wrong permissions on some work or log folder. I assume the start script tries to change the user and therefore doesn't has the same permissions as the one you use when running Jetty via "java -jar".
Another possibility is that you don't have JAVA_HOME set and the start script doesn't find your java bin.
Please attach some kind of log file as it is really hard to say more without more detailed information.
As answered here, the default configuration for Jetty in /etc/default/jetty only allows connections from localhost, you need to set JETTY_HOST to 0.0.0.0 to allow Jetty to accept connections from any host.
Add the following line to /etc/default/jetty:
JETTY_HOST 0.0.0.0