I don’t understand your explanation.  What is causing the class load?  So far 
it looks like resolution:=optional worked fine, but your code doesn’t implement 
what it needs to make it actually optional.  Maybe the details you left out 
explain better :-)

If you go back to equinox, you might try registering your log service with 
service ranking > 0; that might make it preferred vs the built in equinox one.

david jencks

> On Aug 11, 2016, at 1:36 PM, Benson Margulies <[email protected]> wrote:
> 
> Quite some time ago, we had a requirement to have read-only
> provisioned OSGi caches. So I had set up our standard configuration to
> use Equinox rather than Felix.
> 
> Equinox sets up a LogService of its own, which in turn requires a
> 'LogReader' to get the log messages to show up anywhere. Adding
> another LogService doesn't work. I have yet to figure out how to
> politely instruct Equinox to stay out of the way in this respect.
> 
> As it turns out, the read-only requirement is gone. So I decided that
> since I am in the occasional habit of asking for help on the Felix
> list, it would be good if I was, well, using more of Felix.
> 
> So I switched to the Felix framework (5.4.0). Sure enough, there are
> my log messages.
> 
> But some optional packages are now a problem that worked fine in Equinox.
> 
> I suspect that this will be impossible for anyone to comment on unless
> I can build a minimized test case.
> 
> I get a class not found for a class in a package that I have
> intentionally left out of this deployment. Leaving it out is
> facilitated by the use of resolution:=optional. In Equinox, this works
> fine. In Felix, somehow, something decides that it needs to wire up
> this and fails.
> 
> If by some really unlikely accident this has the earmarks of a
> well-known phenomenon, I'm sure someone will let me know. Otherwise,
> I'll either bail back to Equinox or do the more complex refactoring
> that I'm deferring and be able to remove the optional resolution.
> 
> 
> 
> Caused by: java.lang.ClassNotFoundException:
> org.apache.cxf.common.i18n.Exception not found by
> com.basistech.ws.rosapi-common [21]
> at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
> at 
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to