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 'errorChannel' bean has a custom definition, for example of amqp PointToPointSubscribableAmqpChannel, then an application fails to start because of thrown java.lang.ClassCastException happens in BeanPostProcessor globalErrorChannelCustomizer in BindingServiceConfiguration auto-configuration.
Actual behavior: globalErrorChannelCustomizer doesn't verify if errorChannel bean is of PublishSubscribeChannel before casting object:
@Bean
public static BeanPostProcessor globalErrorChannelCustomizer() {
return new BeanPostProcessor() {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if ("errorChannel".equals(beanName)) {
((PublishSubscribeChannel) bean).setIgnoreFailures(true);
}
return bean;
}
};
}
Expected behavior: errorChannel object type must be verified before doing any cast on it to avoid java.lang.ClassCastException on application startup.
Version of the framework: tested on v.3.2.10, but this unsafe BeanPostProcessor declaration exist in main.
The text was updated successfully, but these errors were encountered:
Resolves#2883
When an applicaiton provides a custom errorChannel bean that is not of type
`PublishSubscribeChannel`, the application fails to start with a CCE. This is
because `BindingServiceConfiguration` uses a hard cast on `PublishSubscribeChannel`
without pre-checking the channel type. Fixing this issue.
If 'errorChannel' bean has a custom definition, for example of amqp PointToPointSubscribableAmqpChannel, then an application fails to start because of thrown java.lang.ClassCastException happens in BeanPostProcessor globalErrorChannelCustomizer in BindingServiceConfiguration auto-configuration.
Actual behavior: globalErrorChannelCustomizer doesn't verify if errorChannel bean is of PublishSubscribeChannel before casting object:
Expected behavior: errorChannel object type must be verified before doing any cast on it to avoid java.lang.ClassCastException on application startup.
Version of the framework: tested on v.3.2.10, but this unsafe BeanPostProcessor declaration exist in main.
The text was updated successfully, but these errors were encountered: