SCR does not alter the class loading setup of a bundle. That is, DynamicImport-Package will work either way. You can even use a normal BundleActivator with SCR assuming you use lazy activation. When SCR goes to load the first class from a bundle, the lazy activation will trigger the execution of the BundleActivator.
The only thing that may be different is timing in bundle startup. You may need to do some class loader diagnostics to see what is actually happening. -- BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the OSGi Alliance [EMAIL PROTECTED] office: +1 386 848 1781 mobile: +1 386 848 3788 From: "Michael Furtak" <[EMAIL PROTECTED]> To: <[email protected]> Date: 2007-11-05 11:22 Subject: [equinox-dev] Differences in classloading between standard activators and Declarative Services 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 THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your use of this message for any purpose is strictly prohibited. If you have received this communication in error, please delete the message and notify the sender so that we may correct our records. _______________________________________________ equinox-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________ equinox-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/equinox-dev
