views:

116

answers:

4

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?

A: 

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.

Markus Lausberg
It is absolutely empty plug-in
EK
This is my activatorhttp://pastebin.com/6S8a8hnr
EK
A: 

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.

Andreas_D
Do You know, how to solve it?
EK
Yes, 'Hello World it is output from my byndle.I downloaded new Eclipse - it is the same errors :(
EK
A: 

Try to do this before running your bundle:

if(!PlatformUI.isWorkbenchRunning()) {
    PlatformUI.createAndRunWorkbench(PlatformUI.createDisplay(), new WorkbenchAdvisor() {...}); 
}
Krumelur
A: 

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.

  1. Please specify how you are launching Eclipse. Did you add -console to the eclipse.ini file?
  2. Does this problem occur when you do NOT try to use your own bundle?
  3. How are you installing and activating your own bundle?
  4. Please paste the following files:
    • The MANIFEST.MF from your own bundle
    • config.ini from ECLIPSE_HOME/configuration
    • eclipse.ini from ECLIPSE_HOME
Neil Bartlett