问题描述
这是我第一次尝试创建 Eclipse 插件.我已经创建了一个,以及一个功能和更新站点.我将目标平台设置为我的本地 Eclipse 安装.当我在开发环境中运行/调试插件时,一切正常.
This is my first attempt at creating an Eclipse plug-in. I've created one, along with a feature and update site. I set the target platform as my local Eclipse installation. When I run/debug the plugin from within the development environment everything works fine.
现在,我的同事从我托管的更新站点安装了插件.当他开始使用我的插件公开的任何功能时,他会遇到运行时异常.
Now, my colleague installed the plug-in from the update site that I hosted. When he starts using any of the functionality exposed by my plugin he gets runtime exceptions.
- 他看到了在我从开发环境中运行插件项目时没有发生的空指针异常.
- 我的插件中有一个向导.当他关闭它时,他得到一个未处理的事件循环异常",并且向导没有关闭.我在开发环境中运行/调试插件时没有遇到此问题.
- He sees null pointer exceptions which didn't occur when I ran my plug-in project from my development environment.
- I have a wizard that's part of my plug-in. When he close it he gets a "Unhandled event loop exception", and the wizard doesn't close. I didn't have this issue when I was running/debugging my plugin in my development environment.
现在我很困惑为什么同一个插件在生产环境中的行为与开发环境不同,以及当我从我的 IDE 调试它时.两种情况下的目标平台都是相同的 Eclipse 版本.可能是什么原因?
Now I'm confused as to why the same plug-in is behaving differently in the production environment, as against the dev environment and when I was debugging it from my IDE. The target platform in both cases is the same Eclipse version. What could be the reasons?
如何在生产环境中调试插件?是否有远程调试生产环境插件的能力?任何建议都会非常有用!
And how do I debug the plug-in in a production environment? Is there a remote debugging capability for debugging the plug-ins on the production environment? Any suggestions would be really useful!
推荐答案
要远程调试您的插件,首先将调试参数添加到您的目标 Eclipse .ini 文件中
To remote debug your plug-in, first add debug arguments to your target Eclipse .ini file
-vmargs
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
在启动之前.
然后打开另一个带有包含插件项目的工作区的 Eclipse 实例.打开 Run > Debug Configurations...,选择 Remote Java Application 并创建一个新配置.
Then open another Eclipse instance with a workspace containing your plug-in project. Open Run > Debug Configurations..., select Remote Java Application and create a new configuration.
作为项目,浏览并选择您的插件项目.还要填写您的连接属性(目标 Eclipse 的 host 和 port 1044).
As Project, browse and select your plug-in project. Also fill in your connection properties (host of target Eclipse and port 1044).
启动新创建的调试配置允许您以与本地调试相同的方式调试插件.
Launching the newly created debug configuration allows you to debug your plug-in the same way you debug locally.
这篇关于调试 Eclipse 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!