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
Repositories with generics should be able to be injected
Actual Behaviour
From micronaut 4.4.0 onwards, it throws an exception
java.util.NoSuchElementException
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:970)
at io.micronaut.context.DefaultBeanContext.lastChanceResolve(DefaultBeanContext.java:3233)
at io.micronaut.context.DefaultBeanContext.pickOneBean(DefaultBeanContext.java:3197)
at io.micronaut.context.DefaultBeanContext.findConcreteCandidateNoCache(DefaultBeanContext.java:3153)
at io.micronaut.context.DefaultBeanContext.findConcreteCandidate(DefaultBeanContext.java:3136)
at io.micronaut.context.DefaultBeanContext.findBeanDefinitionInternal(DefaultBeanContext.java:762)
at io.micronaut.context.DefaultBeanContext.resolveMetadata(DefaultBeanContext.java:485)
at io.micronaut.test.extensions.junit5.MicronautJunit5Extension.lambda$alignMocks$0(MicronautJunit5Extension.java:293)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
Hi! Thanks for the reproduction, it pretty clean. So I think we got this problem due to this one from #8326. I will try to fix it
UPD: there's problem with incomplete Argument (in the right way it should be like Argument of "AInterface<String K, String V> param" but we got just Argument of "AInterface param") it may be just problem with MicronautJunit5Extension.
So your problem exists, but I can't reproduce it in MK's internal tests. This problem occurs because arguments builder is not working properly somewhere and parses this class with incomplete information, and then this line clears the entire list of candidates for implementation, and the application crashes with an exception.
So I think we need to reproduce this without a test frame and see what happens.
UPD2: MK is working fine during execution. The problem exists only in the test frame.
Expected Behavior
Repositories with generics should be able to be injected
Actual Behaviour
From micronaut 4.4.0 onwards, it throws an exception
Steps To Reproduce
Reproduction provided at https://github.com/gnarroway-bullish/micronaut-error
It passes for 4.1.0-4.3.0 inclusive
It fails for 4.0.0, and 4.4.0-4.7.5 inclusive
#9751 had a related issue which was fixed for a few versions.
Environment Information
Example Application
https://github.com/gnarroway-bullish/micronaut-error
Version
4.7.5
The text was updated successfully, but these errors were encountered: