If I define few SpringVaadinServlets in my war with different "contextConfiguration" only one of them works.
I guess the reason is static nature of SpringApplicationContext.
public class SpringApplicationContext implements Serializable
{
private static transient ApplicationContext applicationContext;
public static void setApplicationContext(ApplicationContext applicationContext)
{
SpringApplicationContext.applicationContext = applicationContext;
}
public static ApplicationContext getApplicationContext()
{
return applicationContext;
}
}
It is set in SpringVaadinServlet/Portlet.init(...) and used later in different places.
But when you have more than one Servlet defined in web.xml, the applicationContext in SpringApplicationContext is overridden by the last initialized servlet.
As a result only one servlet gets correct ApplicationContext. Others have to use in too, and it means NoSuchBeanDefinitionException...
pure static evil :)
If I define few SpringVaadinServlets in my war with different "contextConfiguration" only one of them works.
I guess the reason is static nature of SpringApplicationContext.
It is set in SpringVaadinServlet/Portlet.init(...) and used later in different places.
But when you have more than one Servlet defined in web.xml, the applicationContext in SpringApplicationContext is overridden by the last initialized servlet.
As a result only one servlet gets correct ApplicationContext. Others have to use in too, and it means NoSuchBeanDefinitionException...
pure static evil :)