大佬们,我正在尝试写一个XmlRpc的插件,但我遇到了一个问题,我无法在插件中使用@Autowired注入PostService,请问怎么样才能拿到呢
以下是报错信息
2022-11-11T09:15:42.824+08:00 ERROR 7 --- [nciler-thread-1] r.h.a.e.controller.DefaultController : Reconciler aborted with an error, re-enqueuing...
org.pf4j.PluginRuntimeException: Error creating bean with name 'run.halo.starter.PostServiceGetter': Unsatisfied dependency expressed through field 'postService': No qualifying bean of type 'run.halo.app.content.PostService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at run.halo.app.core.extension.reconciler.PluginReconciler.handleStatus(PluginReconciler.java:184) ~[classes/:2.0.0-alpha.4]
at run.halo.app.core.extension.reconciler.PluginReconciler.lambda$startPlugin$4(PluginReconciler.java:132) ~[classes/:2.0.0-alpha.4]
at java.base/java.util.Optional.ifPresent(Unknown Source) ~[na:na]
at run.halo.app.core.extension.reconciler.PluginReconciler.startPlugin(PluginReconciler.java:128) ~[classes/:2.0.0-alpha.4]
at run.halo.app.core.extension.reconciler.PluginReconciler.reconcilePluginState(PluginReconciler.java:103) ~[classes/:2.0.0-alpha.4]
at run.halo.app.core.extension.reconciler.PluginReconciler.lambda$reconcile$0(PluginReconciler.java:60) ~[classes/:2.0.0-alpha.4]
at java.base/java.util.Optional.ifPresent(Unknown Source) ~[na:na]
at run.halo.app.core.extension.reconciler.PluginReconciler.reconcile(PluginReconciler.java:54) ~[classes/:2.0.0-alpha.4]
at run.halo.app.core.extension.reconciler.PluginReconciler.reconcile(PluginReconciler.java:39) ~[classes/:2.0.0-alpha.4]
at run.halo.app.extension.controller.DefaultController.run(DefaultController.java:114) ~[classes/:2.0.0-alpha.4]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]