Installing jvisualvm as service giving error - java

I am trying to install jvisualvm as Windows Service since my Tomcat is also running as Windows Service. I ran following command to install jvisualvm as service:
sc create jvisualvm binpath= ...(Location for jvisual.exe without quotes("))
And I get message of CreateService SUCCESS
But when I try to run from Services it is giving me error:
Windows could not start the jvisualvm on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
Can anyone suggest me what can be the cause for this error?

Related

Jenkins installation can't start with a service failure related to can't read from commanline

I installed jenkins on windows 10 and it gives me the next error:
"The jenkins service cannot be started from the command line or from debugging, you must first install the Windows service using unsalted Tajik, and then you must start it using the Server Explorer program of the Windows Services Administration Tool or the start command."
Anyone had the same problem?

AWS ec2 web app goes down when command prompt is closed

I ssh into the ec2 instance using command prompt. I then launch the jar file from there. The web app runs perfectly from any device until the command prompt is closed. The site immediately goes down. The instance is shown as “running” when the site is down. ideas?
Well, ec2 is the virtual machine and it will show as running because you didn't shutdown or terminate it.
Your webapp is down because closing the command prompt will quit the shell session and thus terminating/killing the running jar.
It seems you are not running the jar as a background process.
If you are using Linux EC2 instance then try running your jar as
$java -jar jarfilename.jar &
The & makes your java process as a background job.
Note down the process id and then close the session. Now your webapp will keep on running as long as your ec2 instance is running.
I'd suggest reading about nohup and background processes in Linux in general.

Executing jstack getting access denied

My application is running as a windows service.
When I try to take thread dump using below command from Cmd running as Administrator, I am getting access denied on a machine running on Windows 2016 server
"D:\myapp\jre\bin\java.exe" -classpath tools.jar sun.tools.jstack.JStack 2544 >log1.txt
Getting
2544: Access is denied
Similar command when I run on another machine running in Windows server 2012,it successfully captures thread dump.
And both of these services are running with Local system.
As I googled and found this issue could be due to the service running under Localsystem and the command prompt(which I am using to execute jstack) running under different process, I modified the service to log on as my user account and restarted the service, still getting access denied.
Also tried using PsExec using below command:
psexec -s "D:\myapp\jre\bin\java.exe" -classpath tools.jar sun.tools.jstack.JStack 2544 >log1.txt.
I dont know why but I am getting
Error: Could not find or load main class sun.tools.jstack.JStack.
(Just to add I am running this command from the same folder where tools.jar is residing.)
I seem to have been stuck at all places..Any help will me much appreciated

visualvm/jvisualvm: not supported for this JVM

I wanted to monitor the JVM of wildfly running as service with jvisualvm/visualvm but I fail to do this. I tried the following things:
setting the %TMP% and %TEMP% to C:\Windows\Temp (wildfly console
tells me this for java.io.tmpdir)
running a console with sysinternals
pstools as system account: psexec -i -s cmd.exe and started visualvm
from within this new console (checked that the temp folders are
correctly set).
In both cases under local applications the process of wildfly was listed but visualvm only told me "not supported for this jvm".
As soon as I run wildfly from the cli, visualvm has no problems and shows me everything. There is only the jdk from oracle installed (with the corresponding jre).
How can I monitor the process of wildfly running as service (local system account)? Why is it not working with the solutions above?
Thanks a lot (for reading)
Thank you Salah
With your hint (local JMX connection) I've managed to make it work by using the following command for visualvm (no change of TMP/TEMP variables in cmd):
visualvm.exe -cp:a "<path-to-wildfly>\bin\client\jboss-client.jar"
and adding the path to the jmx console (don't forget to set the username/pw for the admin gui)
service:jmx:http-remoting-jmx://localhost:9990

Troubleshooting with installation newrelic agent on tomcat

Trying to install java agent on tomcat.
successfully run
java -jar newrelic.jar install
then run apache, but not see any newrilc initialization messages in catalina out, and not found any logs in newrelic directory.
General guidance on this install process:
The script should print out a good amount of detail on what it's done, including where it detected your Tomcat instance. If nothing's showing up in your CLI, then it's likely you haven't started the install script.
You can use -h to see usage help, and -s /path/to/applicationserver if you want to make sure the script find your web app. Note that a clear error message should show up if the install script can't find your web app.
The install script is fairly simple, and you can perform a manual install with the steps in the New Relic documentation (broken out by framework).

Categories

Resources