gpt4 book ai didi

java - 每个请求的页面都会出现 MalformedInputException

转载 作者:太空宇宙 更新时间:2023-11-04 07:24:17 37 4
gpt4 key购买 nike

我的网络应用程序中每个请求的页面都会出现此异常。由于它不指向任何应用程序代码,因此很难调试和检查导致问题的原因。

这是我应该担心的事情吗?有什么办法可以忽略这个异常吗?值得一提的是,页面渲染得很好。

Java 1.7.0_25、Apache Tomcat 7.0.27、Mojarra 2.1.13 和 PrettyFaces 3.3.3 作为 URL 重写器解决方案。

Sep 15, 2013 2:21:48 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [] threw exception
java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:260)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:781)
at com.sun.faces.application.ByteArrayWebOutputStream.writeTo(ByteArrayWebOutputStream.java:112)
at com.sun.faces.application.ViewHandlerResponseWrapper.flushToWriter(ViewHandlerResponseWrapper.java:162)
at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:263)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:163)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at br.com.tostring.weblibrary.filters.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:23)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1812)
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)

我意识到只有当我在类路径中添加 jSTL-1.1.0.jar 以避免 java.lang.NoClassDefFoundError: javax/servlet/jsp/jSTL/core/Config 时才会发生此异常。如果我删除这个 jar,MalformedInputException 将停止,但会抛出 NoClassDefFoundError

最佳答案

当输入字节序列对于给定字符集不合法,或者输入字符序列不是合法的 16 位 Unicode 序列时,抛出 MalformedInputException。

这是在 View 渲染期间发生的,因此我猜测您的 Facelet/XHTML 模板或其他地方有某些内容正在尝试将不同编码的内容写入输出流。

您是否使用任何类型的输出流修改扩展或配置?

关于java - 每个请求的页面都会出现 MalformedInputException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18815975/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com