Java.exe is not stopped after stopping Websphere application service - websphere

We have IBM Websphere 7.0 scheduled to run as windows service on Windows 7 / 2008 R2.
When this service is stopped, the java.exe process associated with this is not stopping. Hence it's a manual task to kill the process in Task manager.
Does anyone know how to make the java.exe also stop after the Websphere is stopped?
Thanks
Karthik

Take a thread dump of the Java process and see what it's doing. Perhaps it's waiting for some resource etc:
jps
jstack <pid>

Karthik,
Try switching on WASService Tracing (see pages 55 onwards in the following link)
http://blogs.hbr.org/schwartz/2012/03/the-magic-of-doing-one-thing-a.html

Check the server's logs. Is the server really stopped? Do you see a log line saying that the server is stopped?
If not, then it means that something is preventing your server instance from stopping. I have seen it happening before when JavaEE code used to spawn long-running threads without closing them.
You can configure WebSphere to start with debugging support, and then connect to it via, say, Eclipse. Using Eclipse, you can look at the active threads on the server, including each thread's stack; that might help you track the problem down.
If the server's logs show that the server is stopped... well... that's what PMR's are for, I guess.

Related

How can I troubleshoot a thread in hang in WebSphere Application Server?

I see there are threads in hang in the websphere application server. How can I troubleshoot this problem? What documentation should I send to the application developer?
Thanks.
The most important thing is the thread stack - that should show up with the message indicating the hung thread, and it'll tell you what that thread was doing.
That, on its own, might not be enough, particularly if that thread is waiting on some other thread. In that case, you might need a thread dump. That can be triggered with "kill -3" against the process ID on non-Windows systems (I'd have to do more research to tell you the equivalent process on Windows, although there are tools that can simulate "kill -3"), and the server also can be configured to do that when it detects a hung thread, using the JVM system property com.ibm.websphere.threadmonitor.dump.java (set to either "true" or an integer value representing the maximum number of thread dumps you want).
The thread dump will go to a file called "javacore...txt" (the "..." will be a long string representing stuff like the timestamp), except on Solaris, where it will go to the server's native_stdout.log. The javacore has a lot more than just thread stacks, so you can search for "Thread Details" to find that section quickly. You'll need to search on the thread name/stack from the server log to figure out which thread is the hung one and go from there.
If you are experiencing performance, hang, or high CPU issues with WebSphere Application Server, there is a procedure documented by IBM support team to collect the data necessary to diagnose and resolve the kind of issues. This procedure is based essentially on
enabling Application Server verboseGC
running a script, at the time of the problem, which collects 3 javacores for the problematic JVM
At the end of this procedure, you need to collect:
*.tar.gz file generated by the script
javacores generated by the script
server logs (SystemOut.log, native_stderr.log,...)
and send the results to IBM Support.
To get the script and for additional information about this procedure, I suggest to give a look to the following articles:
WebSphere MustGather procedure on Linux
WebSphere MustGather procedure on Windows
A similar document exists also for AIX platform.

how to shutdown tomcat windows service within 30 seconds (or ask more time from SCM)

I have problem with my tomcat launched as windows service. There are few web applications running on it, and when I attempt to stop service (programmatically) it takes more than 30 seconds to stop it and SCM aborts operation due to the time limitation (default is 30 seconds). This can be configured in registry, but I am not able to change it (and seems to be ugly solution). How can I solve this? Is there some kill_timeout for tomcat? Or how should I stop my applications?
The Tomcat config GUI (AKA The Apache "Commons Daemon Service Manager") has a Shutdown tab (Tip: open tomcatw.exe in your installation path). Here you will see a Timeout value. This might solve your problem.
It is also explained in https://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Command_line_parameters:
ParameterName Default Description
[...]
--StopTimeout No Timeout Defines the timeout in seconds that procrun waits for service to exit gracefully.
Alternatively, check this: Tomcat doesn't stop. How can I debug this?

Issue with JMS Listener in Sun Java App Server

I am running a listener program on a JMS queue hosted in Sun Java System Application Server 9.1_02 (build b08-p03)
After receiving a message I will extract and log some details in to a log file.
I observed that when running listener for really long hours, it stops receiving messages. I had to manually stop the program and start it again. Then it receives some 200-300 message and then stops again. I had to restart it to retrieve another set of messages.
Why is this weird behavior? Can someone throw light on this?
Thank you
Chaitanya
I found the issue myself. I am running the listener as Load Runner Java Vuser script. One negative thing about LR is that it does not show any exceptions. The script appears to be running but it actually does nothing. I found this when I ported the script to Eclipse and found that the script is throwing exceptions. This is essentially because I am not checking for a certain condition.
Happy that I demystified at last!
Thanks.

problem with starting WAS in debug mode

I want to start my WAS server(on windows) in debug mode.But my application is huge and server time outs while starting in debugging mode.I have increased the timeout value to 1000 .What should i do?
If you're running your server by using Rational Application Developer, it is possible that your server is basically waiting on a breakpoint. Sounds silly, but hey, happened to me a few times before.
If it's a regular installation:
If it's a Network Deployment topology, make sure that the deployment manager and the node agent are up and running. Look at their log; they're often overlooked.
If it's a single-server topology, then it's possible that your debug port (7777 by default) is in use. When that happens, the debugger process never quite "connects" to WebSphere.
To sum it up: it starts with the logs...
Try changing connection settings on your server from using RMI to SOAP. If you are behind a firewall and you application is timing out on startup then it may help you. Also do you get any other information when the timeout occurs?

Jboss failover testing

I have a peculiar situation here. I have installed JBoss 5.1.0 as a service in Wintel box.
The service will restart itself if the JBoss instance fails.
However I could not find a way to test this scenario. I killed the JVM that was running the JBoss, but it did not restart the service. I need to make the JBoss service end abnormally so that I can ensure it is restarts again.
In a nutsehll, I need a way to make JBoss end abnormally.
Please help.
Write a JSP that calls System.exit(1)? That might fall foul of the Security Manager, though, and JBoss might not permit it.
In my experience, JBoss nodes (and app servers in general) tend not to crash in such a way as the process exists. Instead, they're more likely to consume increasing resources (e.g. memory) until they stop responding, and need explicit restarting. That's certainly easier to reproduce, but it's harder to handle automatically.

Resources