Closed mcr-paulanand closed 1 month ago
Hello @martin-g,
It seems this PR breaks samples
Webjars are being used from Initializer
from now on
so we got
Caused by: java.lang.IllegalStateException: you have to call WicketWebjars.install() before you can use an IWebjarsResourceReference or any other component.
at de.agilecoders.wicket.webjars.WicketWebjars.settings (WicketWebjars.java:136)
at de.agilecoders.wicket.webjars.util.WebjarsVersion$Holder.<clinit> (WebjarsVersion.java:29)
at de.agilecoders.wicket.webjars.util.WebjarsVersion.useRecent (WebjarsVersion.java:45)
at de.agilecoders.wicket.webjars.request.resource.WebjarsJavaScriptResourceReference.<init> (WebjarsJavaScriptResourceReference.java:29)
at org.wicketstuff.jquery.ui.resource.JQueryUIResourceReference.<init> (JQueryUIResourceReference.java:54)
at org.wicketstuff.jquery.ui.resource.JQueryUIResourceReference.<clinit> (JQueryUIResourceReference.java:37)
at org.wicketstuff.jquery.ui.settings.JQueryUILibrarySettings.<init> (JQueryUILibrarySettings.java:49)
at org.wicketstuff.jquery.ui.settings.JQueryUILibrarySettings.get (JQueryUILibrarySettings.java:61)
at org.wicketstuff.jquery.ui.theme.Initializer.init (Initializer.java:37)
at org.apache.wicket.Application.initInitializers (Application.java:561)
at org.apache.wicket.Application.initApplication (Application.java:767)
at org.apache.wicket.protocol.http.WicketFilter.init (WicketFilter.java:441)
due to WicketWebjars.install(this);
is being called in the init()
i.e. too late :(
What can be done here?
As error message suggests we need to add 'WicketWebjars.install()' to the respective WebApplication#init()
Oh, now I see the text after the stacktrace. I think it should be OK to call it in an initializer too.
Works as expected!
Thanks a million @martin-g :)
due to WicketWebjars.install(this); is being called in the init() i.e. too late :(
@solomax so how did you solve this?
I think this change needs to be made in the initializer of all of the themes separately.
I think this change needs to be made in the initializer of all of the themes separately.
I also thought so
But I believe right now it's not necessary due to the fact the only theme uses webjar so far :)
I think this change needs to be made in the initializer of all of the themes separately.
I also thought so
But I believe right now it's not necessary due to the fact the only theme uses webjar so far :)
I have created a PR #934 to resolve this
Resolves #926