Hi Daniel,

Damn!
Before making this change someone with OSGi expertize asserted that
ServiceLoader is working in OSGi.
We even had a discussion before making this change here at dev@.

At the moment OSGi looks like the Portlet support in Wicket 1.4 - no one
from the developers uses the technology and it is hard (impossible) for us
to support it.
It should be possible to make this pluggable. I guess it was not made this
way because this is core functionality that would break Wicket if custom
implementation make something wrong.
But I see no other way than make it pluggable and let OSGi users like you
deal with the differences in OSGi environment.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Feb 22, 2016 at 12:50 PM, Daniel Stoch <[email protected]>
wrote:

> Hi,
>
> I have just upgraded our project form 6.21.0 to 6.22.0. It seems that
> changes from WICKET-6030 generates such errors during application
> start:
>
> Exception in bottom level event dispatcher:
> org.apache.wicket.IInitializer: Provider
> org.apache.wicket.extensions.Initializer not found
> java.util.ServiceConfigurationError: org.apache.wicket.IInitializer:
> Provider org.apache.wicket.extensions.Initializer not found
>     at java.util.ServiceLoader.fail(ServiceLoader.java:239)
>     at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
>     at
> java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
>     at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
>     at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
>     at org.apache.wicket.Application.initInitializers(Application.java:620)
>     at
> org.apache.wicket.Application.initializeComponents(Application.java:525)
>     at org.apache.wicket.Application.initApplication(Application.java:829)
>     at
> org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:427)
>     at
> org.apache.wicket.protocol.http.WicketServlet.init(WicketServlet.java:271)
>
>
> The problem was introduced by usage of:
> ServiceLoader.load(IInitializer.class) and it is better described
> here:
> http://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html
>
> http://coderthoughts.blogspot.com/2011/08/javautilserviceloader-in-osgi.html
>
> In modular and dynamic environments such static service loading is
> always problematic. For now I am investigating how to fix this in our
> project and maybe in Wicket core too. Maybe you also will have some
> ideas (eg. allow to define a custom IInitializer loading mechanism and
> then use a OSGi service registry)?
>
> --
> Best regards,
> Daniel Stoch
>

Reply via email to