<!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="https://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;">
    JBoss AS7: Using JPDA to debug the AS source code
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/anil.saldhana">Anil Saldhana</a> in <i>JBoss AS 7 Development</i> - <a href="https://community.jboss.org/docs/DOC-17532">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>This article will talk about how to use JPDA to debug the AS source code in both the standalone as well as the managed domain mode.&#160;&#160; If you want to know the difference between standalone and managed domain, please look at the <a class="jive-link-external-small" href="https://docs.jboss.org/author/display/AS71/Core+management+concepts">Core Management Concepts</a>.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h2>Standalone Mode</h2><h2></h2><p>To start AS7 in the standalone mode with JPDA on,&#160; you will need to change standalone.conf&#160; (Unix or Linux)&#160; or&#160; standalone.conf.bat (Windows).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code"># Sample JPDA settings for remote socket debugging
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

# Sample JPDA settings for shared memory debugging 
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Since I use Eclipse,&#160; I uncomment the first setting.&#160; Please make suspend=y,&#160; if you want to debug, because AS7 is <strong>fricking too fast to startup</strong>. You need to tame it by asking it to wait for you to attach the debugger. <span> :) </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h2></h2><h2>Managed Domain Mode</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To start AS7 in the managed domain mode with JPDA on,&#160; you will need to change domain.conf&#160; (Unix or Linux)&#160; or&#160; domain.conf.bat (Windows).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code"># Sample JPDA settings for remote socket debuging.
#PROCESS_CONTROLLER_JAVA_OPTS="$PROCESS_CONTROLLER_JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=n"
#HOST_CONTROLLER_JAVA_OPTS="$HOST_CONTROLLER_JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

# Sample JPDA settings for shared memory debugging
#PROCESS_CONTROLLER_JAVA_OPTS="$PROCESS_CONTROLLER_JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"
#HOST_CONTROLLER_JAVA_OPTS="$HOST_CONTROLLER_JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If you want to debug the <em>domain controller</em>, just uncomment the first setting for ProcessController.</p><p>If you want to debug the <em>host controller</em>, just uncomment the first setting for HostController.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Since the HostController starts one or more JBossAS7 servers, you may sometime be interested in debugging issues.&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If so, then you will need to go to domain/configuration/host.xml&#160;&#160; and change the jvm settings for the server in question.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"> <span class="jive-xml-tag">&lt;servers&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;server name="server-one" group="main-server-group"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-comment">&lt;!-- Remote JPDA debugging for a specific server
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;jvm name="default"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;jvm-options&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;option value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/jvm-options&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/jvm&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/server&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If you have any problems or questions, you can use the AS7 forums. <span> :) </span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="https://community.jboss.org/docs/DOC-17532">going to Community</a></p>

        <p style="margin: 0;">Create a new document in JBoss AS 7 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>