-
Feature
-
Resolution: Done
-
Minor
-
fuse-7.7-GA
-
False
-
False
-
0
-
0%
-
-
+
-
Automated
-
This test results in the following error.
java.lang.IllegalStateException: UT010057: multipart config was not present on Servlet at io.undertow.servlet.spec.HttpServletRequestImpl.verifyMultipartServlet(HttpServletRequestImpl.java:541) at io.undertow.servlet.spec.HttpServletRequestImpl.getPart(HttpServletRequestImpl.java:547) at org.apache.camel.component.servlet.springboot.test.ServletMultiPartTest$1.lambda$configure$0(ServletMultiPartTest.java:63) at org.apache.camel.support.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:66) at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:469) at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179) at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64) at org.apache.camel.processor.Pipeline.process(Pipeline.java:184)
The only workaround here is to disable default auto configuration:
camel.component.servlet.mapping.enabled=false
And create a custom servlet auto configuration class:
@Configuration @EnableConfigurationProperties(ServletMappingConfiguration.class) public class CustomAutoConfiguration { @Bean ServletRegistrationBean servletRegistrationBean(ServletMappingConfiguration config) { ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings(config.getContextPath()); mapping.setName(config.getServletName()); mapping.setLoadOnStartup(1); mapping.setMultipartConfig(new MultipartConfigElement("/tmp")); return mapping; } }