Unable to debug Eclipse Application because of missing classes - eclipse

I have written an DSL plug-in using Xtext 2.2.1. After upgrading to Xtext 2.3.0, I cannot debug the related Eclipse Application (i.e. I'm using a launch config which is labeled "Eclipse Application" to start an instance with my DSL plug-in from within Eclipse) because of this error:
Error instantiating builder 'org.eclipse.xtext.ui.shared.xtextBuilder'.
Plug-in org.eclipse.xtext.ui.shared was unable to load class org.eclipse.xtext.ui.shared.internal.ExecutableExtensionFactory.
org/eclipse/xtext/ui/guice/AbstractGuiceAwareExecutableExtensionFactory
What I tried:
I deselected all bundles from the target platform in the launch configuration, clicked "Add Required Plug-ins", tried again, same error.
I made sure that org.eclipse.xtext.ui and org.eclipse.xtext.ui.shared version 2.3.0 are available in the plug-ins list and both are enabled.
When I install the plug-in into my IDE, it works perfectly. I just can't launch an Eclipse Application from within the IDE.
"Validate Plug-ins" doesn't show any problems.
Any ideas how I can fix this?

While this is neither an answer to the question, why the launcher stopped working, nor a way to fix the existing launcher, you should at least be able to get back to work by creating a new launcher. To do this, just select Run As > Eclipse Application from the context menu of the XText project. This way, Eclipse should handle the creation and configuration of the launcher for you.
Be sure that Eclipse actually creates a new launcher! If Eclipse finds an existing Eclipse Application launcher, it might use that one instead. You should at least rename the old launcher, so you can tell which one is used (shown at the top of the Console View). The new launcher will by default have the name "Eclipse Application". If Eclipse still uses the old launcher you may have to remove that launcher first.
If you want to find out what was wrong with the old launcher, or if that launcher was specifically configured and you want to preserve that configuration, this may help: Eclipse stores the launcher configurations in the directory .metadata/.plugins/org.eclipse.debug.core/.launches/ located in the workspace, so you could back up the old launcher and then compare it to the newly created one using some diff tool.

Related

Using intellij to debug eclipse plugins

I am currently working on eclipse plug-in that involves many modules, and I would like to debug and run this eclipse plug-in from IntelliJ.I open this project in IntelliJ to edit code but when I have to run/debug this project I have to open eclipse IDE and start it from there. How can I use IntelliJ to do this?
I haven't actually tried this ... but you could try launching the RCP application stand alone but with the remote debug parameters specified for in your application's .ini file.
Then just point IntelliJ to the appropriate source and attach it's debugger to the running app.
Why do you want to do that? Eclipse has multiple tools for the plugin development that you will miss in IntelliJ. Also you need to build your plugin as product headless and then attach a debugger to it.
In my opinion it doesn't worth the effort. I would install Eclipse and devolop with eclipse.

Setting default perspective in Eclipse for plugin development

I'm creating some plugins for Eclipse, and I have selected as Target Platform another Eclipse installation, when I run the plugin it launch the Eclipse instance successfully but it always is opened on the Resources perspective, anyone knows how to specify the default for example Java EE perspective when launching another instance of Eclipse selected as target platform?
You can set the default perspective in the plugin_customization.ini file in the target platform plugins/org.eclipse.sdk (or it might be plugins/org.eclipse.platform depending on your launch configuration). Add the line:
org.eclipse.ui/defaultPerspectiveId=perspective id

How can I run an Eclipse plug-in written by me that automates Eclipse through its GUI using SWTBot

I wrote an Eclipse plug-in using SWTBot to automate Eclipse through its GUI. Actually I'm running this plug-in from Eclipse with Eclipse Application run configuration to test it. That opens a new Eclipse instance. After that I can start the plug-in with a toolbarbutton using ui.actionSets extension.
I'd like to start an Eclipse from command prompt and would like this plug-in to start automatically. In my case Eclipse shall be started with GUI of course.
Do you know any working solution for this problem?
You can use the org.eclipse.ui.startup extension point. You need to provide a IStartup implementing class that is called when the workbench is started.
Note: this is not a complete fail safe method, as the user is able to disable this extension point in the Workbench > Startup preference page.

Debugging Eclipse plug-ins

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.
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!
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.
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?
This is a classic: Eclipse plugins and RCP applications do indeed behave differently between PDT (the Eclipse IDE) and the exported product.
In your case, a NullPointerException thrown from the exported version but not from Eclipse is 9 times out of 10 an image or other resource files (properties, etc.) that is loaded by your code but is not listed in the build.properties of your plugin.
Anyway, you'll need to check the logs to retrieve the stacktrace and hunt down its cause. Such logs could be found in your friend's workspace under le .metadata/.log file
From your development workspace as it stands now, use the "Debug As -> Eclipse Application" menu item to startup a test workspace. When it starts up, you'll have two workspaces running: the original development workspace and the new test workspace. You can set breakpoints in your plugin code in the development workspace and run your plugin in the test workspace.
When your plugin execution in the test workspace gets to one of your breakpoints, execution will pause and you can use the Debug view in your development workspace to look at variables, set more breakpoints or anything else you want to do to debuf your plugin.
See the Apache Wiki for Developing with Eclipse.
Under Windows 10 with Tomcat running as a windows service I started:
tomcat8.5\bin\Tomcat8w.exe
& added in the Java tab as the first entry in Java Options to enable remote debugging:
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n

Can't finish Eclipse Plug-in Project Wizard when choosing RCP

I'm trying create a RCP Application with Eclipse, but I can't get past the 'Content' screen of the New Plug-in Project Wizard.
When I select 'yes' for "Rich Client Application, Would you like to create a rich client application" it disables the Next and the Finish Button.
I first thought it is due to my target platform which is Eclipse 3.2, but changing that doesn't make a difference.
On the top of the screen only one task is displayed (now warnings about missing or incompatible information): Enter the data required to generate the plug-in
My Eclipse Version is 3.5
Any ideas?
Since it was asked. A screenshot can be found here: http://www.flickr.com/photos/jensschauder/4535101973/
This is a longshot, but did you try running eclipse with the "-clean" command line argument? It sometimes solves wierd issues like this one.