Issue 1:
Donny A. Wijaya opened SPR-7229 and commented

Affects: 3.0.2

Issue Links:

#9424 Add additional redirect prefixes to allow for more control over redirect behavior ("duplicates")

Issue 2:
Marvel opened SPR-5212 and commented

This is the worst possible kind of bug report, and so I apologize in advance, but it has only appeared once in production and was not reproducible. On top of that, the actual case that generates the error seems to be pretty much impossible. The cast exception you see below, is in this Spring code:

/**
* Return the class name of the wrapped bean.
*/
public String getBeanClassName() {
if (this.beanClass instanceof Class) {
return ((Class) this.beanClass).getName();
}
else {
return (String) this.beanClass;
}
}

As you can see the method checks if the field is a Class, and casts to it if it is. However, in this case below, for some reason, it tried to cast it to a String even though it was a Class. I don't know if this is some strange classloading issue, a JVM bug, or what, but I figured you would want to at least see it.

Stack trace:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityModel' defined in class path resource [applicationContext-siteresources.xml]: Initialization of bean failed; nested exception is java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.String Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.String

at org.springframework.beans.factory.support.AbstractBeanDefinition.getBeanClassName(AbstractBeanDefinition.java:311)

at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:327)

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1066)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:349)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:270)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:881)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:829)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:424)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:270)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:229)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)

at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:733)

at com.cargurus.site.interceptor.ModelInterceptor.intercept(ModelInterceptor.java:75)

Affects: 2.0.5

Issue Links:

#9886 Class cast exception in AbstractBeanDefinition.getBeanClassName(AbstractBeanDefinition.java:305) ("duplicates")