您如何将 Eclipse 连接到托管在远程服务器上的 WebSphere Application 服务器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9028984/
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
How do you connect an eclipse to a WebSphere Application server hosted on remote server?
提问by user1172766
I am trying to debug a local code ( which is on my laptop) using eclipse, which I am trying to connect to the remotely hosted WAS( WebSphere Application server) and remotely hosted database.
我正在尝试使用 eclipse 调试本地代码(在我的笔记本电脑上),我正在尝试连接到远程托管的 WAS(WebSphere 应用程序服务器)和远程托管的数据库。
回答by shelley
To remotely connect to WAS, first, from the WebSphere Integrated Solutions Console:
要远程连接到 WAS,首先,从 WebSphere Integrated Solutions Console:
- Navigate to the application server's Debugging Service:
- Servers > Server Types > WebSphere application servers > [serverName] > Debugging Service
- Check the "Enable service at server startup" checkbox
- Add/modify the "JVM debug port" if necessary (the port must not already be in use on the server)
- Add/modify the "JVM debug arguments" if necessary (this may already appear by default):
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777
- Apply the changes, Save the new configuration, and Restart the application server
- 导航到应用服务器的调试服务:
- 服务器 > 服务器类型 > WebSphere 应用程序服务器 > [serverName] > 调试服务
- 选中“在服务器启动时启用服务”复选框
- 如有必要,添加/修改“JVM 调试端口”(该端口不得已在服务器上使用)
- 如有必要,添加/修改“JVM 调试参数”(默认情况下可能已经出现):
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777
- 应用更改,保存新配置,然后重新启动应用程序服务器
Then, from the Eclipse IDE:
然后,从 Eclipse IDE:
- Open the "Debug" dialog (e.g. Run > Debug Configurations...)
- Right-click "Remote Java Application" and select "New"
- Configure the Remote Java Application:
- Name the debug configuration
- Browse to select the project to debug (optional)
- Use the "Standard (Socket Attach)" Connection Type
- Specify the hostname of your WAS server
- Specify the port number that was set in the WAS debug options
- Click Apply
- Click Debug
- 打开“调试”对话框(例如运行 > 调试配置...)
- 右键单击“远程 Java 应用程序”并选择“新建”
- 配置远程 Java 应用程序:
- 命名调试配置
- 浏览选择要调试的项目(可选)
- 使用“标准(套接字连接)”连接类型
- 指定 WAS 服务器的主机名
- 指定在 WAS 调试选项中设置的端口号
- 点击应用
- 单击调试
(These instructions are for WAS 7.0, but should be similar for other versions.)
(这些说明适用于 WAS 7.0,但对于其他版本应该类似。)