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
We are currently building a Spring Boot-based service that will use plugins to make it highly customizable for our users.
One thing we try to do is providing beans via plugins that can be injected by the host application.
From what I found so far, it looks like the plugin manager isn't instantiated yet when Spring tries to resolve all injectable dependencies.
To make this (hopefully) a bit easier to understand, here is an example project
In the given example, I try to inject a bean from the plugin into the main application. This results in the application not even starting, as Spring doesn't seem to find the bean it needs to inject.
Later, we would like to use plugins to provide database connections. So, we would need @Configuration classes and injection working within and from the plugin.
Is this possible? Are there examples I can have a look at?
The text was updated successfully, but these errors were encountered:
The dictionaryController is null. I think the reason is when we start the plugin we will new AnnotationConfigApplicationContext(); .
so when we use @Autowired , it will query the bean from the new application context . not the main application context.
So you need to add the code: applicationContext.setParent(((SpringPluginManager) getWrapper().getPluginManager()).getApplicationContext());
When you create the applicationContext in you SpringPlugin Class.
I don't use Spring with PF4J in my projects and from this reason I don't have a rich expertise on this subject.
Please read #27 (comment), and take a look on Spring ApplicationContext hierarchies.
Hi.
We are currently building a Spring Boot-based service that will use plugins to make it highly customizable for our users.
One thing we try to do is providing beans via plugins that can be injected by the host application.
From what I found so far, it looks like the plugin manager isn't instantiated yet when Spring tries to resolve all injectable dependencies.
To make this (hopefully) a bit easier to understand, here is an example project
In the given example, I try to inject a bean from the plugin into the main application. This results in the application not even starting, as Spring doesn't seem to find the bean it needs to inject.
Later, we would like to use plugins to provide database connections. So, we would need
@Configuration
classes and injection working within and from the plugin.Is this possible? Are there examples I can have a look at?
The text was updated successfully, but these errors were encountered: