I try to run OSGi plug in in Eclipse. It is empty bundle, but eclipse always send me errors There are my console messages http://pastebin.com/dqQfpQhd What is wrong?
First check the dependencies of the empty plugin. May be you are missing to add a plugin, whcih is not loaded at runtime.
If you have dependencies in your plugin, check hich version of the plugins are used.
Which Java version you have defined in your plugin? Is it higher, than the version you are using at runtime?
Is your plugin loading DLLs? if so, check whether the DLL can be found at runtime.
Edit:
# Workbench has not been created yet. # at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92) # at org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin.start(MonitorUiPlugin.java:145)
What did you define in the start method of the Activator? It sems, that you are using the workbench which is not created yet.
This is the main problem:
java.lang.IllegalStateException: Workbench has not been created yet.
You're using methods/objects from the workbench or related to the workbench while the workbench itself has not been created yet. Maybe you can delay the activation of the bundle or remove 'workbench' dependencies from the activation/initialisation part of the bundle.
Yikes, back to the beginning. The last line of the log containes a 'Hello World' - is this the expected output from your bundle? Maybe it's not your bundle that causes the errors and warnings on the output. I see some 'mylin' and other stuff too. If possible, add another clean installation of eclipse (no additional bundles/plugins) to your system and try the bundle in that environment.
From a good article on eclipsezone:
This usually comes when someone tries to run a Java application against an OSGi bundle with java -classpath .... . It really means that the workbench plug-in hasn't started yet, and so calls to getWorkbench() fail. This is essentially a race condition, and can be solved by either expressing an explicit dependency on that bundle or bumping up that bundle to a higher start level than the workbench. Generally not seen, but if it is, that's what's happening.
What's the superclass of your own bundle? Because that could introduce a dependency on the workbench.
And - how do 'start' the bundle, from within eclipse or hav you jar'ed it up and put it in the eclipse plugin folder? That could make a difference too.
Try to do this before running your bundle:
if(!PlatformUI.isWorkbenchRunning()) {
PlatformUI.createAndRunWorkbench(PlatformUI.createDisplay(), new WorkbenchAdvisor() {...});
}
None of those errors have anything to do with your bundle. As you can see from the "Hello World" output, your bundle is starting just fine.
I believe you are launching Eclipse in the wrong way, probably eagerly activating all the bundles. Eclipse needs to start with most workbench bundles in "lazy activation" mode.
- Please specify how you are launching Eclipse. Did you add
-console
to theeclipse.ini
file? - Does this problem occur when you do NOT try to use your own bundle?
- How are you installing and activating your own bundle?
- Please paste the following files:
- The
MANIFEST.MF
from your own bundle config.ini
fromECLIPSE_HOME/configuration
eclipse.ini
fromECLIPSE_HOME
- The