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
If there is a persistence exception this now causes the following exception (at runtime):
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'protoConnectionFactory' defined in FooConfig: Unsatisfied dependency expressed through method 'protoConnectionFactory' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'foo.Bar' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1179)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:571)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:353)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory$1.orderedStream(DefaultListableBeanFactory.java:481)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:167)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:149)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:174)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy214.saveAndFlush(Unknown Source)
In other words, it is trying to instantiate the prototype bean now (RedisConnectionFactory is a PersistenceExceptionTranslator).
I'm pretty sure we could workaround this behavior by dynamically registering these beans (not using prototypes), but, this seems like a potential regression.
The text was updated successfully, but these errors were encountered:
Since nobody else seems to have hit this in 6 months, maybe we should consider this expected behavior now? Or, do you anticipate addressing it in a point release somewhat soon? Trying to determine whether to implement a workaround or not to avoid being stuck on an old release. Thanks.
Affects: spring framework 5.3.3
Attempting to upgrade our application to boot 2.4.2 from 2.3.4 and ran into this issue.
We have a prototype bean defined as:
If there is a persistence exception this now causes the following exception (at runtime):
In other words, it is trying to instantiate the prototype bean now (RedisConnectionFactory is a PersistenceExceptionTranslator).
I believe this was caused by:
14839b1
Previously:
Excluded prototypes (the first false).
I'm pretty sure we could workaround this behavior by dynamically registering these beans (not using prototypes), but, this seems like a potential regression.
The text was updated successfully, but these errors were encountered: