一般情况下没有这种异常,在生产环境会出现,比较多。
tomcat 6.0.30中的日志:
localhost日志
SEVERE: Servlet.service() for servlet dispatcher threw exception
java.lang.ArrayIndexOutOfBoundsException
at org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:703)
at org.apache.coyote.http11.InternalOutputBuffer.sendStatus(InternalOutputBuffer.java:438)
at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1626)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:956)
at org.apache.coyote.Response.action(Response.java:181)
at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:586)
at org.apache.coyote.Response.doWrite(Response.java:560)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:353)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:387)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
at org.codehaus.jackson.impl.Utf8Generator._flushBuffer(Utf8Generator.java:1754)
at org.codehaus.jackson.impl.Utf8Generator.flush(Utf8Generator.java:1088)
at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1615)
at org.springframework.web.servlet.view.json.MappingJacksonJsonView.writeContent(MappingJacksonJsonView.java:302)
at org.springframework.web.servlet.view.json.MappingJacksonJsonView.renderMergedOutputModel(MappingJacksonJsonView.java:257)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:263)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at de.javakaffee.web.msm.RequestTrackingContextValve.invoke(RequestTrackingContextValve.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:554)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Dec 11, 2014 12:00:05 AM org.apache.catalina.core.StandardWrapperValve invoke
catalina日志:
Dec 10, 2014 12:00:01 AM org.apache.catalina.connector.CoyoteAdapter service
SEVERE: An exception or error occurred in the container during the request processing
java.lang.ArrayIndexOutOfBoundsException
at org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:703)
at org.apache.coyote.http11.InternalOutputBuffer.sendStatus(InternalOutputBuffer.java:438)
at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1626)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:956)
at org.apache.coyote.Response.action(Response.java:183)
at org.apache.coyote.Response.sendHeaders(Response.java:379)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305)
at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:273)
at org.apache.catalina.connector.Response.finishResponse(Response.java:493)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:322)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Dec 10, 2014 12:00:01 AM org.apache.coyote.http11.Http11Processor process
SEVERE: Error finishing response
java.lang.ArrayIndexOutOfBoundsException
at org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:703)
at org.apache.coyote.http11.InternalOutputBuffer.sendStatus(InternalOutputBuffer.java:438)
at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1626)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:956)
at org.apache.coyote.Response.action(Response.java:181)
at org.apache.coyote.http11.InternalOutputBuffer.endRequest(InternalOutputBuffer.java:398)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:901)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
相关推荐
在Spring MVC框架中,`@RequestBody` 和 `@ResponseBody` 是两个非常重要的注解,它们在处理HTTP请求和响应时起到了关键作用。本篇文章将详细解释这两个注解的工作原理、使用场景以及如何实现Java对象与XML/JSON数据...
- 如果返回的是静态内容,考虑使用`@GetMapping`或`@PostMapping`等简化版的注解,它们默认已经包含了`@ResponseBody`的效果。 - 对于大型项目,自定义`MessageConverter`以优化序列化性能或添加自定义头部信息。 ...
在Spring MVC框架中,`@RequestBody` 和 `@ResponseBody` 是两个非常重要的注解,它们在处理HTTP请求和响应时起到了关键作用。这篇博客将深入探讨这两个注解的工作原理以及如何利用它们实现在Java对象与XML或JSON...
在开发Web应用时,我们经常会遇到一个问题:当使用Spring MVC的`@ResponseBody`注解将后端处理结果直接转化为HTTP响应体时,如果这个结果中包含HTML特殊字符,如尖角号、引号、按位与符号等,浏览器可能会误解析,...
-- @ResponseBody() spring-mvc 3 xml 配置--> <!--处理 @ResponseBody 中文乱码问题 --> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> ...
在Spring MVC 4.x版本中,开发者可以使用@ResponseBody注解来简化控制器层向客户端返回JSON格式数据的过程。 ### @ResponseBody注解使用方法 @ResponseBody注解可以作用于方法上,它会指示Spring MVC框架将该方法...
本文将详细介绍如何解决SpringMVC中`@ResponseBody`注解返回中文乱码的问题。 首先,我们可以尝试使用`@RequestMapping`注解的`produces`属性来指定响应内容的MIME类型和字符集。例如: ```java @RequestMapping...
描述中提到的"springmvc进行Jason数据封装转化时可以即使用也是@responsebody",指的是在Spring MVC的控制器(Controller)中,我们可以使用`@ResponseBody`注解配合Jackson库,实现将Java对象直接转换为JSON格式的...
标题中的“Spring MVC – Easy REST-Based JSON Services with @ResponseBody”是指使用Spring MVC框架构建基于REST的JSON服务,并通过使用`@ResponseBody`注解来简化这一过程。REST(Representational State ...
springmvc+国际化i18N+springmvc验证+jetbrick-template使用+@responsebody+谷歌guava: 1)围绕springmvc做的国际化 2)围绕springmvc做的验证 3)使用的jetbrick-template模板引擎 ……
Spring MVC注解之@ResponseBody和@RequestBody详解 在Spring MVC框架中,@ResponseBody和@RequestBody是两个非常重要的注解,它们分别用于处理HTTP请求响应体和请求体的序列化和反序列化。下面,我们将详细介绍这两...
在Spring MVC中,`@ResponseBody`和`@RequestBody`是两个关键的注解,它们用于处理HTTP请求和响应中的数据转换。这两个注解是Spring框架对RESTful API开发的重要支持,使得开发者能够方便地处理JSON格式的数据。 ...
在这个"springMVC学习——注解方式"的主题中,我们将深入探讨如何使用注解来简化SpringMVC的配置和开发流程。 首先,让我们了解一下什么是注解。在Java中,注解是一种元数据,允许程序员在源代码中嵌入信息,这些...
在SpringMVC中,我们可以使用@RestController注解来标注控制器,使用@RequestMapping注解来标注请求映射,使用@RequestBody注解来标注请求体,使用@ResponseBody注解来标注响应体。 例如,我们可以编写一个简单的...
4. **模型和视图**:`@ModelAttribute`注解用于将方法参数与HTTP请求中的数据绑定,而`@ResponseBody`注解则指示Spring将方法返回值直接写入HTTP响应体,通常用于返回JSON或XML数据。 5. **异常处理**:使用`@...
资源摘要信息@SpringMVC的@Validated注解使用 @SpringMVC框架中,@Validated注解是一个非常重要的验证工具,通过这个注解,我们可以实现对Bean对象的验证,从而确保数据的正确性。本文将详细介绍@SpringMVC的@...
在 SpringMVC 中,使用 @RequestBody 注解可以将请求体中的数据转换为 Java 对象,但是在使用 map 接收请求参数时,经常会遇到一些问题。本文将讨论如何快速解决 SpringMVC @RequestBody 用map接收请求参数的问题。 ...
"SpringMVC纯注解配置"是SpringMVC框架的一种高级用法,旨在减少XML配置文件的使用,提高开发效率和代码可读性。在这个主题中,我们将深入探讨如何利用注解实现SpringMVC的配置以及jQuery如何处理后台返回的JSON对象...
单单使用@Controller 标记在一个类上还不能真正意义上的说它就是 SpringMVC 的一个控制器类,因为这个时候 Spring 还不认识它。要使 Spring 认识该控制器类,需要将其交给 Spring 来管理,方法有两种:一种是定义 ...