Tag Archives: osgi

Displaying Error Messages in Equinox

Just found out via this blog post how to actually enable displaying of debug messages in Eclipse Equinox when using declarative services. Just add

-Dequinox.ds.print=true

as a VM argument when starting equinox, e.g. in the Run Configuration within Eclipse. Very helpful if you are informed why your bundle doesn’t start as expected.

Using Substance Look and Feel within OSGi

I am currently porting the KAT to OSGi in order to get a more sphisticated runtime environment that is separated from the user interface. The reason is that we also want to develop a web version of Semaplorer. However, I had some problem with running the current GUI within OSGi. The reason was that the Substance classes could not be located and I got a bunch of exceptions like the following:

UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JButton[...

Some searching around the web lead me to the following solution:

UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
UIManager.getLookAndFeelDefaults().put("ClassLoader", SubstanceLoader.class.getClassLoader());
It seems that swing does not get the right class loader.