如何使用weblogic服务器调试日历中的java web应用程序 [英] how to debug java web application in eclips with weblogic server

查看:155
本文介绍了如何使用weblogic服务器调试日历中的java web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有java应用程序与Eclipse IDE和WebLogic 11g服务器。是否可以远程调试应用程序?如果是,如何?

解决方案

将以下行添加到用于启动Weblogic服务器的脚本文件,例如 startWeblogic.cmd

 设置JAVA_OPTIONS = -Xdebug -Xnoagent -Xrunjdwp: transport = dt_socket,address = 8453,server = y,suspend = n 

Weblogic Server控制台应显示消息:

 侦听运输dt_socket在地址:8453 

在eclipse中按照以下说明进行操作:


  1. 选择运行>调试
    配置...
    从工作台菜单栏(或调试
    配置...
    从调试工具栏的下拉菜单
    按钮)以显示启动配置对话框。

  2. 在左侧配置
    类型的列表中选择远程Java应用程序

  3. 点击新建工具栏按钮。创建一个新的远程启动配置
    ,并显示三个选项卡:Connect,Source和Common。

  4. 项目 >连接选项卡,键入或浏览以选择
    作为启动参考的项目(对于源
    查找)。一个项目不需要指定。

  5. 连接标签的连接类型字段允许您选择
    如何连接到虚拟机。在大多数情况下,您将
    附加到特定位置的vm,在这种情况下,请选择
    Standard(Socket Attach)。其余的说明假设你
    选择了这个选项。标准(Socket Listen)连接
    类型创建一个启动,将侦听来自远程VM的
    的传入连接。您将需要指定启动将
    收听的端口。

  6. 在连接选项卡的主机字段中,键入IP地址或域
    运行Java程序的主机的名称。如果程序在与工作台相同的计算机上运行,​​请键入localhost。

  7. 端口字段,键入
    远程VM接受onnections的端口。通常,当远程VM启动时,此端口指定为

  8. 允许终止远程 VM标志是一个切换,确定
    是否在调试器中启用了Terminate命令。如果您想要终止
    所连接的虚拟机,请选择
    此选项。

  9. 点击调试。启动尝试连接到指定地址和端口的VM
    ,结果显示在
    Debug视图中。如果启动器无法通过
    指定的地址连接到虚拟机,则会显示错误消息。

文档: / p>


I have java application with Eclipse IDE and WebLogic 11g server. Is it possible to debug application remotely? if yes how?

解决方案

Add the following line to the script file used to start Weblogic server, e.g. startWeblogic.cmd

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

The Weblogic Server console should display the message:

Listening for transport dt_socket at address: 8453

In eclipse follow the instructions below:

  1. Select Run > Debug Configurations... from the workbench menu bar (or Debug Configurations... from the drop-down menu on the Debug tool bar button) to show the launch configuration dialog.
  2. Select the Remote Java Application in the list of configuration types on the left.
  3. Click the New toolbar button. A new remote launch configuration is created and three tabs are shown: Connect, Source, and Common.
  4. In the Project field of the Connect tab, type or browse to select the project to use as a reference for the launch (for source lookup). A project does not need to be specified.
  5. The Connection Type field of the Connect tab allows you to choose how you will connect to the virtual machine. In most cases, you will be attaching to the vm at a specific location, in which case select Standard (Socket Attach). the rest of these instructions assume you have chosen this option. The Standard (Socket Listen) connection type creates a launch that will listen for incoming connections from a remote VM. You will need to specify a port that the launch will listen at.
  6. In the Host field of the Connect tab, type the IP address or domain name of the host where the Java program is running.If the program is running on the same machine as the workbench, type localhost.
  7. In the Port field of the Connect tab, type the port where the remote VM is accepting onnections. Generally, this port is specified when the remote VM is launched.
  8. The Allow termination of remote VM flag is a toggle that determines whether the Terminate command is enabled in the debugger. Select this option if you want to be able to terminate the VM to which you are connecting.
  9. Click Debug. The launch attempts to connect to a VM at the specified address and port, and the result is displayed in the Debug view. If the launcher is unable to connect to a VM at the specified address, an error message appears.

Docs:

这篇关于如何使用weblogic服务器调试日历中的java web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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