Servlet output streaming problem

Hi all !
          Given the following JSP/Servlet:
          <html>
          <body>
          Test
          <%
          out.println( "<h1>Countdown</h1>" );
          for ( int i = 10; i > 0; i-- ) {
          out.print( "<h1>" );
          out.print( i );
          out.println( "</h1>" );
          out.flush();
          try {
          // simulate access to an external system
          Thread.sleep( 1000 );
          catch ( InterruptedException e ) {}
          out.println( "<h1>Liftoff</h1>" );
          out.close();
          %>
          </body>
          </html>
          This prints out the numbers 10 to 0 with a seconds pause inbetween.
          This works on our development server. However, after uploading to the
          production server, the page is blank for ten seconds and then shows
          all the numbers in one chunk. The problem is that the out.flush()
          statement appearently is ignored by the weblogic server. No errors or
          exceptions in any logs.
          Is this a configuration issue ?
          Setup:
          * Weblogic 5.1
          * Linux Redhat 7.2
          Thanks.
          Pål O.
          

Do you have a proxy in front of WL? Do you have a web proxy on the client
          side?
          Peace,
          Cameron Purdy
          Tangosol, Inc.
          http://www.tangosol.com/coherence.jsp
          Tangosol Coherence: Clustered Replicated Cache for Weblogic
          "Pål O. Kristiansen" <[email protected]> wrote in message
          news:[email protected]...
          > Hi all !
          >
          > Given the following JSP/Servlet:
          >
          > <html>
          > <body>
          > Test
          > <%
          > out.println( "<h1>Countdown</h1>" );
          > for ( int i = 10; i > 0; i-- ) {
          > out.print( "<h1>" );
          > out.print( i );
          > out.println( "</h1>" );
          > out.flush();
          > try {
          > // simulate access to an external system
          > Thread.sleep( 1000 );
          > }
          > catch ( InterruptedException e ) {}
          > }
          > out.println( "<h1>Liftoff</h1>" );
          > out.close();
          > %>
          > </body>
          > </html>
          >
          > This prints out the numbers 10 to 0 with a seconds pause inbetween.
          > This works on our development server. However, after uploading to the
          > production server, the page is blank for ten seconds and then shows
          > all the numbers in one chunk. The problem is that the out.flush()
          > statement appearently is ignored by the weblogic server. No errors or
          > exceptions in any logs.
          >
          > Is this a configuration issue ?
          >
          > Setup:
          > * Weblogic 5.1
          > * Linux Redhat 7.2
          >
          > Thanks.
          >
          > Pål O.
          

Similar Messages

  • Read Servlet output stream

    how can i read servlet output stream

    i m using SAX to create an XML.
    I set result to "Servlet Output Stream" as shown below :->
    SAXTransformerFactory saxTF = SAXTransformerFactory.newInstance();
    TransformerHandler th = saxTF.newTransformerHandler();
    Transformer t = th.getTransformer();
    StreamResult stRes = new StreamResult(res.getOutputStream());
    th.setResult(stRes);
    th.startDocument();
    what i want to wright the same xml result in file at the same time(parallel y).

  • Servlet Output Streams and clearing

    I am using servlets, and I want to be able to print something repeatedly. Well, that's not exactly true: I can print something repeatedly. Using a ServletOutputStream, it doesn't seem possible to clear what has already been written. Here's the code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.*;
    public class AlwaysTime extends HttpServlet {
         public void doPost(HttpServletRequest req, HttpServletResponse res)                throws ServletException, IOException {
              HttpServletResponse oldRes = res;
              Date now = new Date();
              res.setContentType("text/html");
              ServletOutputStream out = res.getOutputStream();
              out.println("<html>");
              out.println("<head>");
              out.println("<title>Clock</title>");
              out.println("</head>");
              out.println("<body>");
              out.println("<h1 align=\"Center\">");
              out.println(now.toString());
              out.println("</h1>");
              out.println("</body>");
              out.println("</html>");
              try {
                 Thread.sleep(1000);
              } catch (InterruptedException ie) {}
              // Do nothing: wait for 1 second.
              doPost(req, oldRes);
         public void doGet(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException {
              doPost(req, res);
    }This code prints the time every second, but I want to clear the previous output stream. I thought the code shown above would work, but of course, oldRes points to the same object as res. But I don't know how to clear an output stream, so that it is completely empty. Instead, each of the new lines are appended to the same output stream.
    This doesn't only apply to servlet output streams: is there some way to clear the System output stream, for instance?
    But mainly the servlet output stream ...

    You would not want to use HTTP for this type of functionality. HTTP is known as a 'stateless' protocol that simply returns one exact response for each request. So, there is not way to 'clear' the stream (technically, you would not do so for 'normal' streams either, but when you add HTTP into the mix, the task is definitely not possible).
    You could implement the above using a RSS feed, or by using HTTP meta-refresh tags on the page itself ot resubmit the requests every second (though this would be inefficient). An applet would also do the task.
    - Saish

  • REG:SERVLET OUTPUT STREAM

    I am trying to implement upload/view functionality..To view an uploaded txt file or html file,I am just flushing out the file contents into servlet's output stream..The content type has been set appropriately.
    The problem is for some html files ia m able to see the file contents in the browser,and for some html files,the browser displays a open/save dialog box..
    Can any1 explain me why this discrepency?Its the sam e code and same content type..why is it so?

    Thanks for ur reply...
    All i mentioned was in the same browser..PFB the code snippet
         ServletOutputStream pic = null;
         pic = response.getOutputStream();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         byte b[] = new byte[5*1024];
         while(true)
              int bytes = in.read(b);
              if(bytes == -1)
                   break;
              baos.write(b, 0, bytes);
         response.setContentLength(b.length);
         b = baos.toByteArray();
         pic.write(b, 0, b.length);
         pic.flush();
         pic.close()

  • Writing to servlet output stream

    Hi All,
    I am writing to a servlet(imageservlet) output stream in a jsp page two times as follows:
    <img src="\imageservlet?key=x1">
    <img src="\imageservlet?key=x2">
    It is causing memory errors. Do I have to take special precautions?
    Thanks inadvance.

    Hi,
    THis is my servlet code.
    import java.io.*;
    import java.io.StringWriter;
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.awt.Color;
    import com.trizetto.healthweb.service.GenerateImage;
    * Simple servlet to use with Image I/O generator
    public class GenerateImageServlet extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
         String className="PieChartGenerator";
         if(request.getParameter("keyName").equals("Pie"))
              className=PieChartGenerator";
         else if( request.getParameter("keyName").equals("Gantt") )
              className="GanttChartGenerator";
    try
    GenerateImage ge=
    (GenerateImage) Class.forName(className).newInstance();
    String type = ge.createImage(response.getOutputStream());
    response.setContentType(type);
    catch (Exception e)
    throw new ServletException(e);
    But this one does not generate image. The image is generated from the Graphics object of the Frame.
    Something like the following code:
    http://www.javaworld.com/javaworld/jw-05-2000/servlets/Servlets.zip
    http://www.javaworld.com/javaworld/jw-05-2000/jw-0505-servlets-p2.html
    http://www.javaworld.com/javaworld/jw-05-2000/jw-0505-servlets-p1.html
    I am using Java 1.1.
    I am running my app. in websphere. The error happens randomly while I am stopping the websphere application server.
    Thanks in advance.

  • Preventing servlet output stream to flush

    I increased the buffersize in the response object in order to make it possible for the entire jsp page to process before writing any output to the webclient.
    BUT since I use dynamic jsp-includes I fail to accomplish this, since according to the JSP1.3 specification the output stream is flushed before processing a dynamic include instruction.
    Is there a way I can make JSP to process the include and write output to buffer WITHOUT flushing it?
    Regards, Jon

    No I am using JSP 1.3. And I want to do the following:<%
    for (int i = 0; i < 5; i++) {
       // include("file_"+ i +".jsp");
    %>This to include file_0.jsp up to file_4.jsp.
    I assume the <jsp:include>tag is preprocessed hence only included once.

  • Java.lang.Process output stream problem

    Hi, I have a program that starts a process (java.lang.Process) using the java.lang.Runtime.exec() and it attemtps to interface with it using the provieded io streams. I have both the output and error streams being handled on their own threads and I have a hashmap of output lines/command pairs that are checked so that when the process outputs certain lines to the console it feed the proper input into the process. My problem is that when I feed the input into the process it dosen't respond to it almost like the user hasn't pressed enter, The process hangs. I have tried using /n /r and permutations thereof but nothing works. The thread does read the lines from the process and does output to the process from what i can gather. Can you help me!
    here is some of the code..
    public void run() {
    try {
         //the process's output
         InputStreamReader isrOutput = new InputStreamReader(inOutput);
         //the process's input(our output)
         PrintWriter pw = new PrintWriter(outInput);
         String line = null;
         while(true){
              if(brOutput.ready()){
                   line = "";
                   while(brOutput.ready())
         line+=(char)brOutput.read();
                   System.out.print(line);
                   if(commands.containsKey(line)){
         pw.println((String)commands.get(line));
         System.out.println((String)commands.get(line));;
    } catch (IOException ioe) {
              ioe.printStackTrace();
    }Thanks

    Oops.. i forgot to flush my PrintWriter /blushing......... Thanks

  • ObjectInput-Output Stream problem ?

    I have a server-client program and I am sending my data on OutputStream()
                input = new InputStream(mydataSocket.getInputStream()) ;
                output = new OutputStream(mydataSocket.getOutputStream()) ;
                objInput = new ObjectInputStream(input) ;
                objOutput = new ObjectOutputStream(output) ;but I am taking an error.
    Implement all abstract method() ;
    is this read() method necessary ?

    Server
        protected void runServer() throws IOException
            ServerSocket serSock = null ;
            Socket sock ;
            ObjectOutputStream output ;
            ObjectInputStream input ;
            String line ;
            ArrayList<String> al = new ArrayList<String>() ;
            try {
                serSock = new ServerSocket(5000,100) ;
                while (true)
                    sock = serSock.accept() ;
                    input = new ObjectInputStream(sock.getInputStream()) ;
                    output = new ObjectOutputStream(sock.getOutputStream()) ;
                        line = input.readUTF() ;
                        al.add(line) ;
                    try {
                            for ( int j = 0 ; j < al.size() ; j++ )
                                oyuncu_listesi += al.get(j) + "," ;
                                output.writeUTF(al.get(j)) ;
                    } catch (IOException e) {
                        System.err.println(e) ;
                        e.printStackTrace();
                        System.exit(1);
                    sock.close() ;
           } catch(IOException e) {
                System.out.println(e) ;
            finally {
                serSock.close() ;
        }Client
        protected void baglan() throws IOException
                Socket client ;
                ObjectInputStream input ;
                ObjectOutputStream output ;
                String line , deger ;
                try {
                    client = new Socket(InetAddress.getLocalHost() ,5000) ;
                    input = new ObjectInputStream(client.getInputStream()) ;
                    output = new ObjectOutputStream(client.getOutputStream()) ;
                        deger = girdi.getText() ;
                        output.writeUTF(deger) ;
                        output.flush() ;
                    while ( true ) {
                            line = input.readUTF() ;
                            liste.addElement(line + "\n") ;
                } catch (IOException e) {
                    System.out.println(e) ;
        }

  • How can I put an output stream (HTML) from a remote process on my JSF page

    Hello,
    I've a question if someone could help.
    I have a jsf application that need to execute some remote stuff on a different process (it is a SAS application). This remote process produces in output an html table that I want to display in my jsf page.
    So I use a socket SAS class for setting up a server socket in a separate thread. The primary use of this class is to setup a socket listener, submit a command to a remote process (such as SAS) to generate a data stream (such as HTML or graphics) back to the listening socket, and then write the contents of the stream back to the servlet stream.
    Now the problem is that I loose my jsf page at all. I need a suggestion if some one would help, to understand how can I use this html datastream without writing on my Servlet output stream.
    Thank you in advance
    A.
    Just if you want to look at the details .....
    // Create the remote model
    com.sas.sasserver.submit.SubmitInterface si =
    (com.sas.sasserver.submit.SubmitInterface)
    rocf.newInstance(com.sas.sasserver.submit.SubmitInterface.class, connection);
    // Create a work dataset
    String stmt = "data work.foo;input field1 $ field2 $;cards;\na b\nc d\n;run;";
    si.setProgramText(stmt);
    // Setup our socket listener and get the port that it is bound to
    com.sas.servlet.util.SocketListener socket =
    new com.sas.servlet.util.SocketListener();
    int port = socket.setup();
    socket.start();
    // Get the localhost name
    String localhost = (java.net.InetAddress.getLocalHost()).getHostAddress();
    stmt = "filename sock SOCKET '" + localhost + ":" + port + "';";
    si.setProgramText(stmt);
    // Setup the ods options
    stmt = "ods html body=sock style=brick;";
    si.setProgramText(stmt);
    // Print the dataset
    stmt = "proc print data=work.foo;run;";
    si.setProgramText(stmt);
    // Close
    stmt = "ods html close;run;";
    si.setProgramText(stmt);
    // get my output stream
    context = FacesContext.getCurrentInstance();
    HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
    ServletOutputStream out = response.getOutputStream();
    // Write the data from the socket to the response
    socket.write(out);
    // Close the socket listener
    socket.close();

    The system exec function is on the Communication palette. Its for executing system commands. On my Win2K system, the help for FTP is:
    "Ftp
    Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively. Click ftp commands in the Related Topics list for a description of available ftp subcommands. This command is available only if the TCP/IP protocol has been installed. Ftp is a service, that, once started, creates a sub-environment in which you can use ftp commands, and from which you can return to the Windows 2000 command prompt by typing the quit subcommand. When the ftp sub-environment is running, it is indicated by the ftp command prompt.
    ftp [-v] [-n] [-i] [-d] [-g]
    [-s:filename] [-a] [-w:windowsize] [computer]
    Parameters
    -v
    Suppresses display of remote server responses.
    -n
    Suppresses autologin upon initial connection.
    -i
    Turns off interactive prompting during multiple file transfers.
    -d
    Enables debugging, displaying all ftp commands passed between the client and server.
    -g
    Disables file name globbing, which permits the use of wildcard characters (* and ?) in local file and path names. (See the glob command in the online Command Reference.)
    -s:filename
    Specifies a text file containing ftp commands; the commands automatically run after ftp starts. No spaces are allowed in this parameter. Use this switch instead of redirection (>).
    -a
    Use any local interface when binding data connection.
    -w:windowsize
    Overrides the default transfer buffer size of 4096.
    computer
    Specifies the computer name or IP address of the remote computer to connect to. The computer, if specified, must be the last paramete
    r on the line."
    I use tftp all of the time to transfer files in a similar manner. Test the transfer from the Windows command line and copy it into a VI. Pass the command line to system exec and wait until it's done.

  • Servlet output not displayed properly in Internet Explorer

    Hi All,
    I'm developing a servlet which uploads a file. After the servlet parses the request body, it stores the file contents as a binary string in the database. While displaying the contents of the attached file, the IE(Internet Explorer) is ignoring all the newlines and spaces. IThe same uploaded file when viewed through Firefox browser is being displayed properly. I've added some debug statements to print the filecontent before sending it to servlet output stream. They look exactly as they were in the uploaded file. The MIME type is application/octet-stream.
    I've also made the response to accept "ISO-8859-1" and "UTF-8" charsets, yet the IE is not rendering the file contents properly. The code looks like this,
    response.setContentType("text/html; charset= ISO-8859-1, UTF-8");
    byte[] buff = attachment.getAttachObject();
    OutputStream out = response.getOutputStream();
    out.write(buff);
    out.close();
    I've tried using PrintWriter also. I've tried changing the content types, character encodings of request and response objects, still couldn't resolve the issue. What really baffles me is that when it's displaying properly in Firefox, why can't it render properly in IE? I'm using Win XP SP2, and IE version is 6.0.29. The content which is being sent to the output stream contains newline and space characters, but they are not displayed in the browser. Did any one face this sort of issue? Your help is highly appreciated.
    Thanks,
    Tarun.

    Hi,
    Thanks for looking into the issue. Let me tell you that I've tried keeping various content-types like text/plain, text/xml etc, but in none of those cases the IE rendered the output properly. But with the same content-type i.e text/html or text/plain, Firefox is able to render the file content properly. I've tried a brutal force approach like below,
    response.setContentType("text/plain");
    PrintWriter out = response.getWriter();
    String str = new String(attachment.getAttachObject());
    char[] buff = str.toCharArray();
    for(i=0;i< buff.length; i++)
    int n = (int)buff;
    if(n == 10)
    out.println();
    else
    out.print(buff[i]);
    out.close();
    I was trying to print a newline whenever I find a newline character in the file content. Even this didn't work. Please suggest me some way to get rid of this problem.

  • Servlet I/O Stream problem: cannot write into file, error 500

    I am a new Java developer and now, I am facing a problem regarding the error 500. I try to grab records from a table with a date as a constraint. There are two servlets involed: a) saveRecord and b) getRecord. Servlet getRecord will grab data from a database while another servlet, saveRecord will get the data from servlet getRecord and save it into a file. The codes are as below:
    =========================================================================================================================================
    // Servlet Name : saveRecord
    BufferedInputStream instr     = null;
    BufferedOutputStream outstr     = null;
    PostMethod http_post          = null;
    http_post = new PostMethod("getRecord");
    http_client.executeMethod(http_post);
    instr     = new BufferedInputStream(http_post.getResponseBodyAsStream());
    outstr     = new BufferedOutputStream(new FileOutputStream("c:\student.csv"), false));
    int byte_at;
    while (-1 != (byte_at = instr.read())) {
         outstr.write(byte_at);
    =========================================================================================================================================
    // Servlet Name : getRecord
    ServletOutputStream out     = response.getOutputStream();
    StringBuffer str_buf     = new StringBuffer();
    str_buf = generateStudentAc();
    out = response.getOutputStream();
    FileStream(out, response, str_buf);
    // Function Called
    private StringBuffer generateStudentAc() {
         StringBuffer str_buf = new StringBuffer();
         String date = "2000-01-01";
         statement = connection.createStatement();
         resultset = statement.executeQuery("SELECT NAME, ADDRESS FROM STUDENT WHERE DATE>'" + date + "';
         // Write column headers               
    str_buf.append("NAME,ADDRESS");
    String data_row;
    while (resultset.next()) {
              data_row = "\n";
              data_row += "\"" + resultset.getString("STUDENT") + "\"";
              data_row += ",\"" + resultset.getString("ADDRESS") + "\"";
              // Write row
              str_buf.append(data_row);
         return str_buf;
    // Function called
    private void FileStream(ServletOutputStream out, HttpServletResponse response, StringBuffer str_buf) {
         BufferedOutputStream buf_out = null;
    // Create input/output streams
         buf_out     = new BufferedOutputStream(out);
         int length     = str_buf.length();
         // Read/Write
         for (int i = 0; i < length; i++) {
              buf_out.write(str_buf.charAt(i));
    =========================================================================================================================================
    Then, the result will be post back to a JSP page. It didn't work when the records in database growing bigger ( > 100 000 records) but works nice while the records are still in a small quantities ( < 20 000 records). It seems that no record can be inserted into the file and the JSP page becomes blank. When I opened the csv file, I found a message"Error 500:" inside it.
    Hope you all experts can help to figure out this problem. TQ

    I am amatuer in Java Programming, so I don't know how to implement serializable interface but I will look through it.
    However, as I mention before, the code run perfectly if there are not much records un the table. But once there are more and more table added in (> 1000 000 records) in the table, it becomes unstable - sometime it works but most of the time it doesn't. So, I didn't find any different event I replaced the code with String date = "=2000-01-01".
    Anyway, thanks for your help.

  • Problem while wrtting the content to output Stream for export details

    Hi,
    I have to export details from multiple VO. so i put one submit button and write the code to prepare the csv file content and put it in to output stream. The exported csv file contains all the details as expected, but the end of the file we have whole xml content of the file. I could not identify which really make this problem.
    Please give your suggestions....
    Thanks
    Purushoth M

    Hi, Nikhil
    You can USE a Short Cut Key Ctrl + Shift + F9 and than select the type in you want to download in your case you will select Spreadsheet
    Regards,
    Faisal

  • Socket output stream shutdown by peer

    Hi all,
    I'm trying to import ESS component into CMS transport studio development track. All other components are properly imported(EP_BUILDT,SAP_JTECHS,SAP_JEE,SAP_BUILDT).
    The ESS import is getting failed with following error:
    "Fatal Exception:com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]"
    The detailed stack trace is:
    Info:Starting Step Repository-import at 2006-12-06 16:23:56.0049 +5:00
    Info:Component:sap.com/SAP_ESS
    Info:Version  :MAIN_ERP05VAL_C.20060127161543
    Info:1. PR is of type TCSSoftwareComponent
    Fatal Exception:com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]:communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]
    com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Communication error [cause: Socket output stream shutdown by peer.]
         at com.sap.cms.tcs.client.DTRCommunicator.integrateChangelist(DTRCommunicator.java:381)
         at com.sap.cms.tcs.core.RepositoryImportTask.processRepositoryImport(RepositoryImportTask.java:295)
         at com.sap.cms.tcs.core.RepositoryImportTask.process(RepositoryImportTask.java:500)
         at com.sap.cms.tcs.process.ProcessStep.processStep(ProcessStep.java:77)
         at com.sap.cms.tcs.process.ProcessStarter.process(ProcessStarter.java:179)
         at com.sap.cms.tcs.core.TCSManager.importPropagationRequests(TCSManager.java:376)
         at com.sap.cms.pcs.transport.importazione.ImportManager.importazione(ImportManager.java:216)
         at com.sap.cms.pcs.transport.importazione.ImportQueueHandler.execImport(ImportQueueHandler.java:585)
         at com.sap.cms.pcs.transport.importazione.ImportQueueHandler.startImport(ImportQueueHandler.java:101)
         at com.sap.cms.pcs.transport.proxy.CmsTransportProxyBean.startImport(CmsTransportProxyBean.java:583)
         at com.sap.cms.pcs.transport.proxy.CmsTransportProxyBean.startImport(CmsTransportProxyBean.java:559)
         at com.sap.cms.pcs.transport.proxy.LocalCmsTransportProxyLocalObjectImpl0.startImport(LocalCmsTransportProxyLocalObjectImpl0.java:1640)
         at com.sap.cms.ui.wl.Custom1.importQueue(Custom1.java:1169)
         at com.sap.cms.ui.wl.wdp.InternalCustom1.importQueue(InternalCustom1.java:2162)
         at com.sap.cms.ui.wl.Worklist.onActionImportQueue(Worklist.java:880)
         at com.sap.cms.ui.wl.wdp.InternalWorklist.wdInvokeEventHandler(InternalWorklist.java:2338)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:422)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:133)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:344)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:298)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:705)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:659)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:227)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:150)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:56)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:47)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Info:Step Repository-import ended with result 'fatal error' ,stopping execution at 2006-12-06 16:42:07.0027 +5:00
    Any clues on which output stream is getting shut???
    regards,
    avadh

    Hi Pascal,
    yup, There is enough free space available. Java heap size is also adequate(1024).
    I have been through most of the threads on this topic, and have re-checked everything.
    Still, the problem persists.
    Any ideas??
    regards,
    avadh

  • Applet Servlet Comm. Problem

    Dear friends,
    i have an applet that sends a serialized object to the servlet,the Servlet creates another object and passes it back to the applet.
    Everything works fine, till i read the object with:
    ObjectInputStream objInputStream = new ObjectInputStream(in);
            show("got object input stream");
             chart = new ChartPanel((JFreeChart)objInputStream.readObject());At this point, i got nothing back.Instead i get a "null"returned on my Java Console.
    From JBuilder it works fine
    Here is the code
    //This is called from the applet in order to load a chart in a panel
    private JPanel getChartFromServlet(Object[] parameters) throws Throwable {
      ChartPanel chart=null;
      String server;
       try {
    ///////////////////////create URL Connection to SERVLET
        if (this.remoteServerMode) {
          this.show("http://10.30.1.38:8080/AppletToServlet/DbServlet");
           server="http://10.30.1.38:8080/AppletToServlet/DbServlet";
         else {
           server="http://localhost:8083/DbServlet";
         //SEND DATA TO SERVLET
         URLConnection servletCon=this.getServletConnection(server);
         // servletCon.setRequestProperty("Content-Type","application/octet-stream");
          //send the query parameters  using serialization
           ObjectOutputStream out=new ObjectOutputStream(servletCon.getOutputStream());
           out.writeObject( parameters);
           out.flush();
           out.close();
           this.show("Finish with send to servlet");
           //GET DATA FROM SERVLET
           InputStream in=servletCon.getInputStream();
           show("got input stream");
           ObjectInputStream objInputStream = new ObjectInputStream(in);
            show("got object input stream");
             chart = new ChartPanel((JFreeChart)objInputStream.readObject());
             show("got chart");
            objInputStream.close();
            in.close();
            chart.setPreferredSize(new Dimension(734, 370));
       catch (Exception ex) {
         System.err.println("Exception caught");
         this.show(ex.getMessage());
         this.show(ex.getMessage());
         System.err.println(ex.getMessage());
         ex.printStackTrace(System.err);
       throw new Exception( ex.getCause());
    return chart;
    //Servlet Side Code
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws
          ServletException, IOException {
        ObjectInputStream inputStreamFromApplet=null;
        Object[] queryParams;
      JFreeChart chart=null;
        try {
          response.setContentType("application/x-java-serialized-object");
          //////////////////////////READ INPUT//////////////////////////////////////
          InputStream in=request.getInputStream();
          inputStreamFromApplet=new ObjectInputStream(in);
          //Read applet's serialised object passed in Input Stream
          queryParams = (Object[]) inputStreamFromApplet.readObject();
          //do something with serialized object
          chart=getRequestedChart(queryParams);
          //////////////////////////WRITE OUTPUT////////////////////////////////////
          //open an output stream
          ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
          //write to output stream
          out.writeObject(chart);
          out.flush();
          //close output stream
          out.close();
        catch (Exception ex) {
          ex.printStackTrace();
          System.err.println(ex.getMessage());
      }Do you have any ideas?
    Apart from the null value,i saw also some SocketException
    Is there a security issue involved?Both Servlet and Applet come from the same ip.
    Thank you very much in advance,
    Chris

    A Chart constructor takes as an arg a JFreeChart.
    Chart is a JComponent so i cannot serialize it.
    That's why the servlet passes a JFreechart object and
    the applet constructs a chart from it.
    I cast the object to a jfreechart and pass it to the constructor of the chart.
    The strange thing also is that, wghile initially with a non perfectly designed UI,everything worked fine but when i modified the applet's UI ,problems started...
    Something with serialization and versions of classes?

  • Opening Output Stream to a file on the server from Applet

    Hi,
    I am trying to write a little applet which parses a file found on the server , lets the user select some Strings then write the selected Strings to a different file on the server. I use the following code:
    String fileName = new String("LineUp");
    URL docBase = null;
    URLConnection conn = null;
    try {
    docBase = new URL(ApppletName.codeBase, fileName);
    } catch (java.net.MalformedURLException e) {
    System.out.println("Couldn't create image: "
    + "badly specified URL");
    try {
    conn = docBase.openConnection();
    } catch(IOException e) {System.out.println(e);}
    String playerString;
    try {
    conn.setAllowUserInteraction(true);
    conn.setDoOutput(true);
    conn.connect();
    PrintWriter out = new PrintWriter(
    conn.getOutputStream());
    etc..
    The problem I am having is that the getOutputStream routine for the connection object does nothing other than throw an exception (I've stepped through the code and that is all the routine actually does). The connection is actually made but no output stream can be created. I have looked at the Java Tutorial (as I am fairly new to Java) and found a spot where they tell you how to write to a file on the server, which is the example I have followed. Any suggestions? What am I missing?

    Yes, that's what I thought. It talks about writing to a URL, and you have interpreted "URL" as if it meant "file". A URL is a "Uniform Resource Locator", which is a string that identifies a "resource" on the server. Often that corresponds to a file on the server, but not always. It could be a page that is dynamically generated by a script on the server.
    Look again at that page and you will see these words: "At the other end, a cgi-bin script (usually) on the server receives the data, processes it, and then sends you a response, usually in the form of a new HTML page." What that means is, you can't just upload a file to a URL unless you have programmed the server to deal with that upload. That's part of the basic design of the HTTP protocol.
    So, unfortunately, you can't do what you want all that easily. You would have to provide some programming at the server to handle the file upload for you. In Java that means writing a servlet and getting the web server to have that servlet handle all requests to a particular URL. I suspect you don't want to get into that just yet. But if you do, any decent book on Java servlets should have an example of how to upload files like this.

Maybe you are looking for

  • ORDERS05 - Create a Return with reference to a Sales Order

    Hi all, I'm trying to create a return with reference to a sales order via IDOC ORDERS05. I'm indicating referenced Sales Order number into segment E1EDK02; indicating qualifier (QUALFR = 002) and Sales order number (BELNR). By this way, I create a Cu

  • Adobe Flash (Every version) Constantly Crashes...

    Hello I'm new to the forums but hopefully I can ask this question appropriately. I've scoured the net for days now and have read similar threads in this forum looking for an answer and nothing i've done has worked. Both Flash and Shockwave crash ever

  • Osx 10.7.5 timemachine error qnap

    I have a error when timemachine run backup: 28.12.13 10:31:35.924 com.apple.backupd: Error -36 applying backup protections to /Volumes/Backup di Time Machine/Backups.backupdb/iMacxxxxxxxxxxx 28.12.13 10:31:35.924 com.apple.backupd: Error: (5) setxatt

  • Problem with users disabling ARD client service

    I've got a problem and i'm not quite sure of the work around. I'm a PC guy by nature and can't quite figure this out. I'm having a problem with users disabling the ARD service from the sharing menu. Unfortunately users need to have admin privleges to

  • Gr based iv and variance block

    Dear Forum, If gr based iv no flag and over tolerance, if there is difference in quantity or price, the posting will post to price difference. Now my question is will variance cause block when gr based iv not flagged? 1) GR based iv NOT ticked. varia