Hi all,
I have a quick question about a possible difference I am
noticing between the way classes are loaded in standard Equinox activators and
the DS SCR in equinox 3.4.I20071023-0800.
Specifically, when transitioning to DS, I have started
running into exceptions that I see commonly when Swing cannot acquire the
L&F classes it needs. I have solved these problems in the standard
activator scenario by:
1) Making sure
that bundles that introduce new L&F classes export those classes
2) Having the
bundles that wind up triggering these Swing look-ups include
DynamicImport-Package: * in their manifest.
What seems to be the case is that the SCR is not honoring
that DynamicImport-Package statement, because when I switch to those services
being started via DS, I run into the errors again. Those errors look like this:
UIDefaults.getUI() failed: no ComponentUI class for:
javax.swing.JMenuItem…
java.lang.Error
at
javax.swing.UIDefaults.getUIError(UIDefaults.java:691)
at
javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
at
javax.swing.UIDefaults.getUI(UIDefaults.java:721)
at
javax.swing.UIManager.getUI(UIManager.java:860)
at
javax.swing.JMenuItem.updateUI(JMenuItem.java:208)
at
javax.swing.JMenuItem.init(JMenuItem.java:170)
at
javax.swing.JMenuItem.<init>(JMenuItem.java:119)
…
To restate the difference clearly, the same services started
via OSGi activator do not produce the errors, where the DS start-up does.
Any insight or suggestions for a better solution to the
Swing L&F issues would be appreciated.
Thanks,
-Mike Furtak