I can't respond theoretically to this but would be happy to look at it if
you could put a small app together that reproduces this, on GitHub.

Gj

On Sat, Aug 17, 2019 at 8:12 AM Damian Carey <jami...@gmail.com> wrote:

> Hi all,
>
> We have a "mature" (10+ year old) Netbeans Platform Swing product, which
> has 35+ modules. This all works well.
>
> As usual, when one Netbeans module provides an Implementation we find it
> from other Netbeans modules using the usual idiom ...
> Provider: puts entry in META-INF/services
> Consumer: MyClass myObj = Lookup.getDefault().lookup(MyClass.class);
>
> Our current issue is that we need to add an external jar that is NOT built
> using Netbeans, so it can't use Lookup. I have placed this external jar
> into a module wrapper, and one of our modules depends on it so we can
> successfully start this service as appropriate. Again, everything is
> perfect with this setup.
>
> The problem is that this external jar is looking for services from our
> Netbeans platform product, it is seeking them using standard java
> ServiceLoader capability, but the implementations are not found.
>
> I *think* that if we use the Netbeans System ClassLoader then it CAN
> locate the implementations, however we don't want to use the system
> classloader because it will cause other issues.
>
> Does anyone have any suggestions on how a wrapped jar might access
> Netbeans META-INF/services implementations via vanilla Java ServiceLoader
> SPI interface?
>
> Any suggestions would be hugely appreciated.
>
> Many thanks,
> -Damian
>

Reply via email to