eclipse 如何在Weblogic集群环境中设置远程调试?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29237033/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 22:30:41  来源:igfitidea点击:

How to setup remote debugging on Weblogic clustered environment?

javaeclipsedebuggingweblogicremote-debugging

提问by Ghayth

I'm trying to remote debug a clustered Web Application that is deployed on WebLogic 12c.

我正在尝试远程调试部署在 WebLogic 12c 上的集群 Web 应用程序。

I know how to setup remote debugging for normal (non-clustered) environments, I just add the following parameters to the file named [startWebLogic.cmd]:

我知道如何为普通(非集群)环境设置远程调试,我只需将以下参数添加到名为 [startWebLogic.cmd] 的文件中:

set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n

But when I try to set those same parameters on all the nodes of the cluster environment, and then start the cluster using WebLogic console page, remote debugging will not work!! (Eclipse will not be able to connect).

但是当我尝试在集群环境的所有节点上设置这些相同的参数,然后使用WebLogic控制台页面启动集群时,远程调试将不起作用!!(Eclipse 将无法连接)。

I suspect this is caused by the way the Node Manager of WebLogic starts the individual nodes, it's like it's not calling [startWebLogic.cmd] for each node.

我怀疑这是由 WebLogic 的节点管理器启动单个节点的方式引起的,就像它没有为每个节点调用 [startWebLogic.cmd] 一样。

回答by Ghayth

I figured it out!

我想到了!

When you start the cluster nodes through WebLogic console page, The node manager handles the start-up of each node in some way, so it does not run each node's [startWebLogic.cmd] file!

当您通过WebLogic 控制台页面启动集群节点时,节点管理器以某种方式处理每个节点的启动,因此它不会运行每个节点的[ startWebLogic.cmd] 文件!

I found that you can set remote debugging arguments for each node through the console pageitself, so that the node manager will pass those parameters to each node when it attempts to start it.

我发现您可以通过控制台页面本身为每个节点设置远程调试参数,以便节点管理器在尝试启动每个节点时将这些参数传递给每个节点。

Below is how I did that (Edit: on WebLogic 12c):

下面是我是如何做到的(编辑:在 WebLogic 12c 上):

  1. Open WebLogic console page (e.g: localhost:7001/console)
  2. On the left side of the page, go to Environment> Clusters
  3. Find the name of your cluster environment and click on it
  4. In the "Configuration"tab, open the "Servers"sub-tab
  5. At the bottom of the page, you'll find a table of all the cluster nodes you have.
  6. Click on one of the nodes (servers).
  7. In the "Configuration"tab, open the "Server Start"sub-tab
  8. Scroll down a bit and you'll find a Text Area named "Arguments", fill it with the remote debugging arguments: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
  9. Click "Save", and repeat steps 6-8on all the other cluster nodes.
  1. 打开 WebLogic 控制台页面(例如:localhost:7001/console
  2. 在页面左侧,转到Environment> Clusters
  3. 找到你的集群环境的名称并点击它
  4. “配置”选项卡中,打开“服务器”子选项卡
  5. 在页面底部,您会找到一个包含所有集群节点的表格。
  6. 单击其中一个节点(服务器)。
  7. “配置”选项卡中,打开“服务器启动”子选项卡
  8. 向下滚动一点,你会发现一个名为"Arguments"的文本区域,用远程调试参数填充它: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
  9. 单击“保存”,然后在所有其他集群节点上重复步骤6-8

And you are done!

你已经完成了!