我的要求是录制用户语音并将其保存在服务器上(同时多个用户)。代码是:
in = (InputStream) request.getInputStream();
fos = new FileOutputStream(f1);
int read = 0;
while ((read = in.read()) != -1) {
fos.write(read);
}
fos.close();
in.close();
并且尝试一次为多个用户录制语音时出现以下异常。对于单个用户,这并没有给我任何例外。
java.net.SocketTimeoutException 在 org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796) 在 org.apache.coyote.http11.InternalAprInputBuffer$SocketInputBuffer.doRead(InternalAprInputBuffer.java:830) 在 org.apache。 coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116) at org.apache.coyote.http11.InternalAprInputBuffer.doRead(InternalAprInputBuffer.java:738) at org.apache.coyote.Request.doRead(Request.java:第 427 章.InputBuffer.readByte(InputBuffer.java:317) 在 CommonPackage.Upload 的 org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:105)。processRequest(Upload.java:78) at CommonPackage.Upload.doPost(Upload.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet .java:803) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 在 org.apache.catalina。 core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)在 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 在 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 在 org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877) 在 org.apache.coyote.http11.Http11AprProtocol 的 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) $Http11ConnectionHandler.process(Http11AprProtocol.java:594) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675) at java.lang.Thread.run(Thread.java:619)
谢谢