Uploading large files from applet to servlet throws out of memory error

I have a java applet that needs to upload files from a client machine
to a web server using a servlet. the problem i am having is that in
the current scheme, files larger than 17-20MB throw an out of memory
error. is there any way we can get around this problem? i will post
the client and server side code for reference.
Client Side Code:
import java.io.*;
import java.net.*;
// this class is a client that enables transfer of files from client
// to server. This client connects to a servlet running on the server
// and transmits the file.
public class fileTransferClient
private static final String FILENAME_HEADER = "fileName";
private static final String FILELASTMOD_HEADER = "fileLastMod";
// this method transfers the prescribed file to the server.
// if the destination directory is "", it transfers the file to
"d:\\".
//11-21-02 Changes : This method now has a new parameter that
references the item
//that is being transferred in the import list.
public static String transferFile(String srcFileName, String
destFileName,
String destDir, int itemID)
if (destDir.equals(""))
destDir = "E:\\FTP\\incoming\\";
// get the fully qualified filename and the mere filename.
String fqfn = srcFileName;
String fname =
fqfn.substring(fqfn.lastIndexOf(File.separator)+1);
try
//importTable importer = jbInit.getImportTable();
// create the file to be uploaded and a connection to
servlet.
File fileToUpload = new File(fqfn);
long fileSize = fileToUpload.length();
// get last mod of this file.
// The last mod is sent to the servlet as a header.
long lastMod = fileToUpload.lastModified();
String strLastMod = String.valueOf(lastMod);
URL serverURL = new URL(webadminApplet.strServletURL);
URLConnection serverCon = serverURL.openConnection();
// a bunch of connection setup related things.
serverCon.setDoInput(true);
serverCon.setDoOutput(true);
// Don't use a cached version of URL connection.
serverCon.setUseCaches (false);
serverCon.setDefaultUseCaches (false);
// set headers and their values.
serverCon.setRequestProperty("Content-Type",
"application/octet-stream");
serverCon.setRequestProperty("Content-Length",
Long.toString(fileToUpload.length()));
serverCon.setRequestProperty(FILENAME_HEADER, destDir +
destFileName);
serverCon.setRequestProperty(FILELASTMOD_HEADER, strLastMod);
if (webadminApplet.DEBUG) System.out.println("Connection with
FTP server established");
// create file stream and write stream to write file data.
FileInputStream fis = new FileInputStream(fileToUpload);
OutputStream os = serverCon.getOutputStream();
try
// transfer the file in 4K chunks.
byte[] buffer = new byte[4096];
long byteCnt = 0;
//long percent = 0;
int newPercent = 0;
int oldPercent = 0;
while (true)
int bytes = fis.read(buffer);
byteCnt += bytes;
//11-21-02 :
//If itemID is greater than -1 this is an import file
transfer
//otherwise this is a header graphic file transfer.
if (itemID > -1)
newPercent = (int) ((double) byteCnt/ (double)
fileSize * 100.0);
int diff = newPercent - oldPercent;
if (newPercent == 0 || diff >= 20)
oldPercent = newPercent;
jbInit.getImportTable().displayFileTransferStatus
(itemID,
newPercent);
if (bytes < 0) break;
os.write(buffer, 0, bytes);
os.flush();
if (webadminApplet.DEBUG) System.out.println("No of bytes
sent: " + byteCnt);
finally
// close related streams.
os.close();
fis.close();
if (webadminApplet.DEBUG) System.out.println("File
Transmission complete");
// find out what the servlet has got to say in response.
BufferedReader reader = new BufferedReader(
new
InputStreamReader(serverCon.getInputStream()));
try
String line;
while ((line = reader.readLine()) != null)
if (webadminApplet.DEBUG) System.out.println(line);
finally
// close the reader stream from servlet.
reader.close();
} // end of the big try block.
catch (Exception e)
System.out.println("Exception during file transfer:\n" + e);
e.printStackTrace();
return("FTP failed. See Java Console for Errors.");
} // end of catch block.
return("File: " + fname + " successfully transferred.");
} // end of method transferFile().
} // end of class fileTransferClient
Server side code:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.net.*;
// This servlet class acts as an FTP server to enable transfer of
files
// from client side.
public class FtpServerServlet extends HttpServlet
String ftpDir = "D:\\pub\\FTP\\";
private static final String FILENAME_HEADER = "fileName";
private static final String FILELASTMOD_HEADER = "fileLastMod";
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException,
IOException
doPost(req, resp);
public void doPost(HttpServletRequest req, HttpServletResponse
resp)
throws ServletException,
IOException
// ### for now enable overwrite by default.
boolean overwrite = true;
// get the fileName for this transmission.
String fileName = req.getHeader(FILENAME_HEADER);
// also get the last mod of this file.
String strLastMod = req.getHeader(FILELASTMOD_HEADER);
String message = "Filename: " + fileName + " saved
successfully.";
int status = HttpServletResponse.SC_OK;
System.out.println("fileName from client: " + fileName);
// if filename is not specified, complain.
if (fileName == null)
message = "Filename not specified";
status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
else
// open the file stream for the file about to be transferred.
File uploadedFile = new File(fileName);
// check if file already exists - and overwrite if necessary.
if (uploadedFile.exists())
if (overwrite)
// delete the file.
uploadedFile.delete();
// ensure the directory is writable - and a new file may be
created.
if (!uploadedFile.createNewFile())
message = "Unable to create file on server. FTP failed.";
status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
else
// get the necessary streams for file creation.
FileOutputStream fos = new FileOutputStream(uploadedFile);
InputStream is = req.getInputStream();
try
// create a buffer. 4K!
byte[] buffer = new byte[4096];
// read from input stream and write to file stream.
int byteCnt = 0;
while (true)
int bytes = is.read(buffer);
if (bytes < 0) break;
byteCnt += bytes;
// System.out.println(buffer);
fos.write(buffer, 0, bytes);
// flush the stream.
fos.flush();
} // end of try block.
finally
is.close();
fos.close();
// set last mod date for this file.
uploadedFile.setLastModified((new
Long(strLastMod)).longValue());
} // end of finally block.
} // end - the new file may be created on server.
} // end - we have a valid filename.
// set response headers.
resp.setContentType("text/plain");
resp.setStatus(status);
if (status != HttpServletResponse.SC_OK)
getServletContext().log("ERROR: " + message);
// get output stream.
PrintWriter out = resp.getWriter();
out.println(message);
} // end of doPost().
} // end of class FtpServerServlet

OK - the problem you describe is definitely what's giving you grief.
The workaround is to use a socket connection and send your own request headers, with the content length filled in. You may have to multi-part mime encode the stream on its way out as well (I'm not about that...).
You can use the following:
http://porsche.cis.udel.edu:8080/cis479/lectures/slides-04/slide-02.html
on your server to get a feel for the format that the request headers need to take.
- Kevin
I get the out of Memory Error on the client side. I
was told that this might be a bug in the URLConnection
class implementation that basically it wont know the
content length until all the data has been written to
the output stream, so it uses an in memory buffer to
store the data which basically causes memory issues..
do you think there might be a workaround of any kind..
or maybe a way that the buffer might be flushed after
a certain size of file has been uploaded.. ?? do you
have any ideas?

Similar Messages

  • Firefox 7.0 - Can not upload the file from local machine to server...gives "error 404 : file not found"

    firefox 7.0 - Can not upload the file from local machine to server...gives "error 404 : file not found"

    you have not understood my point
    how does this code will run on servlet when I want to upload a file from client's
    machine to server machine
    what I am doing is I am giving an option to the user that he/she can browse the file and then select any file and finally it's action is post in the jsp form for which I have sent the code
    All the computers are connected in LAN
    So how to upload a file from client's machine to server's machine
    Plz give me a solution

  • XSOMParser throwing out of memory error

    Hello,
    Currently we are using XSOM parser with DomAnnotationParserFactory to parse XSD file. For small files it is working fine. However is was throwing out of memory error while parsing 9MB file. We could understood reason behind this. Is there any way to resolve this issue?
    Code :
         XSOMParser parser = new XSOMParser();
    parser.setAnnotationParser(new DomAnnotationParserFactory());
    XSSchemaSet schemaSet = null;
    XSSchema xsSchema = null;
    parser.parse(configFilePath);
    Here we are getting error on parser.parse() method. (using 128 MB heap memory using -Xrs -Xmx128m).
    Stack Trace :
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
         at oracle.xml.parser.v2.XMLDocument.xdkIncCurrentId(XMLDocument.java:3020)
         at oracle.xml.parser.v2.XMLNode.xdkInit(XMLNode.java:2758)
         at oracle.xml.parser.v2.XMLNode.<init>(XMLNode.java:423)
         at oracle.xml.parser.v2.XMLNSNode.<init>(XMLNSNode.java:144)
         at oracle.xml.parser.v2.XMLElement.<init>(XMLElement.java:373)
         at oracle.xml.parser.v2.XMLDocument.createNodeFromType(XMLDocument.java:2865)
         at oracle.xml.parser.v2.XMLDocument.createElement(XMLDocument.java:1896)
         at oracle.xml.parser.v2.DocumentBuilder.startElement(DocumentBuilder.java:224)
         at oracle.xml.parser.v2.XMLElement.reportStartElement(XMLElement.java:3188)
         at oracle.xml.parser.v2.XMLElement.reportSAXEvents(XMLElement.java:2164)
         at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:337)
         at oracle.xml.jaxp.JXTransformerHandler.endDocument(JXTransformerHandler.java:141)
         at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:267)
         at org.xml.sax.helpers.XMLFilterImpl.endElement(Unknown Source)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1257)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:314)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:196)
         at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
         at com.sun.xml.xsom.parser.JAXPParser.parse(JAXPParser.java:79)
         at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:298)
         at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:87)
         at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:147)
         at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:136)
         at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:129)
         at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:122)
    Please let me know if anyone has comment on this.
    Also let me know if there any other parser which handles large input files efficiently.

    Hello,
    Currently we are using XSOM parser with DomAnnotationParserFactory to parse XSD file. For small files it is working fine. However is was throwing out of memory error while parsing 9MB file. We could understood reason behind this. Is there any way to resolve this issue?
    Code :
         XSOMParser parser = new XSOMParser();
    parser.setAnnotationParser(new DomAnnotationParserFactory());
    XSSchemaSet schemaSet = null;
    XSSchema xsSchema = null;
    parser.parse(configFilePath);
    Here we are getting error on parser.parse() method. (using 128 MB heap memory using -Xrs -Xmx128m).
    Stack Trace :
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
         at oracle.xml.parser.v2.XMLDocument.xdkIncCurrentId(XMLDocument.java:3020)
         at oracle.xml.parser.v2.XMLNode.xdkInit(XMLNode.java:2758)
         at oracle.xml.parser.v2.XMLNode.<init>(XMLNode.java:423)
         at oracle.xml.parser.v2.XMLNSNode.<init>(XMLNSNode.java:144)
         at oracle.xml.parser.v2.XMLElement.<init>(XMLElement.java:373)
         at oracle.xml.parser.v2.XMLDocument.createNodeFromType(XMLDocument.java:2865)
         at oracle.xml.parser.v2.XMLDocument.createElement(XMLDocument.java:1896)
         at oracle.xml.parser.v2.DocumentBuilder.startElement(DocumentBuilder.java:224)
         at oracle.xml.parser.v2.XMLElement.reportStartElement(XMLElement.java:3188)
         at oracle.xml.parser.v2.XMLElement.reportSAXEvents(XMLElement.java:2164)
         at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:337)
         at oracle.xml.jaxp.JXTransformerHandler.endDocument(JXTransformerHandler.java:141)
         at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:267)
         at org.xml.sax.helpers.XMLFilterImpl.endElement(Unknown Source)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1257)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:314)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:196)
         at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
         at com.sun.xml.xsom.parser.JAXPParser.parse(JAXPParser.java:79)
         at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:298)
         at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:87)
         at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:147)
         at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:136)
         at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:129)
         at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:122)
    Please let me know if anyone has comment on this.
    Also let me know if there any other parser which handles large input files efficiently.

  • Sending a file from Applet to servlet HELP me Please

    Sorry, i have the problem this is my code Applet & Servlet but it seems working asynchronously if you have some ideas please reply me i send bytes on outputstream but the inputstream of servlet receive nothing bytes but write my system.out.print on screen server:
    Applet:
    URL servletURL = new URL(codebase, "/InviaFile/servlet/Ricevi");
    HttpURLConnection urlConnection = (HttpURLConnection) servletURL.openConnection();
    urlConnection.setRequestMethod("POST");
    urlConnection.setUseCaches(false);
    urlConnection.setDoOutput(true);
    urlConnection.setDoInput(true);
    urlConnection.setAllowUserInteraction(false);
    urlConnection.setRequestProperty("Content-Type", "application/octet-stream");
    urlConnection.setRequestProperty("Content-length", String.valueOf(100));
    urlConnection.connect();
    if(urlConnection.HTTP_BAD_REQUEST == HttpURLConnection.HTTP_BAD_REQUEST){
    /*System.out.println("Cattiva Richiesta: "+urlConnection.getContentEncoding());
    System.out.println("Tipo di metodo: "+urlConnection.getRequestMethod());
    System.out.println("Tipo di Risposta: "+urlConnection.getResponseCode());
    System.out.println("Tipo di messaggio: "+urlConnection.getResponseMessage());
    System.out.println("Tipo di contenuto: "+urlConnection.getContentType());
    System.out.println("Tipo di lunghezza contenuto: "+urlConnection.getContentLength());
    System.out.println("Tipo di doinput: "+urlConnection.getDoInput());
    System.out.println("Tipo di doouput: "+urlConnection.getDoOutput());
    System.out.println("Tipo di URL: "+urlConnection.getURL());
    System.out.println("Tipo di propriet� richiesta: "+urlConnection.getRequestProperty("Content-Type"));
    System.out.println("Entra if");
    DataOutputStream dout = new DataOutputStream(urlConnection.getOutputStream());
    InputStream is = urlConnection.getInputStream();
    if(ritornaFile("C:/Ms.tif", dout))System.out.println("Finita lettura");
    dout.close();
    urlConnection.disconnect();
    System.out.println("Fine Applet");
    }catch(Exception e) { System.err.println(e.getMessage());e.printStackTrace();}
    public boolean ritornaFile(String file, OutputStream ots)throws Exception{
    FileInputStream f = null;
    try{
    f = new FileInputStream(file);
    byte[] buf = new byte[4 * 1024];
    int byteLetti;
    while((byteLetti = f.read()) != -1){ots.writeByte(buf, 0, byteLetti);ots.flush();
    while((byteLetti = f.read()) != -1){ots.write(byteLetti);ots.flush();
    System.out.println("byteLetti= "+byteLetti);
    return true;
    }catch(Exception ex){
    System.err.println(ex.getMessage());
    return false;
    }finally{
    if(f != null)f.close();
    Servlet:
    HttpSession ses = request.getSession(true);
    System.out.println("Passa servlet "+request.getMethod());
    System.out.println("Passa servlet "+ses.getId());
    ServletInputStream servletinputstream = request.getInputStream();
    DataInputStream dis = new DataInputStream(request.getInputStream());
    int c = dis.available();
    System.out.println("c="+c);
    //ServletOutputStream servletoutputstream
    //response.getOutputStream();
    response.setContentType("application/octet-stream");
    System.out.println("URI= "+request.getRequestURI());
    System.out.println("pathTranslated: "+request.getPathTranslated());
    System.out.println("RemoteUser: "+request.getRemoteUser());
    System.out.println("UserInRole: "+String.valueOf(request.isUserInRole("")));
    System.out.println("pathInfo: "+request.getPathInfo());
    System.out.println("Protocollo: "+request.getProtocol());
    System.out.println("RemoteAddr:"+request.getRemoteAddr());
    System.out.println("RemoteHost:"+request.getRemoteHost());
    System.out.println("SessionID:"+request.getRequestedSessionId());
    System.out.println("Schema:"+request.getScheme());
    System.out.println("SeesionValido:"+String.valueOf(request.isRequestedSessionIdValid()));
    System.out.println("FromURL:"+String.valueOf(request.isRequestedSessionIdFromURL()));
    int i = request.getContentLength();
    System.out.println("i: "+i);
    ritornaFile(servletinputstream, "C:"+File.separator+"Pluto.tif");
    System.out.println("GetMimeType= "+getServletContext().getMimeType("Ms.tif"));
    InputStream is = request.getInputStream();
    int in = is.available();
    System.out.println("Legge dallo stream in="+in);
    DataInputStream diss = new DataInputStream(servletinputstream);
    int ins = diss.read();
    System.out.println("Legge dallo stream ins="+ins);
    int disins = diss.available();
    System.out.println("Legge dallo stream disins="+disins);
    is.close();
    System.out.println("Fine Servlet");
    catch(Exception exception) {
    System.out.println("IOException occured in the Server: " + exception.getMessage());exception.printStackTrace();
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    public void ritornaFile(InputStream its, String fileDest )throws Exception{
    FileOutputStream f = null;
    try{
    f = new FileOutputStream(fileDest);
    byte[] buf = new byte[2 * 1024];
    int byteLetti;
    while((byteLetti = its.read()) != -1){
    f.write(buf, 0, byteLetti);
    f.flush();
    System.out.println("Byteletti="+byteLetti);
    }catch(Exception ex){
    System.err.println(ex.getMessage());
    }finally{
    if(f != null)f.close();

    Hi all,
    Can anyone help me.I am trying to send an audio file from a applet to servlet with HTTP method(no raw sockets), also the servlet shld be able to save the file on the server.Any suggestions welcome.USing audiostream class from javax.sound.sampled.
    The part of applet code which calls servlet is :
    URL url = new URL("http://" + host + "/" + context + "/servlet/UserUpdateWorkLogAudio?userid=" + userId.replace(' ', '+') + "&FileName=" + filename.replace(' ', '+'));
    URLConnection myConnection = url.openConnection();
    myConnection.setUseCaches(false);
    myConnection.setDoOutput(true);
    urlConnection.setRequestProperty("Content-Type", "application/octet-stream");
    myConnection.connect();
    out = new BufferedOutputStream(myConnection.getOutputStream());
    AudioSystem.write(audioInputStream, fileType,out); // IS THIS RIGHT APPROACH?
    ************************end of applet code**********************
    ************************servlet code******************************
    try
    {BufferedInputStream in = new BufferedInputStream(request.getInputStream());
    ????????What code shld i write here to get the audio file stream
    BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(filename));
    *********************************************end***********************
    Thanks
    Joe.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • When uploading large file from network, all other requests are not being sent to server

    In our application we are facing a weird scenario in which when we try to upload a huge file(600+ MB) from network, all other requests(AJAX) are getting blocked. But when the same file is being uploaded from local location(E drive) then everything works fine.

    How are you uploading the file via network?
    If you are troubleshooting the network bandwidth? or the threads where one process takes precedent over the other you will have to troubleshoot the QoS of the network you see this on.
    To give a better visual please use Firebug or the Web Developer tool called Network to analyze the requests. The "XMLHttpRequest" will give better clues for Ajax. Reference [http://ajaxian.com/archives/ajax-debugging-with-firebug]
    There may be a about:config option that allows mutithreading or max persistent connections per server you can check.

  • Download Servlet throwing Out Of Memory Exception

    I am trying to download file of more than 500 mb through servlet but getting out of memory exception .
    Before downloading i am zipping that huge file .
    try {
         String zipFileName = doZip(file);
          file =null;
          System.gc();
          File inputFile = new File(zipFileName);
          InputStream fileToDownload = new FileInputStream(
                                            inputFile);
           response.setContentType("application/zip");
         response.setHeader("Content-Disposition","attachment; filename=\""
                                                      + fileName.replaceAll("tmx", "zip")
                                                                .concat("\""));
         response.setContentLength(fileToDownload.available());
         byte buf[] = new byte[BUF_SIZE];
         int read;
         while ((read = fileToDownload.read(buf)) != -1) {
                   outs.write(buf, 0, read);
              fileToDownload.close();
                   outs.flush();
                                  outs.close();
    }catch(Exception e ) {
      //Getting out of memory.
    }Please suggest solution for this .

    cotton.m wrote:
    My zip suggestion was as follows.
    Take the file. Do not set the Content length header. Do set the Content encoding header to gzip. Create a GZIP output stream using the servlet output stream. Read the unzipped file in and output it through the gzip output stream.
    This cuts out one full cycle of file reading and writing from what you are doing currently.Thanks for u r reply
    InputStream fileToDownload = new FileInputStream(
                                            file);
    response.setContentType("application/gzip");
    response.setHeader("Transfer-Encoding", "chunked");
    response.setContentLength((int) file.length());
    GZIPOutputStream gzipoutputstream = new GZIPOutputStream(outs);
    byte buf[] = new byte[BUF_SIZE];
    int read;
    while ((read = fileToDownload.read(buf)) != -1) {
         gzipoutputstream.write(buf, 0, read);
    fileToDownload.close();
    outs.flush();
    outs.close();I made changes accordingly . Please provide u r view on this .

  • SAP AS JAVA installation in Solaris Zone envirn throws OUT of Memory error.

    Hi,
    We are installing SAP NW2004s 7.0 SR3 AS JAVA on Solaris 10 in zone environment. Thsi was prod server getting build where on top of this we will install GRC 5.3.
    We have faced no issues in development build.
    But during the Prod build at databse create step, we are getting the below error
    ORA-27102: out of memory
    SVR4 Error: 22: Invalid argument
    Disconnected
    SAPinst log entries where error messages started:
    04:43:58.128
    Execute step createDatabase of component |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|2|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_OraDBCheck|ind|ind|ind|ind|0|0|NW_OraDBMain|ind|ind|ind|ind|0|0|NW_OraDBStd|ind|ind|ind|ind|3|0|NW_OraDbBuild|ind|ind|ind|ind|5|0
    INFO 2011-04-01 04:45:14.590
    Working directory changed to /tmp/sapinst_exe.16718.1301647358.
    INFO 2011-04-01 04:45:14.595
    Working directory changed to /tmp/sapinst_instdir/NW04S/SYSTEM/ORA/CENTRAL/AS.
    INFO 2011-04-01 04:45:14.609
    Working directory changed to /tmp/sapinst_exe.16718.1301647358.
    INFO 2011-04-01 04:45:14.621
    Working directory changed to /tmp/sapinst_instdir/NW04S/SYSTEM/ORA/CENTRAL/AS.
    INFO 2011-04-01 04:45:14.850
    Account oraac5 already exists.
    INFO 2011-04-01 04:45:14.852
    Account dba already exists.
    INFO 2011-04-01 04:45:14.852
    Account oraac5 already exists.
    INFO 2011-04-01 04:45:14.853
    Account dba already exists.
    INFO 2011-04-01 04:45:14.867
    Working directory changed to /tmp/sapinst_exe.16718.1301647358.
    INFO 2011-04-01 04:45:14.899
    Working directory changed to /tmp/sapinst_instdir/NW04S/SYSTEM/ORA/CENTRAL/AS.
    ERROR 2011-04-01 04:45:32.280
    CJS-00084  SQL statement or script failed. DIAGNOSIS: Error message: ORA-27102: out of memory
    SVR4 Error: 22: Invalid argument
    Disconnected
    . SOLUTION: See ora_sql_results.log and the Oracle documentation for details.
    ERROR 2011-04-01 04:45:32.286
    MUT-03025  Caught ESAPinstException in Modulecall: ORA-27102: out of memory
    SVR4 Error: 22: Invalid argument
    Disconnected
    ERROR 2011-04-01 04:45:32.453
    FCO-00011  The step createDatabase with step key |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|2|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_OraDBCheck|ind|ind|ind|ind|0|0|NW_OraDBMain|ind|ind|ind|ind|0|0|NW_OraDBStd|ind|ind|ind|ind|3|0|NW_OraDbBuild|ind|ind|ind|ind|5|0|createDatabase was executed with status ERROR ( Last error reported by the step :Caught ESAPinstException in Modulecall: ORA-27102: out of memory
    SVR4 Error: 22: Invalid argument
    Disconnected
    ora_sql_results.log
    04:45:15 SAPINST ORACLE start logging for
    SHUTDOWN IMMEDIATE;
    exit;
    Output of SQL executing program:
    SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 1 04:45:15 2011
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to an idle instance.
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SVR4 Error: 2: No such file or directory
    Disconnected
    SAPINST: End of output of SQL executing program /oracle/AC5/102_64/bin/sqlplus.
    SAPINST found errors.
    SAPINST The current process environment may be found in sapinst_ora_environment.log.
    2011-04-01, 04:45:15 SAPINST ORACLE stop logging
    ================================================================================
    2011-04-01, 04:45:15 SAPINST ORACLE start logging for
    STARTUP NOMOUNT;
    exit;
    Output of SQL executing program:
    SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 1 04:45:15 2011
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to an idle instance.
    ORA-27102: out of memory
    SVR4 Error: 22: Invalid argument
    Disconnected
    SAPINST: End of output of SQL executing program /oracle/AC5/102_64/bin/sqlplus.
    SAPINST found errors.
    SAPINST The current process environment may be found in sapinst_ora_environment.log.
    2011-04-01, 04:45:32 SAPINST ORACLE stop logging
    Already viewed S-note
    724713 - parameter settings for Solaris 10 - (Parameters are set as per this note)
    743328 - Composite SAP note: ORA-27102 - (no much information in memory problem on zones)
    Please provide your suggestions/resolution.
    Thankyou.

    Hi,
    @ Sunny: Thanks for response, the referred note was already checked and parameters are in sync as per note.
    @Mohit: SAP wouldn't proceed till create database if Oracle software was not installed. thanks for the response.
    @Markus: Thanks I agree with you, but I have doubt in this area. Isn't it like project.max-shm-memory was new parameter we need to set in local zone rather using shmsys:shminfo_shmmax in /etc/system. Do we need to still maintain this parameter in /etc/system in global zone.
    As per SUN doc below parameter was obsolete from Solaris 10.
    The following parameters are obsolete.
    ■ shmsys:shminfo_shmmni
    ■ shmsys:shminfo_shmmax
    As per your suggestion, do we need to set below parameters in that case, please clarify.
    Parameter                           Replaced by Resource Control      Recommended Value
    semsys:seminfo_semmni   project.max-sem-ids                      100
    semsys:seminfo_semmsl   process.max-sem-nsems               256
    shmsys:shminfo_shmmax  project.max-shm-memory             4294967295
    shmsys:shminfo_shmmni   project.max-shm-ids                       100
    Also   findings of /etc/release
    more /etc/release
    Solaris 10 10/08 s10s_u6wos_07b SPARC
    Regards,
    Sitarama.

  • Importing Word docs from RH for Word X5 - out of memory error

    I've tried a few times to import 537 Word docs (2,974) from a
    RH for Word project (RH X5 for Word, CHM output) into a new RH HTML
    5 project. Each time, RH HTML "hangs" and I've seen "out of memory"
    at least once at the very end. The original RH for Word project has
    conditional build tags defined, but only one tag has been assigned
    to one topic, so far. We've never been able to build an index in
    this RH for Word project (it's mostly blank), but we've built a
    search and contents without problems.
    Is an error related to Word? Is it a bug that was fixed for
    version 6? Is it somehow related to this fix:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=kb401651&sliceId=1?
    If it's a known bug that was fixed with a later version, then
    it would further help me build a case for converting to RH 7, with
    the end result of converting the whole thing eventually to RH HTML.
    Thanks,
    Jim

    I don't do much import but if you are trying to import 537
    documents in one go, nothing would surprise me. Have you tried one
    at a time or a small batch at a time?
    The bug you point to arose in 6 and was fixed so it is not
    relevant.
    My guess is it is down to memory and that most PCs would
    baulk at 537 documents in one go.

  • Writing Image files from Applet to Servlet

    How to write ImageFiles from an Applet to a Servlet?
    I draw a image on a JComponent in Applet and wanted to save the image file in the server.
    I am unable to write an Image Object to the Servlet as the BufferedImage class is not serialized.
    I tried writing the image to the Servlet output stream and tried reading the data in the servlet and writing the data to a jpg file.
    But the files is not being written as proper jpeg file.
    Any help would be great.
    Thanks,
    Sridhar.

    I get the following exception below when i try to write a Serialized object from an applet to the servlet.
    I copied the serialized class jar file to the tomcat webserver lib folder.
    The serialized class has a BufferedImage object.
    Serialized Class Code
    public class SerializedImage implements Serializable{
         private BufferedImage im = null;
         public SerializedImage() {
              super();
         public BufferedImage getSerializedObject() {
              return im;
         public void setSerializedObject((BufferedImage im) {
              this.im = im;
         private BufferedImage fromByteArray(byte[] imagebytes) {
              try {
                   if (imagebytes != null && (imagebytes.length > 0)) {
                        BufferedImage im = ImageIO.read(new ByteArrayInputStream(imagebytes));
                        return im;
                   return null;
              } catch (IOException e) {
                   throw new IllegalArgumentException(e.toString());
         private byte[] toByteArray(BufferedImage o) {
              if(o != null) {
                   BufferedImage image = (BufferedImage)o;
                   ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
                   try {
                        ImageIO.write(image, "jpg", baos);
                   } catch (IOException e) {
                        throw new IllegalStateException(e.toString());
                   byte[] b = baos.toByteArray();
                   return b;
              return new byte[0];
         private void writeObject(java.io.ObjectOutputStream out)
         throws IOException {
              byte[] b = toByteArray(im);
              out.writeInt(b.length);
              out.write(b);
         private void readObject(java.io.ObjectInputStream in)
         throws IOException, ClassNotFoundException {
              int length = in.readInt();
              byte[] b = new byte[length];
              in.read(b);
              im = fromByteArray(b);
    Exception :
    java.io.StreamCorruptedException: unexpected block data
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1288)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:18
    45)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
    646)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    Is there any thing that i am missing or doing wrong?
    Thanks,
    Sridhar.

  • Out of Memory error while builng HTML String from a Large HashMap.

    Hi,
    I am building an HTML string from a large map oject that consits of about 32000 objects using the Transformer class in java. As this HTML string needs to be displayed in the JSP page, the reponse time was too high and also some times it is throwing out of memory error.
    Please let me know how i can implement the concept of building the library tree(folder structure) HTML string for the first set of say 1000 entries and then display in the web page and then detect an onScroll event and handle it in java Script functions and come back and build the tree for the next set of entries in the map and append this string to the previous one and accordingly display it.
    please let me know whether
    1. the suggested solution was the advisable one.
    2. how to build tree(HTML String) for a set of entries in the map while iterating over the map.
    3. How to detect a onScroll event and handle it.
    Note : Handling the events in the JavaScript functions and displaying the tree is now being done using AJAX.
    Thanks for help in Advance,
    Kartheek

    Hi
    Sorry,
    I haven't seen any error in the browser as this may be Out of memory error which was not handled. I got the the following error from the web logic console
    org.apache.struts.actions.DispatchAction">Dispatch[serviceCenterHome] to method 'getUserLibraryTree' returned an exceptionjava.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
         at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.OutOfMemoryError
    </L_MSG>
    <L_MSG MN="ILHD-1109" PID="adminserver" TID="ExecuteThread: '14' for queue: 'weblogic.kernel.Default'" DT="2012/04/18 7:56:17:146" PT="WARN" AP="" DN="" SN="" SR="org.apache.struts.action.RequestProcessor">Unhandled Exception thrown: class javax.servlet.ServletException</L_MSG>
    <Apr 18, 2012 7:56:17 AM CDT> <Error> <HTTP> <BEA-101017> <[ServletContext(id=26367546,name=fcsi,context-path=/fcsi)] Root cause of ServletException.
    *java.lang.OutOfMemoryError*
    Please Advise.
    Thanks for your help in advance,
    Kartheek

  • Large Pdf using XML XSL - Out of Memory Error

    Hi Friends.
    I am trying to generate a PDF from XML, XSL and FO in java. It works fine if the PDF to be generated is small.
    But if the PDF to be generated is big, then it throws "Out of Memory" error. Can some one please give me some pointers about the possible reasons for this errors. Thanks for your help.
    RM
    Code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    import org.apache.fop.apps.Driver;
    import org.apache.fop.apps.Version;
    import org.apache.fop.apps.XSLTInputHandler;
    import org.apache.fop.messaging.MessageHandler;
    import org.apache.avalon.framework.logger.ConsoleLogger;
    import org.apache.avalon.framework.logger.Logger;
    public class PdfServlet extends HttpServlet {
    public static final String FO_REQUEST_PARAM = "fo";
    public static final String XML_REQUEST_PARAM = "xml";
    public static final String XSL_REQUEST_PARAM = "xsl";
    Logger log = null;
         Com_BUtil myBu = new Com_BUtil();
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException {
    if(log == null) {
         log = new ConsoleLogger(ConsoleLogger.LEVEL_WARN);
         MessageHandler.setScreenLogger(log);
    try {
    String foParam = request.getParameter(FO_REQUEST_PARAM);
    String xmlParam = myBu.getConfigVal("filePath") +"/"+request.getParameter(XML_REQUEST_PARAM);
    String xslParam = myBu.SERVERROOT + "/jsp/servlet/"+request.getParameter(XSL_REQUEST_PARAM)+".xsl";
         if((xmlParam != null) && (xslParam != null)) {
    XSLTInputHandler input = new XSLTInputHandler(new File(xmlParam), new File(xslParam));
    renderXML(input, response);
    } else {
    PrintWriter out = response.getWriter();
    out.println("<html><head><title>Error</title></head>\n"+
    "<body><h1>PdfServlet Error</h1><h3>No 'fo' "+
    "request param given.</body></html>");
    } catch (ServletException ex) {
    throw ex;
    catch (Exception ex) {
    throw new ServletException(ex);
    public void renderXML(XSLTInputHandler input,
    HttpServletResponse response) throws ServletException {
    try {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    response.setContentType("application/pdf");
    Driver driver = new Driver();
    driver.setLogger(log);
    driver.setRenderer(Driver.RENDER_PDF);
    driver.setOutputStream(out);
    driver.render(input.getParser(), input.getInputSource());
    byte[] content = out.toByteArray();
    response.setContentLength(content.length);
    response.getOutputStream().write(content);
    response.getOutputStream().flush();
    } catch (Exception ex) {
    throw new ServletException(ex);
    * creates a SAX parser, using the value of org.xml.sax.parser
    * defaulting to org.apache.xerces.parsers.SAXParser
    * @return the created SAX parser
    static XMLReader createParser() throws ServletException {
    String parserClassName = System.getProperty("org.xml.sax.parser");
    if (parserClassName == null) {
    parserClassName = "org.apache.xerces.parsers.SAXParser";
    try {
    return (XMLReader) Class.forName(
    parserClassName).newInstance();
    } catch (Exception e) {
    throw new ServletException(e);

    Hi,
    I did try that initially. After executing the command I get this message.
    C:\>java -Xms128M -Xmx256M
    Usage: java [-options] class [args...]
    (to execute a class)
    or java -jar [-options] jarfile [args...]
    (to execute a jar file)
    where options include:
    -cp -classpath <directories and zip/jar files separated by ;>
    set search path for application classes and resources
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -showversion print product version and continue
    -? -help print this help message
    -X print help on non-standard options
    Thanks for your help.
    RM

  • How to get the complete path name when uploading a file from servlet

    Hi,
    I write a servlet to upload a file from html page
    <intput type=file name=fileupload>I am using
    import org.apache.commons.fileupload.to upload file. i want to get the all fields in the form and file name and content of the file also.
    It give the file name only
    String filename= fileItem.getName();
    o/p krish.jpgBut i want complete path naem like
    d:/krishna/images/funny/krish.jpgI serach the API org.apache.commons.fileupload.*
    But i did nt find the method to get it.
    plz help me , which api or method to use here..

    Krishna_Rao_chintu wrote:
    But i need path and have to do some calculations on it.No, you don't. If you have requirements which say you do then the requirements are wrong. You couldn't do anything useful with the path on the client system even if you could get it.
    is there any alternatives in java
    I need path and have to calculate MD5, Presumably you need to calculate MD5 on the contents of the file and not on the name of the file.
    and convert the file to binary format.... etc oprations on itSorry, "convert a file to binary format" is basically meaningless.
    but we can get the content of the file using
    byte [] get()/ getString() methods
    If i get content is there any performance degrades?
    ie if the content is lengthy is it take more time?Take more time than what? Degrading performance from what? It's certainly true that it would be quicker to not upload the file, but that's a pointless comparison. If you have some other process to compare with, let us know what it would be.

  • How to upload large file with http via post

    Hi guys,
    Does anybody know how to upload large file (>100 MB) use applet to servlet with http via post method? Thanks in advance.
    Regards,
    Mark.

    Hi SuckRatE
    Thanks for your reply. Could you give me some client side code to upload a large file. I use URL to connect to server. It throws out of memory exception. The part of client code is below:
    // connect to the servlet
    URL theServlet = new URL(servletLocation);
    URLConnection servletConnection = theServlet.openConnection();
    // inform the connection that we will send output and accept input
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    // Don't used a cached version of URL connection.
    servletConnection.setUseCaches (false);
    servletConnection.setDefaultUseCaches(false);
    // Specify the content type that we will send text data
    servletConnection.setRequestProperty("Content-Type",
    +"application/octet-stream");
    // send the user string to the servlet.
    OutputStream outStream = servletConnection.getOutputStream();
    FileInputStream filein = new FileInputStream(largeFile);
    //BufferedReader in = new BufferedReader(new InputStreamReader
    +(servletConnection.getInputStream()));
    //System.out.println("tempCurrent = "+in.readLine());
    byte abyte[] = new byte[2048];
    int cnt = 0;
    while((cnt = filein.read(abyte)) > 0)
    outStream.write(abyte, 0, cnt);
    filein.close();
    outStream.flush();
    outStream.close();
    Regards,
    Mark.

  • Problem while sending seriailized  object from applet to servlet

    Hi I m having Object communication between Applet and Servlet.
    I m getting error stack trace as
    java.io.EOFException
         at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
         at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
    at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
         at java.io.ObjectInputStream.<init>(Unknown Source)
         at com.chat.client.ObjectClient.write(ObjectClient.java:56)
    at the line
    ObjectInputStream ois = new ObjectInputStream(conn.getInputStream());
    thanks in advance
    Ravi
    the whole code is as follows....
    public Serializable write(Serializable obj) throws IOException,ClassNotFoundException{
              URLConnection conn = serverURL.openConnection();
              conn.setDoOutput(true);
              conn.setDoInput(true);
              conn.setUseCaches(false);
              conn.setRequestProperty("Content-Type", "java-internal/"+obj.getClass().getName());
              conn.connect();
              ObjectOutputStream oos= null;
              try{
              oos = new ObjectOutputStream(
                   conn.getOutputStream());
                        oos.writeObject(obj);
                   catch(Exception ee){
                                       ee.printStackTrace();
                   finally{
                        if(oos!=null){
                             oos.flush();
                             oos.close();
                        return the reponse to the client
                   ObjectInputStream ois=null;
                   try{
    \\this is the line where i m getting the error               
    ois = new ObjectInputStream(conn.getInputStream());
                             return (Serializable)ois.readObject();
                        catch(Exception ee){
                                            System.out.println("Error in Object Client inputstream ");
                                            ee.printStackTrace();
                                            return null;
                        finally{
                             if(ois!=null){
                                  ois.close();

    Did anyone find a fix to this problem. I am having a similiar problem. Sometimes I receive an EOFException and othertimes I don't. When I do receive an EOFException I check for available() in the stream and it appears 0 bytes were sent to the Servlet from the Applet.
    I am always open to produce this problem when I use File->New in IE my applet loads on the new page.. and then I navigate to a JSP sitting on the same application server. When I go to the Applet on the initial page and try to send an object to the server I get an EOFException. No idea!

  • Problem in sending image from applet to servlet

    dear friends,
    i have a need to send an image from applet to servlet via HttpConnection and getting back that image from applet.
    i am struggling with this sice many hours and got tired by searching any post that would help me but haven't got yet.
    i tried using this code but it dosent make any execution sit right. i got NPE at ImageIcon.getDescription() line;
    at applet side
          jf.setContentPane(getJContentPane());
                     FileDialog fd=new FileDialog(jf,"hi");
                     fd.setMode(FileDialog.LOAD);
                     fd.setVisible(true);   
                     v=new Vector();
                     try{                                                
                               FileInputStream fis=new FileInputStream(new File(fd.getDirectory()+fd.getFile()));      
                               byte[] imgbuffer=new byte[fis.available()];
                               fis.read(imgbuffer);
                               ImageIcon imgdata=new ImageIcon(imgbuffer);
                               v.add(0,imgicon);
                                String strwp ="/UASProject/Storeimage";              
                                URL servletURL = new URL(getCodeBase(),strwp);             
                                HttpURLConnection servletCon = (HttpURLConnection)servletURL.openConnection();       
                                servletCon.setDoInput(true); 
                                servletCon.setDoOutput(true);
                                servletCon.setUseCaches(false);
                                servletCon.setDefaultUseCaches(false);   
                                servletCon.setRequestMethod("POST");     
                                servletCon.setRequestProperty("Content-Type", "application/octet-stream");   
                                servletCon.connect();            
                                ObjectOutputStream oboutStream = new ObjectOutputStream(servletCon.getOutputStream());                     
                                oboutStream.writeObject(v);
                                v.remove(0);
                                oboutStream.flush();      
                                oboutStream.close();  
                                //read back from servlet
                                ObjectInputStream inputStream = new ObjectInputStream(servletCon.getInputStream());
                                 v= (Vector)inputStream.readObject();                     
                                 imgicon=(ImageIcon)v.get(1);
                                 showimg.setIcon(imgicon);
                                 this.getContentPane().validate();
                                 this.validate();  
                                inputStream.close();                                                        
                             //  repaint();
                     }catch(Exception e){e.printStackTrace();}  and this is at servlet side
            try {       
                         Vector v=new Vector();                    
                         ObjectInputStream inputFromjsp = new ObjectInputStream(request.getInputStream());                                      
                          v = (Vector)inputFromjsp.readObject();                                                                                                          
                          imgicon=(ImageIcon)v.get(0);                     
                          inputFromjsp.close();            
                          System.out.println(imgicon.getDescription());                                      
                          v.remove(0);
                          v.add(1,imgicon);
    //sending back to applet
                           response.setContentType("application/octet-stream");
                          ObjectOutputStream oboutstream=new ObjectOutputStream(response.getOutputStream());            
                          oboutstream.writeObject(v);
                          oboutstream.flush();
                          oboutstream.close();
                   } catch (Exception e) {e.printStackTrace();}  i really need your help. please let me out of this headche
    thanks
    Edited by: san_4u on Nov 24, 2007 1:00 PM

    BalusC wrote:
    san_4u wrote:
    how can i made a HttpClient PostMethod using java applets? as i have experience making request using HttpURLConnection.POST method. ok first of all i am going make a search of this only after i will tell. please be onlineOnce again, see link [3] in my first reply of your former topic.
    yeah! i got the related topic at http://www.theserverside.com/tt/articles/article.tss?l=HttpClient_FileUpload. please look it, i am reading it right now and expecting to be reliable for me.
    well what i got, when request made by html code(stated above) then all the form fields and file data mixed as binary data and available in HttpServletRequest.getinputstream. and at servlet side we have to use a mutipart parser of DiskFileItemFactory class that automatically parse the file data and return a FileItem object cotaing the actual file data,right?.You can also setup the MultipartFilter in your environment and don't >care about it further. Uploaded files will be available as request attributes in the servlet.is the multipartfilter class file available in jar files(that u suggested to add in yours article) so that i can use it directly? one more thing the import org.apache.commons.httpclient package is not available in these jar files, so where can got it from?
    one mere question..
    i looked somewhere that when we request for a file from webserver using web browser then there is a server that process our request and after retrieving that file from database it sends back as response.
    now i confused that, wheather these webservers are like apache tomcat, IBM's webspher etc those processes these request or there is a unique server that always turned on and process all the request?
    because, suppose in an orgnisation made it's website using its own server then, in fact, all the time it will not turned on its server or yes it will? and a user can make a search for kind of information about this orgnisation at any time.
    hopes, you will have understand my quary, then please let me know the actual process
    thanks
    Edited by: san_4u on Nov 25, 2007 11:25 AM

Maybe you are looking for

  • How to create a job to run daily, based on form values entered.

    Hi, In DB we have 3 columns: creation_date, name, approved_or_not. Default for approved_or_not is 'No'. In the application form page suppose I fill in sysdate for creation_date and leave default for approved_or_not and click [create] button. Now a jo

  • Holding with one hand in landscape mode?

    When playing games, some games require me to hold it with one hand in landscape mode. My iPad doesn't feel as secure as when I hold it with one hand in portrait mode. Is the iPad designed to be held in landscape mode with just one hand... therefore,

  • I dont get more than 2-2.5 Hours out of my MacBook Air (at lowest settings)

    I have a serious problem with my MBA. I mainly use it to take notes at University. So my normal usage is: Screen brightness turned to the lowest possible point, WLAN+Bluetooth OFF and Word running. How many hours do I get? If I'm lucky, 2.5! And I'm

  • HDR-AS200V Enter button broken

    I just bought an HDR-AS200V in March. I use the camera a lot for my business. Love the camera but the enter button on the back of the camera has stopped responding to being pressed. No support is available, that I can find, through Sony. Could someon

  • MBP Bad Display? Goes black randomly.

    I am having an issue with my Macbook Pro display which I have seen many variants of surfing the intertubes here. The screen goes black more or less at random. I am hoping to avoid having it serviced as my black tie service plan expired last november