Troubleshoot tomcat error Javax.imageio.IIOException:Can ' t create output stream!

Source: Internet
Author: User

Start Tomcat Catalina.out error as follows, cannot display the verification code when landing

2017-06-09 11:23:06,628 DEBUG org.springframework.web.servlet.DispatcherServlet 845-dispatcherservlet with Name ' Spring-mvc ' processing GET request for [/data-analysis/kaptchaimage.do]
2017-06-09 11:23:06,629 DEBUG o.s.w.s.m.m.a.requestmappinghandlermapping 297-looking up handler method for Path/kaptcha Image.do
2017-06-09 11:23:06,629 DEBUG o.s.w.s.m.m.a.requestmappinghandlermapping 302-returning handler method [public Org.springframework.web.servlet.ModelAndView Com.chinasoft.web.dataanalysis.business.sys.controller.LoginController.getKaptchaImage ( Javax.servlet.http.httpservletrequest,javax.servlet.http.httpservletresponse) throws Java.lang.Exception]
2017-06-09 11:23:06,630 DEBUG o.s.b.factory.support.defaultlistablebeanfactory 248-returning Cached instance of Singleton Bean ' Logincontroller '
2017-06-09 11:23:06,630 DEBUG org.springframework.web.servlet.DispatcherServlet 931-last-modified value for [/ Data-analysis/kaptchaimage.do] is:-1
2017-06-09 11:23:06,773 DEBUG o.s.w.s.m.m.a.exceptionhandlerexceptionresolver 134-resolving exception from Handler [ Public Org.springframework.web.servlet.ModelAndView Com.chinasoft.web.dataanalysis.business.sys.controller.LoginController.getKaptchaImage ( Javax.servlet.http.httpservletrequest,javax.servlet.http.httpservletresponse) throws Java.lang.Exception]: Javax.imageio.IIOException:Can ' t create output stream!
2017-06-09 11:23:06,775 DEBUG o.s.w.s.m.a.responsestatusexceptionresolver 134-resolving exception from handler [public Org.springframework.web.servlet.ModelAndView Com.chinasoft.web.dataanalysis.business.sys.controller.LoginController.getKaptchaImage ( Javax.servlet.http.httpservletrequest,javax.servlet.http.httpservletresponse) throws Java.lang.Exception]: Javax.imageio.IIOException:Can ' t create output stream!
2017-06-09 11:23:06,776 DEBUG o.s.w.s.m.support.defaulthandlerexceptionresolver 134-resolving exception from Handler [ Public Org.springframework.web.servlet.ModelAndView Com.chinasoft.web.dataanalysis.business.sys.controller.LoginController.getKaptchaImage ( Javax.servlet.http.httpservletrequest,javax.servlet.http.httpservletresponse) throws Java.lang.Exception]: Javax.imageio.IIOException:Can ' t create output stream!
2017-06-09 11:23:06,777 DEBUG o.s.w.s.handler.simplemappingexceptionresolver 134-resolving exception from Handler [ Public Org.springframework.web.servlet.ModelAndView Com.chinasoft.web.dataanalysis.business.sys.controller.LoginController.getKaptchaImage ( Javax.servlet.http.httpservletrequest,javax.servlet.http.httpservletresponse) throws Java.lang.Exception]: Javax.imageio.IIOException:Can ' t create output stream!
2017-06-09 11:23:06,777 DEBUG o.s.w.s.handler.simplemappingexceptionresolver 249-resolving to view ' exception ' for Exce Ption of type [Javax.imageio.IIOException], based on exception mapping [java.lang.Exception]
2017-06-09 11:23:06,777 DEBUG o.s.w.s.handler.simplemappingexceptionresolver 341-exposing Exception as model attribute ' Exception '
2017-06-09 11:23:06,785 DEBUG org.springframework.web.servlet.DispatcherServlet 1182-handler execution resulted in Exception-forwarding to resolved error view:ModelAndView:reference to view with Name ' exception '; Model is {exception=javax.imageio.iioexception:can ' t create output stream!}
Javax.imageio.IIOException:Can ' t create output stream!
At Javax.imageio.ImageIO.write (imageio.java:1574) ~[na:1.8.0_102]
At Com.chinasoft.web.dataanalysis.business.sys.controller.LoginController.getKaptchaImage (Logincontroller.java : 204) ~[logincontroller.class:na]
At com.chinasoft.web.dataanalysis.business.sys.controller.logincontroller$ $FastClassBySpringCGLIB $$ 21c731f2.invoke (<generated>) ~[spring-core-4.1.4.release.jar:na]
At Org.springframework.cglib.proxy.MethodProxy.invoke (methodproxy.java:204) ~[spring-core-4.1.4.release.jar : 4.1.4.RELEASE]
At Org.springframework.aop.framework.cglibaopproxy$dynamicadvisedinterceptor.intercept (CglibAopProxy.java:649) ~ [Spring-aop-4.1.4.release.jar:4.1.4.release]
At com.chinasoft.web.dataanalysis.business.sys.controller.logincontroller$ $EnhancerBySpringCGLIB $$ F3f26f78.getkaptchaimage (<generated>) ~[spring-core-4.1.4.release.jar:na]
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) ~[na:1.8.0_102]
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:62) ~[na:1.8.0_102]
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43) ~[na:1.8.0_102]
At Java.lang.reflect.Method.invoke (method.java:498) ~[na:1.8.0_102]
At Org.springframework.web.method.support.InvocableHandlerMethod.doInvoke (invocablehandlermethod.java:221) ~[ Spring-web-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest (Invocablehandlermethod.java : 137) ~[spring-web-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle ( servletinvocablehandlermethod.java:110) ~[spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod ( requestmappinghandleradapter.java:777) ~[spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal ( requestmappinghandleradapter.java:706) ~[spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle ( abstracthandlermethodadapter.java:85) ~[spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.servlet.DispatcherServlet.doDispatch (dispatcherservlet.java:943) [ Spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.servlet.DispatcherServlet.doService (dispatcherservlet.java:877) [ Spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.servlet.FrameworkServlet.processRequest (frameworkservlet.java:966) [ Spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Org.springframework.web.servlet.FrameworkServlet.doGet (frameworkservlet.java:857) [ Spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Javax.servlet.http.HttpServlet.service (httpservlet.java:620) [Servlet-api.jar:na]
At Org.springframework.web.servlet.FrameworkServlet.service (frameworkservlet.java:842) [ Spring-webmvc-4.1.4.release.jar:4.1.4.release]
At Javax.servlet.http.HttpServlet.service (httpservlet.java:727) [Servlet-api.jar:na]
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:303) [ CATALINA.JAR:7.0.54]
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:208) [Catalina.jar : 7.0.54]
At Org.apache.tomcat.websocket.server.WsFilter.doFilter (wsfilter.java:52) [tomcat7-websocket.jar:7.0.54]

After searching for a bit, the root directory is missing the temp directory caused by the previous cleanup cache accidentally deleted this directory

Create this directory and restart Tomcat

Troubleshoot tomcat error Javax.imageio.IIOException:Can ' t create output stream!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.