如何在NetBeans中调试JBOSS应用程序? [英] How to debug JBOSS application in netbeans?

查看:64
本文介绍了如何在NetBeans中调试JBOSS应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自.NET背景,可以通过添加断点并构建/运行该应用程序来轻松调试Web应用程序.

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

我正在研究JAVA EJB3应用程序.我已经成功地将ejb项目部署到服务器上,但是我想做的是开发控制器和视图.为此,我希望能够在Net Bean中运行/调试项目.

I'm working on a JAVA EJB3 application. I have successfully deployed ejb project to the server, but what I'd like to do know is develop controllers and views. In order to do that I'd like to be able to run/debug the project in net beans.

我已经将JBOSS5和JBOSS6都添加到了IDE中,但是要花一分钟的时间才能启动.有时它完全挂起.运行玻璃鱼时,我没有这个问题-最多只需要几秒钟即可启动. PC规格是最新的,它是带有ssd和4GB RAM的corei7.

I have added both JBOSS5 and JBOSS6 into the IDE, but it takes over a minute to start. Sometimes it hangs completely. I don't have this issue when I run a glassfish - it takes few seconds at the most to start up. PC spec is up to date, it's corei7 with ssd and 4gb of RAM.

谢谢

推荐答案

启用远程调试,如下所示:

Enable remote debugging as follows:

  1. 将JAVA_OPTS设置为:

-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n

  1. 点击 Debug >>附加调试器
  2. 确保端口为8787.
  3. 点击确定.
  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. 编辑%JBOSS_HOME%/domain/configuration/domain.xml
  2. 找到<jvm name="default">
  3. 插入以下元素:
  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. 保存文件.
  2. 重新启动JBoss.
  3. 点击 Debug >>附加调试器
  4. 确保端口为8787.
  5. 点击确定.
  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.

输出-调试器控制台面板应显示:

Attaching to localhost:8787
User program running


或者,在域模式下,按以下方式配置服务器的host.xml:

<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>

这篇关于如何在NetBeans中调试JBOSS应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆