我使用tomcat连接Eclipse和MySQL。但是在Eclipse上运行项目时遇到了一些错误。
正常运行http://localhost:8080/webserver/
。但http://localhost:8080/webserver/ListServlet
上的情况并不正常。我已经尝试过设置utf-8的方法,但它没有用。
Apr 29, 2016 10:42:22 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [ListServlet] in context with path [/webserver] threw exception
java.io.UnsupportedEncodingException: The character encoding [] is not supported
at org.apache.tomcat.util.buf.B2CConverter.getCharsetLower(B2CConverter.java:91)
at org.apache.tomcat.util.buf.B2CConverter.getCharset(B2CConverter.java:78)
at org.apache.tomcat.util.buf.C2BConverter.<init>(C2BConverter.java:41)
at org.apache.catalina.connector.OutputBuffer.setConverter(OutputBuffer.java:610)
at org.apache.catalina.connector.OutputBuffer.checkConverter(OutputBuffer.java:572)
at org.apache.catalina.connector.Response.getWriter(Response.java:660)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:214)
at com.web.server.ListServlet.doGet(ListServlet.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Apr 29, 2016 10:42:22 AM org.apache.coyote.http11.AbstractHttp11Processor process
SEVERE: Error processing request
java.lang.NullPointerException
at org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBuffer.java:474)
at org.apache.tomcat.util.buf.CharChunk.flushBuffer(CharChunk.java:464)
at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:291)
at org.apache.catalina.connector.Response.finishResponse(Response.java:513)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:435)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run (JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)