You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm making a spring boot application using Wicket and PF4J. I want to use spring services in my plugins. These services are not using services outside the plugin class loader. In my plugin, I can have wicket panels. The panel class can use the Spring service.
@ServicepublicclassLabelService {
publicStringgetLabel() {
return"Hello World from the plugin.";
}
}
To display the configuration, i'm using this page in my application:
publicclassPluginTestPageextendsWebPage {
@SpringBeanprivatePluginManagerpluginManager;
publicPluginTestPage() {
finalPluginWrapperpluginWrapper = pluginManager.getPlugin("example");
if (pluginWrapper.getPlugin() instanceofMyPluginConfiguration) {
finalMyPluginConfigurationpluginConfiguration = (MyPluginConfiguration) pluginWrapper.getPlugin();
add(pluginConfiguration.getConfigurationPanel("configuration-panel"));
} else {
add(newLabel("configuration-panel", "Can't get the configuration panel"));
}
}
}
When I'm asking the PluginTestPage, I have this error:
org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public com.example.pages.PluginTestPage()'. An exception has been thrown during construction!
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:194) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:67) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:90) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.core.request.handler.PageProvider$Provision.getPage(PageProvider.java:369) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:170) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:231) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:202) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:917) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:63) ~[wicket-request-9.0.0.jar:9.0.0]
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:254) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:222) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:276) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:207) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:300) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.37.jar:9.0.37]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:175) ~[wicket-core-9.0.0.jar:9.0.0]
... 33 common frames omitted
Caused by: java.lang.IllegalStateException: Concrete bean could not be received from the application context for class: com.example.pf4j_wicket_spring.services.LabelService.
at org.apache.wicket.spring.SpringBeanLocator.lookupSpringBean(SpringBeanLocator.java:277) ~[wicket-spring-9.0.0.jar:9.0.0]
at org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:198) ~[wicket-spring-9.0.0.jar:9.0.0]
at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:150) ~[wicket-spring-9.0.0.jar:9.0.0]
at org.apache.wicket.injection.Injector.inject(Injector.java:111) ~[wicket-ioc-9.0.0.jar:9.0.0]
at org.apache.wicket.spring.injection.annot.SpringComponentInjector.inject(SpringComponentInjector.java:124) ~[wicket-spring-9.0.0.jar:9.0.0]
at org.apache.wicket.spring.injection.annot.SpringComponentInjector.onInstantiation(SpringComponentInjector.java:130) ~[wicket-spring-9.0.0.jar:9.0.0]
at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80) ~[wicket-util-9.0.0.jar:9.0.0]
at org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.Component.<init>(Component.java:682) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.MarkupContainer.<init>(MarkupContainer.java:185) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.markup.html.WebMarkupContainer.<init>(WebMarkupContainer.java:53) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.markup.html.WebMarkupContainer.<init>(WebMarkupContainer.java:45) ~[wicket-core-9.0.0.jar:9.0.0]
at org.apache.wicket.markup.html.panel.Panel.<init>(Panel.java:67) ~[wicket-core-9.0.0.jar:9.0.0]
at com.example.pf4j_wicket_spring.panels.ConfigurationPanel.<init>(ConfigurationPanel.java:25) ~[na:na]
at com.example.pf4j_wicket_spring.MyPlugin.getConfigurationPanel(MyPlugin.java:40) ~[na:na]
at com.example.pages.PluginTestPage.<init>(PluginTestPage.java:30) ~[classes/:na]
... 38 common frames omitted
Is it a mistake with my settings ?
Regards,
Stef
The text was updated successfully, but these errors were encountered:
Please take a look at pf4j-wicket. Maybe you can match pf4j-spring with pf4j-wicket.
By the way, I used Wicket in the past with a real success and pleasure. It's a nice web framework.
Hello,
I'm making a spring boot application using Wicket and PF4J. I want to use spring services in my plugins. These services are not using services outside the plugin class loader. In my plugin, I can have wicket panels. The panel class can use the Spring service.
Here the class of the plugin:
Its interface:
The SpringConfiguration class:
The configuration panel:
And the service:
To display the configuration, i'm using this page in my application:
When I'm asking the PluginTestPage, I have this error:
Is it a mistake with my settings ?
Regards,
Stef
The text was updated successfully, but these errors were encountered: