调试eclipse插件 [英] Debugging eclipse plug-ins

查看:91
本文介绍了调试eclipse插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次尝试创建一个eclipse插件。我创建了一个,以及一个功能和更新站点。我将目标平台设置为我的本地eclipse安装。当我从开发环境中运行/调试插件时,一切正常。



现在,我的同事从我所托管的更新站点安装了插件。当他开始使用我的插件暴露的任何功能时,他得到运行时异常。


  1. 他看到空指针异常,当我从我的开发环境运行我的插件项目时没有发生。

  2. 我有一个向导是我的插件的一部分。当他关闭它时,他收到一个未处理的事件循环异常,向导不会关闭。我在开发环境中运行/调试我的插件时没有这个问题。

现在我很困惑为什么同一插件在生产环境中的行为方式与开发环境不同,以及何时从IDE中进行调试。这两种情况下的目标平台是相同的eclipse版本。可能是什么原因?
如何在生产环境中调试插件?是否有用于调试生产环境中的插件的远程调试功能?
任何建议都是非常有用的!



谢谢&对于远程调试您的插件,首先将调试参数添加到您的目标Eclipse .ini文件中,然后单击下一步,然后单击下一步。文件

  -vmargs 
-Xdebug
-Xrunjdwp:transport = dt_socket,server = y,suspend =在启动之前,n,address = 1044



然后使用包含插件项目的工作区打开另一个Eclipse实例。
打开运行> 调试配置... ,选择远程Java应用程序并创建一个新的配置。



作为项目,浏览并选择插件项目。
还请填写您的目标Eclipse和端口 1044的连接属性(主机 1044)。



启动新创建的调试配置允许您以与本地调试相同的方式调试插件。


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.

  1. He sees null pointer exceptions which didn't occur when I ran my plug-in project from my development environment.
  2. 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.

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!

Thanks & Regards, Anand

解决方案

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

before launching it.

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.

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插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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