Well this has nothing to do with DS - how should Java load this class if a needed class is not available?
Carsten Osgi Developer Mail List wrote > I think it can not work with a simple optional import. What could work > is a separate component that hasĀ > the optional class as a mandatory reference. > > This component could then be injected into your component with an > optional reference and with an interface that is independent of the > optional import. > > I think declarative services do not yet support this but it would be a > very valuable feature as it allows to handle optional imports without > any class loading magic on the user side. > > Christian > > 2017-11-21 14:53 GMT+01:00 Robert Munteanu via osgi-dev > <osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>>: > > Hi Carsten, > > On Tue, Nov 21, 2017 at 3:50 PM, Carsten Ziegeler > <cziege...@apache.org <mailto:cziege...@apache.org>> wrote: > > Hi, > > > > if I understand you correctly you have an optional package import to the > > package providing BarService? > > Yes, that is correct. > > > In that case your class SomeComponent can't be loaded if that package is > > not available and there is no magic to get around this. > > I was afraid of that. I'll try using a ServiceTracker, guess that's > the next best thing. > > Thanks, > > Robert > _______________________________________________ > OSGi Developer Mail List > osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org> > https://mail.osgi.org/mailman/listinfo/osgi-dev > <https://mail.osgi.org/mailman/listinfo/osgi-dev> > > > > > -- > -- > Christian Schneider > http://www.liquid-reality.de > <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de> > > Computer Scientist > http://www.adobe.com > > > > _______________________________________________ > OSGi Developer Mail List > osgi-dev@mail.osgi.org > https://mail.osgi.org/mailman/listinfo/osgi-dev > -- Carsten Ziegeler Adobe Research Switzerland cziege...@apache.org _______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev