0
votes

i have a plugin in eclipse, which is work perfect. Now i have to implement headless plugin functionality.

I added the following code in plugin.xml

<extension
     id="id1"
     point="org.eclipse.core.runtime.applications">
  <application>
     <run
           class="de.**.HeadlessPlugin">
     </run>
  </application>

Then i created the following class "HeadlessPlugin"

package de.tsystems.together.mqc.impl;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IExecutableExtensionFactory;
import org.eclipse.core.runtime.IPlatformRunnable;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;


public class HeadlessPlugin implements IExecutableExtensionFactory {  

    public HeadlessPlugin()
    {

    }

    public Object create() throws CoreException {
        System.out.println("Hello world");
        return null;
    }  
}  

I exported the plugin correctly and installed the same in a new eclipse instance. Then i try to start the plugin via cmd:

java -jar "plugins/org.ecplise.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" org.eclipse.core.launcher.Main -application de.***.id1

After this eclipse occured an error:

org.eclipse.core.runtime.CoreException: Plug-in de.* was unable to load class de.*.HeadlessPlugin.

Have anyone an idea??

Stack trace:

!ENTRY org.eclipse.osgi 4 0 2013-08-19 14:15:47.344 
!MESSAGE Application error 
!STACK 1 
org.eclipse.core.runtime.CoreException: Plug-in de.** was unable to load class de.**.HeadlessPlugin. 
...
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle de.** (1522). 
...
Caused by: org.osgi.framework.BundleException: The activator de.**.Plugin for bundle de.** is invalid 
...
Caused by: java.lang.NoClassDefFoundError: org/eclipse/ui/plugin/AbstractUIPlugin 
1
Why was Eclipse unable to load the class de.*.HeadlessPlugin?Aaron Digulla
thats exactly my problem...Alexander G.
Please post the stack trace.Aaron Digulla
here is the stack trace nopaste.info/372b075ac3.htmlAlexander G.

1 Answers

0
votes

As the error message in the stack trace says, your plugin depends on AbstractUIPlugin but this bundle isn't installed.

You will have to remove all UI references from your code and try again.