How to debug JBOSS application in netbeans?

前端 未结 1 1777
悲哀的现实
悲哀的现实 2020-12-18 13:23

I come from a .NET background where I can easily debug a web application by adding a breakpoint and building/running the application.

I\'m working on a JAVA EJB3 app

相关标签:
1条回答
  • 2020-12-18 13:50

    Enable remote debugging as follows:

    1. Set JAVA_OPTS to:
    -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
    1. Click Debug >> Attach Debugger
    2. Ensure the port is 8787.
    3. Click OK.

    Remote debugging is enabled; set breakpoints as usual.


    Or enable remote debugging as follows:

    1. Edit %JBOSS_HOME%/domain/configuration/domain.xml
    2. Find <jvm name="default">
    3. Insert the following element:
    <jvm-options>
      <option value="-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"/>
    </jvm-options>
    
    1. Save the file.
    2. Restart JBoss.
    3. Click Debug >> Attach Debugger
    4. Ensure the port is 8787.
    5. Click OK.

    Remote debugging is enabled; set breakpoints as usual.

    The Output - Debugger Console panel should show:

    Attaching to localhost:8787
    User program running
    

    Or, in domain mode, configure the server's host.xml as follows:

    <server name="server-one" group="main-server-group">
        <jvm name="default">
            <jvm-options>
                <option value="-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"/>
            </jvm-options>
        </jvm>
    </server>
    
    0 讨论(0)
提交回复
热议问题