解决tomcat报错javax.imageio.IIOException: Can't create output stream!
启动tomcat catalina.out报错如下,登陆的时候无法显示验证码
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 /kaptchaImage.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 exception 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]
后面搜索了一下,原来是根目录缺少temp这个目录导致的,之前清理缓存的时候不小心删除了这个目录
新建这个目录,重启tomcat即可
解决tomcat报错javax.imageio.IIOException: Can't create output stream!的更多相关文章
- 解决javax.imageio.IIOException: Can't create output stream!
解决javax.imageio.IIOException: Can't create output stream! javax.imageio.ImageIO.write(image, "J ...
- javax.imageio.IIOException: Can't create output stream! (生成验证码Servlet)
在 web.xml里面加入 下面的代码: <servlet> <servlet-name>validatecode</servlet-name> ...
- javax.imageio.IIOException: Can't create cache file!
javax.imageio.IIOException: Can't create cache file! at javax.imageio.ImageIO.createImageInputStream ...
- 网页验证码出不来,读取验证码时出错:javax.imageio.IIOException: Can't create cache file!
版权声明:本文为博主原创文章,仅作为学习交流使用 转载请注明出处 https://www.cnblogs.com/linck/p/10593053.html 今天打开项目时,发现登陆界面的验证码出不来 ...
- Spring boot Unable to start embedded Tomcat报错 java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()
Spring boot Unable to start embedded Tomcat 报错 java.lang.NoSuchMethodError: javax.servlet.ServletCon ...
- js页面报错javax.servlet.jsp.PageContext cannot be resolved to a type解决
构建了一个maven项目但是项目创建好的jsp总会报错javax.servlet.jsp.PageContext cannot be resolved to a type,但是不影响项目运行.但总归难 ...
- 迅速解决!!!!!启动Tomcat报错PermGen space
启动Tomcat报错 PermGen space 内存溢出 解决方法:扩大tomcat内存 修改参数:set JAVA_OPTS=-Xms1024m -Xmx1024m -XX:PermSi ...
- tomcat报错解决方法
tomcat报错如 关闭被占用的进程 解决方法:cmd进入控制台,输入命令netstat -ano|findstr 8005 (什么端口号被占用就输入什么号),回车 发现是进程2044占用了这 ...
- IDEA启动Tomcat报错
Maven编译成功, 可是启动Tomcat报错: Application Server was not connected before run configuration stop, reason: ...
随机推荐
- HTML第五耍 表格标签
HTML标记语言中可以使用table标签创建表格. 表格由 <table> 标签来定义.每个表格均有若干行(由 <tr> 标签定义),字母 tr 指表格数据(table row ...
- java中数组、集合、字符串之间的转换,以及用加强for循环遍历
java中数组.集合.字符串之间的转换,以及用加强for循环遍历: @Test public void testDemo5() { ArrayList<String> list = new ...
- .Net版微信支付
一. 案例介绍 这里模拟一个实际业务场景,进行介绍微信支付,业务功能包括:登录.注册.充值.查看充值记录. 页面图: 二. 概要设计 1.数据库设计 这里数据库包括两张表:用户表和订单表. ...
- 061、flannel的连通与隔离(2019-04-01 周一)
参考https://www.cnblogs.com/CloudMan6/p/7447716.html flannel网络连通性测试 不同host上的容器可以通过flannel网络进行通信,需要借助 ...
- python实现双向链表
双向链表 一种更复杂的链表是“双向链表”或“双面链表”.每个节点有两个链接:一个指向前一个节点,当此节点为第一个节点时,指向空值:而另一个指向下一个节点,当此节点为最后一个节点时,指向空值. 实现 c ...
- Java入门系列
包装类 基本数据类型之间的相互转换不是都可以制动转换的,而你强制转换又会出问题,比如String类型的转换为int类型的,那么jdk为了方便用户就提供了相应的包装类. 基本类型对应的包装类 创建一个包 ...
- Android设置shape后改变颜色
如下,可能多个btn的设置同一个shape,如果单独改变btn颜色,可以用如下代码 GradientDrawable btnPreDrawable = (GradientDrawable) btnTe ...
- 局域网内ping [局域网内ip地址]命令详解
一.工作过程 主机A向主机B发送一个ICMP请求报文[类型字段为8,代码字段为0],若收到ICMP回复报 文[类型字段为0,代码字段为0]则说明主机B处于活动状态:若超时未收到回复,则可能是 因为(1 ...
- 【bzoj 3786】星系探索
Description 物理学家小C的研究正遇到某个瓶颈. 他正在研究的是一个星系,这个星系中有n个星球,其中有一个主星球(方便起见我们默认其为1号星球),其余的所有星球均有且仅有一个依赖星球.主星球 ...
- 如何将vue/html在Hbuilder里进行apk打包封装生成直接可用程序
在此简单讲述一下个人的理解: 方法: 对于Hbuilder里的项目文件: 1.直接右键:转换成移动app,然后生成一个json文件manifest.json,在该json文件下配置好应用程序的图标.和 ...