<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    cmd.exe processes stranded after JBoss 5.1 service shutdown Windows 7
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/cdavis999">Chris Davis</a> in <i>JBoss Web Development</i> - <a href="http://community.jboss.org/message/607072#607072">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I'm running JBoss EAP 5.1 as a service on Windows 7 (32-bit).&#160; I used service.bat to install/uninstall the service.&#160; I use the Windows Control Panel Services dialog to start and stop the service.&#160; JBoss starts up cleanly and JBoss itself shuts down cleanly when I stop the service (as reported by the shutdown.log).&#160; The jbosssvc.exe process and the java.exe process also disappear from Task Manager. However, Task Manager continues to show the two cmd.exe processes presumably spawned by jbosssvc.exe, for example:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 8pt;"><span style="text-decoration: underline;">Image Name</span> <span style="text-decoration: underline;">PID&#160;&#160;&#160; </span> <span style="text-decoration: underline;">User Name</span> <span style="text-decoration: underline;">Command Line</span></span></p><p><span style="font-size: 8pt;">cmd.exe&#160;&#160;&#160;&#160;&#160;&#160; 7148&#160; SYSTEM&#160;&#160;&#160; </span><span style="font-size: 8pt;">C:\Windows\system32\cmd.exe /E:ON /S /C "SET JSERVICE_PPID=6344&amp;&amp;SET JSERVICE_NAME=JBEAP5SVC&amp;&amp;CALL service.bat start"</span></p><p><span style="font-size: 8pt;">cmd.exe&#160;&#160;&#160;&#160;&#160;&#160; 8322&#160; SYSTEM&#160;&#160;&#160; C:\Windows\system32\cmd.exe /E:ON /S /C "SET JSERVICE_PPID=6344&amp;&amp;SET JSERVICE_NAME=JBEAP5SVC&amp;&amp;CALL service.bat stop"</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>These processes have to be manually killed.&#160; Shouldn't jbosssvc.exe be able to shut these two processes down automatically?&#160; The PPID parameter in the lines above is the same as the PID for jbosssvc.exe in Task Manager.&#160; I had to tweak my bat files to match my file system paths, so I'm attaching them, along with my run.log and shutdown.log. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>For reference: while the JBoss service is running, Task Manager displays these lines (before I stop the service):</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 8pt;"><span style="text-decoration: underline;">Image Name&#160; </span> <span style="text-decoration: underline;">PID&#160;&#160;&#160; </span> <span style="text-decoration: underline;">User Name</span> <span style="text-decoration: underline;">Command Line</span></span></p><p><span style="font-size: 8pt;">cmd.exe&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 7148&#160; SYSTEM&#160;&#160;&#160; </span><span style="font-size: 8pt;">C:\Windows\system32\cmd.exe /E:ON /S /C "SET JSERVICE_PPID=6344&amp;&amp;SET JSERVICE_NAME=JBEAP5SVC&amp;&amp;CALL service.bat start"</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 8pt;">java.exe&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3492&#160; SYSTEM&#160; </span><span style="font-size: 8pt;">"C:\Program Files\Java\jdk1.6.0_22\bin\java"&#160; &shy;Xms512m &shy;Xmx1024m &shy;XX:PermSize=512m &shy;XX:MaxPermSize=512m &shy;Xrs &shy;Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 8pt;">jbosssvc.exe 6344&#160; SYSTEM&#160;&#160; "C:\JBoss510\native32\sbin\jbosssvc.exe" &shy;r JBEAP5SVC</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Any help is greatly appreciated!</p><p>Chris</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/607072#607072">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2112">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>