게시판을 이용해 주셔서 감사합니다.
다음양식에 맞게 입력해주세요.
* 고객시스템명 : hp
* GAUCE 버전 : 4.0
* WAS 종류(WebLogic 등등) : oc4j
* DB 종류 : oracle
* 문의 유형(질문/요청/참조) : file upload
* 내용 :
예제를 이용해서 구현했구요....
클라이언트 에서는 잘되는데...
운영 서버에 올리면 파일 업로드가 되지 않는데..
로그를 찾아 보니
gis = ((HttpGauceRequest) request).getGauceInputStream();
gos = ((HttpGauceResponse) response).getGauceOutputStream();
요부분에서 java.io.IOException: 에러가 나는데요.. 어떻해야 하나요...????
java.io.IOException:
at com.gauce.io.bin.A.A(java.io.InputStream) (pc 877)
at com.gauce.io.bin.A.A() (pc 807)
at com.gauce.filter.HttpGauceRequestWrapper.getGauceInputStream (pc 42)
at _notice._upload._jspService (_upload.java:79) (pc 66)
at com.orionserver.http.OrionHttpJspPage.service (OrionHttpJspPage.java:
56) (pc 9)
at oracle.jsp.runtimev2.JspPageTable.service (JspPageTable.java:317) (pc
293)
at oracle.jsp.runtimev2.JspServlet.internalService (JspServlet.java:465)
(pc 202)
at oracle.jsp.runtimev2.JspServlet.service (JspServlet.java:379) (pc 3)
at javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,j
avax.servlet.ServletResponse) (HttpServlet.java:853) (pc 30)
at com.evermind.server.http.ResourceFilterChain.doFilter (ResourceFilter
Chain.java:65) (pc 265)
at com.gauce.filter.GauceFilter.doFilter (pc 607)
at com.evermind.server.http.ServletRequestDispatcher.invoke (ServletRequ
estDispatcher.java:560) (pc 1048)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal (Se
rvletRequestDispatcher.java:306) (pc 249)
at com.evermind.server.http.HttpRequestHandler.processRequest (HttpReque
stHandler.java:767) (pc 1974)
at com.evermind.server.http.AJPRequestHandler.run(java.lang.Thread) (AJP
RequestHandler.java:148) (pc 264)
at com.evermind.server.http.AJPRequestHandler.run() (AJPRequestHandler.j
ava:72) (pc 4)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run (PooledExe
cutor.java:797) (pc 15)
at java.lang.Thread.run (Thread.java:479) (pc 11)
<%@ page import="java.io.*,java.sql.*,javax.sql.*,com.gauce.*,com.gauce.io.*,com.gauce.http.*" contentType="text/html;charset=EUC-KR" %><%!
public static final void copy(InputStream in, OutputStream out) {
copy(in, out, 1024);
}
public static final void copy(InputStream in, OutputStream out, int bufferSize) {
try {
synchronized (in) {
synchronized (out) {
byte[] buffer = new byte[bufferSize];
while (true) {
int bytesRead = in.read(buffer);
if (bytesRead == -1) break;
out.write(buffer, 0, bytesRead);
}
}
}
} catch (IOException ioe) {
throw new RuntimeException ("Can not copy streamnt"+ioe.toString());
}
}
%><%
GauceInputStream gis = null;
GauceOutputStream gos = null;
try {
gis = ((HttpGauceRequest) request).getGauceInputStream();
gos = ((HttpGauceResponse) response).getGauceOutputStream();
GauceDataSet dataset = gis.read("SENDFILE");
if (dataset != null) {
GauceDataRow[] rows = dataset.getDataRows();
int data_name = dataset.indexOfColumn("info");
int data_url = dataset.indexOfColumn("File_Url");
for (int i=0; i<rows.length; i++) {
if (rows[i].getJobType() == GauceDataRow.TB_JOB_INSERT) {
String d_name = rows[i].getString(data_name);
String o_name = d_name.substring(d_name.lastIndexOf(File.separator)+1, d_name.length()).trim();
InputStream is = (InputStream)rows[i].getInputStream(data_url);
FileOutputStream os = new FileOutputStream("a" + o_name);
copy(is, os, 50000 );
is.close();
os.close();
System.out.println("==================================== aaa" + o_name + " : d_name : " + d_name );
}
if (rows[i].getJobType() == GauceDataRow.TB_JOB_UPDATE) {
}
if (rows[i].getJobType() == GauceDataRow.TB_JOB_DELETE) {
}
}
} else {
//gos.writeException("Native", "9999", "GauceDataSet is Null!!!");
}
gos.close();
} catch(Exception e) {
e.printStackTrace();
}
%>