I am trying to add BlazeDS to a Spring Boot application. I have added the `MessageBrokerServlet' in my configuration for this:
@Bean
public ServletRegistrationBean messageBrokerRegistration()
{
ServletRegistrationBean registration = new ServletRegistrationBean(new MessageBrokerServlet(), "/messagebroker/*");
Map<String,String> params = Maps.newHashMap();
params.put( "services.configuration.file", "/WEB-INF/flex/services-config.xml" );
registration.setInitParameters(params);
return registration;
}
The servlet gets loaded, but fails at runtime with:
MessageBrokerServlet in application 'undefined' failed to initialize due to runtime exception:
Exception: flex.messaging.config.ConfigurationException: Please specify a
valid 'services.configuration.file' in web.xml. You specified '{0}'.
This is not a valid file system path reachable via the app server and
is also not a path to a resource in your J2EE application archive.
Looking through the source code of BlazeDS, I see that in the end, the code uses ServletContext#getResourceAsStream(path)
. How can I make the embedded tomcat in Spring Boot return something on that call?
I am using Spring Boot 1.1.1 which uses embedded Tomcat 7.0.54