Hi all,
I am doing an RMI call from my
Servlet and in the backend i prepare all the data into am ByteArrayOutputStream and add it into a vector and send it back.
It gives my an "
java. io.NotSerializableException: java.io.ByteArrayOutput Stream"
I found out that the ByteArrayOutputStream must be serialized before putting into my vector.
I tried browsing on the internet but could'nt get it right.
Please let me know on how to do it.
**********My code in the servlet*******
serverData = remoteServiceObject. doRemoteRequestProcess(clientRequest); System.err.println("serverData>>>>"+serverData.size());
ByteArrayOutputStream pdfReportStream = (ByteArrayOutputStream)serverData.get(0);
***********************************
************MY backend Code****************
public Vector processClientRqst(Vector eClientRequest)
throws Exception {
int methodID = Integer.parseInt (eClientRequest.elementAt(1).toString().trim());
Vector responseData = new Vector();
switch (methodID) {
case SRSConstant.GET_REPORT:
System.err.println("INSIDE DBIS>>>>>>>>>>>");
responseData = getTBQReport(eClientRequest);
break;
}
return (responseData);
}
public Vector getTBQReport(Vector clientData) throws Exception {
String sql;
plantID = clientData.elementAt(2).toString();
issueID = clientData.elementAt(3).toString();
modelYear = clientData.elementAt(4).toString();
Vector serverData = new Vector();
TAVReportGenerator reportGenerator = new TAVReportGenerator(dbConn,srCommMethods);
ByteArrayOutputStream pdfReportStream = reportGenerator.generatePDF(issueID, modelYear, plantID);
serverData.add(pdfReportStream);
return serverData;
}
**************************************
Thanks,
With Regards,
Vivek Raju