Open frehov opened 2 years ago
Please provide an example that reproduces the problem
@graemerocher I've added an example in the original submisson, but for brewity here's the link https://github.com/frehov/micronaut-spring-failing-context-lookup-demo
The code doing the lookup through context is in the StartupListener
class, I've also added a third example which is using the Spring BeanFactoryUtils
The exception thrown is NoSuchBeanDefinitionException
and not NoSuchBeanException
, I've also updated to micronaut 3.2.2, but the issue is present in 3.2.0 and 3.2.1 as well.
Expected Behavior
When using the application context to lookup beans of a certain type, I expect to get all beans associated with that type.
Actual Behaviour
Steps To Reproduce
ConfigurationProperty
-class annotated with@EachProperty("a.b")
and@Context
the class should receive the named parameter in it's constructorApplicationEventListener<StartupEvent>
and inject both micronaut and spring application contextsa.b.a
,a.b.b
,a.b.c
to application.ymlmicronautContext.getBeansOfType(Config.class)
and get 3 configuration class beans.springContext.getBeansOfType(Config.class)
and get aNoSuchBeanException
with a message"No bean named 'Config(a)' available"
(there might be a variation of either a, b or c as the name.)Environment Information
Example Application
Demo Application
Version
3.2.1