JBoss EAP 6将单个服务器配置为在域模式下进行远程调试 [英] JBoss EAP 6 configure single server for remote debugging in domain mode

查看:128
本文介绍了JBoss EAP 6将单个服务器配置为在域模式下进行远程调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一台计算机上运行域控制器,一台主机控制器和一台服务器.

I have Domain controller, one Host controller and one server running in the same machine.

我正在使用IDEA连接到远程服务器进行调试,但是即使它正在运行代码,它也不会在断点处停止(我已通过系统中断进行了验证).

I'm using IDEA to connect to the remote server for debugging but it's not stopping on break points even though it's running the code (i've verified with system outs).

我已在$ JBOSS_HOME/bin/domain.conf中启用HOST_CONTROLLER_JAVA_OPTSPROCESS_CONTROLLER_JAVA_OPTS进行远程调试:

I've enabled HOST_CONTROLLER_JAVA_OPTS and PROCESS_CONTROLLER_JAVA_OPTS for remote debugging in $JBOSS_HOME/bin/domain.conf:

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

当我启动JBoss服务器时,我可以从netstat中看到它正在正确侦听端口8787和8788.如果我列出了系统中运行的进程,我可以看到一个用于域控制器,一个用于主机控制器,一个用于服务器( server1).域和主机控制器在其启动属性中指定了调试选项,但server1缺少它们.

When i start JBoss server i can see from netstat that it's properly listening to ports 8787 and 8788. If i list the processes running in the system i can see one for Domain controller, one for Host controller and one for the server (server1). Domain and Host controllers have the debug options specified in their launch properties but they're missing for server1.

一段时间以来,我一直在查看各种XML,.conf和.sh文件,但是我不知道如何指定server1以使用远程调试选项.有没有一种方法可以在域模式下远程调试单个服务器?

I've been looking at the various XML, .conf and .sh files for a while now but i can't figure out how i could specify server1 to use the remote debugging options. Is there a way to remotely debug a single server in domain mode?

推荐答案

JHollanti也许您缺少一些允许远程调试的编译器标志(例如"lines,vars,source").

JHollanti maybe you are missing some compiler flags (like "lines,vars,source") to allow remote debugging.

例如,如果您正在使用Ant,则需要将此行添加到javac中:

For example, is you are using Ant you need to add this lines to your javac:

<!-- Javac lines, vars, source compiler flags -->
<javac srcdir="..." destdir="..." classpathref="..." debug="true" debuglevel="lines,vars,source" />

然后在执行脚本中添加:

Then in your execution script you jave to add:

<!-- debug configurations: modify the port you want-->
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4060"/>

另一方面,如果您使用的是Maven,则可以在中添加相同的标志,如下所示:

On the other hand, if you are using Maven same flags can be added in the , like this:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>2.0.2</version>
      <configuration>
        <!-- Necessary in order for the debug levels to be considered-->
        <debug>true</debug>
        <debugLevel>lines,vars,source</debugLevel>
      </configuration>
    </plugin>
  </plugins>
</build>

在使用Jetty的情况下,与以前相同...您需要具有以下变量:

In case of using Jetty, same as before... you need to have the following variable:

export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n"

另一方面,您可以检查的是在中设置 suspend 标志,即"suspend = y" .除非您连接调试器,否则这不会启动您的应用程序.

On the other hand, what you can check is setting the suspend flag in yes, it is "suspend=y". This won't start your app unless you connect a debugger.

您可以在此处查看有关jboss的特定信息:

Here you can check specific info about jboss:

希望能提供帮助

这篇关于JBoss EAP 6将单个服务器配置为在域模式下进行远程调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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