작성
·
548
0
이전 질문에서 답변준 내용에 맞춰서 진해하였는데도 동일한 문제가 발생하네요
일단 sdk 버전을 28로 변경후에 진행하였으나 동일한 오류가 발생하고, 29인 경우 requestLegacyExternalStorage
속성을 true로 변경했는데도 해결이 안되네요
본문 예제와 같이 sdk버전을 27로 변경하려고 했으나 에러발생으로 싱크가 안되서 28로 진행하였으나 해결이나 변화는 전혀 없네요
client Thread는 다음과 같이 작성되었습니다.
var client = OkHttpClient()
var request_builder = Request.Builder()
var url = request_builder.url("http://172.30.1.18:8080/MobileServer/upload.jsp")
var multipart_Builder = MultipartBody.Builder()
var file = File(pic_path)
multipart_Builder.addFormDataPart("mobile_img",file.name,RequestBody.create(MultipartBody.FORM, file))
var body = multipart_Builder.build()
var post = url.post(body)
var request = post.build()
client.newCall(request).execute()
client쪽은 에러 메세지가 다음과 같이 뜹니다.
E/eglCodecCommon: GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1
server 코드는 다음과 같이 작성되었습니다.
<%@ page import="com.oreilly.servlet.*" %>
<%@ page import="com.oreilly.servlet.multipart.*" %>
<%@ page import="com.oreilly.servlet.MultipartRequest"%>
<%
request.setCharacterEncoding("utf-8");
String path = getServletContext().getRealPath("upload");
System.out.println(path);
int max = 1024 * 1024 * 100;
DefaultFileRenamePolicy policy = new DefaultFileRenamePolicy();
System.out.println(request.getContentType());
new MultipartRequest(request, path,max,"utf-8",policy);
%>
서버쪽 에러는 다음과 같이 뜨고 있습니다.
Stacktrace:
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:505)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Posted content type isn't multipart/form-data
at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:130)
at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:94)
at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:219)
at org.apache.jsp.upload_jsp._jspService(upload_jsp.java:138)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
... 25 more