简体   繁体   中英

Issue with Spring MVC file upload when deployed to JBoss EAP6 server

I have a Spring MVC application that works locally, but when deployed to JBoss EAP6 server, the file upload fails to read the MultipartFile that is being passed in. I am seeing this exception:

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageOutputStreamSpi: Provider com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi not found
    org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1259)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

This is where the application is failing once deployed to the server:

BufferedImage originalImage = ImageIO.read(multipartFile.getInputStream());

If someone has experienced this, please point me in the right direction. What am I missing? Thanks.

The problem was that the JRE version on the server was 1.6.0_25. Changing the JRE to a later version solved this issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM