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()

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

  • 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.

  • 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.
              

  • 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.

  • Error flushing the output stream in Sun One server

    Hi All,
    I was running my servlet code in iPlanet 6.0 version and it was working fine. I upgraded my web server to new Sun One server (Oracle-iPlanet-Web-Server-7.0.9). With the new web server almost 90% of my application works fine, but there is a features in my application to download an Excel sheet by clicking a button. This feature is failing in new Sun One web server.
    Below are my piece of code and the error log I m getting. Can anyone tell me how I can fix this error, I mean is there any web server specific change or configuration parameter need to be set.
    Please ask for any information regarding my server configuration settings if needed for finding a solution for this
    Code:
    byte abyte0[] = new byte[1024];
    BufferedInputStream bufferedinputstream=null;
    BufferedOutputStream bufferedoutputstream=null;
    java.io.InputStream inputstream = httpurlconnection.getInputStream();
    bufferedinputstream = new BufferedInputStream(inputstream);
    bufferedoutputstream = new BufferedOutputStream(httpservletresponse.getOutputStream());
    int j;
    long byteCount=0;
    while((j = bufferedinputstream.read(abyte0, 0, 1024)) != -1)
    byteCount=byteCount+j;
    if(logger != null && logger.traceOn())
    logger.log("total"+byteCount);
    logger.log("Read bytes:"+j);
    bufferedoutputstream.write(abyte0, 0, j);
    if(logger != null && logger.traceOn())
    logger.log("Wrote bytes:"+j);
    bufferedoutputstream.flush(); // <<<<<< ERROR POINT >>>>>>
    Error Log :
    ClientAbortException: java.io.IOException: WEB8004: Error flushing the output stream
    at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:343)
    at org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:313)
    at org.apache.coyote.tomcat5.CoyoteOutputStream.flush(CoyoteOutputStream.java:147)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
    at com.reuters.bdec.as.ASRequestHandler.processResponse(ASRequestHandler.java:285)
    at com.reuters.bdec.as.ASRequestHandler.initiateGetRequest(ASRequestHandler.java:89)
    at com.reuters.bdec.as.ASRequestHandler.proceedToDestination(ASRequestHandler.java:220)
    at com.reuters.bdec.as.ASExtension.authorisationCheck(ASExtension.java:84)
    at com.reuters.bdec.as.ASExtension.doGet(ASExtension.java:114)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:794)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:915)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
    at com.sun.webserver.connector.nsapi.NSAPIProcessor.service(NSAPIProcessor.java:160)
    Caused by: java.io.IOException: WEB8004: Error flushing the output stream
    at com.sun.webserver.connector.nsapi.NSAPIProcessor.action(NSAPIProcessor.java:243)
    at org.apache.coyote.Response.action(Response.java:197)
    at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:339)
    ... 20 more

    Don't flush it yourself. The servlet container will automatically flush for you once its send buffer is full. You can change the size of the send buffer though.

  • Exception writing binary data to the output stream to client -Broken pipe

    Hi,
    I am trying to use the drag & drop feature using Contributor mode of Webcenter sites. Single Image Page Attribute is working properly where as Multiple Image Page Attribute throws the following error:
    [ERROR] [.kernel.Default (self-tuning)'] [logging.cs.satellite.request] Exception writing binary data to the output stream to client 10.191.117.106
    java.net.SocketException: Broken pipe
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:568)
         at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:539)
         at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:427)
         at weblogic.servlet.internal.ChunkOutput$2.checkForFlush(ChunkOutput.java:648)
         at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:333)
         at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:148)
         at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:148)
         at COM.FutureTense.Servlet.ServletRequest$OutputOutputStream.write(ServletRequest.java:80)
         at COM.FutureTense.Servlet.ServletRequest.write(ServletRequest.java:1633)
         at com.openmarket.Satellite.RequestContext.write(RequestContext.java:1123)
         at com.openmarket.Satellite.BytePiece.stream(DataPiece.java:253)
         at com.openmarket.Satellite.CacheObjectImpl.stream(CacheObjectImpl.java:651)
         at com.openmarket.Satellite.Http11Responder.respondForWrapper(Http11Responder.java:142)
         at com.openmarket.Satellite.WrapperAwareResponder.respond(WrapperAwareResponder.java:36)
         at com.openmarket.Satellite.SatelliteServer.execute(SatelliteServer.java:85)
         at com.openmarket.Satellite.servlet.BaseServlet.doGet(BaseServlet.java:118)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.fatwire.wem.sso.cas.filter.CASFilter.doFilter(CASFilter.java:557)
         at com.fatwire.wem.sso.SSOFilter.doFilter(SSOFilter.java:51)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Thanks
    KarthiK

    Thank u very much,
         FileOutputStream opGif = new FileOutputStream(destFile, false);
    I have changed above line with the following line:
         PrintWriter opGif = new PrintWriter ( new FileWriter(destFile, false));
    and now this code is working very fine.
    Thanks once again...

  • IllegalStateException:output stream is already being used for this request

    How to read binary data in JSP. I know, in servlets it can be done and JSP can handle only character data. When i try to open res.getOutputStream(), it is throwing the following exception:"IllegalStateException:output stream is already being used for this request". Is there any workaround in JSP?

    Can you save the file to a location in your server ? Even if you are creating a dynamic image, all you get is a byte array which can be stored in your server. If you can do so, you can set the content type and display the content as mentioned above.

  • Maintain output stream

    I want to maintain a servlet's response output stream (for use by another thread on the server) after the servlet's doGet() method terminates. Is this possible? I find that the response output stream gets closed when the doGet() terminates.

    HI,
       Go to Txn. NACE,  Select "ME-Inventory Management",
    Click on "Output types" button and select WA01 from the otuput type and assign smartfotms and print programs,
    then come back to txn. NACE there click on "Condition records" button Choose WA01maintain the condition for your access sequence
    Hope this may help you.
    Thanks GK.

  • TCSCommunicationException VcmFailure  Socket output stream shutdown by peer

    Hi,
    I am trying to install NWDI 2004s SP 11 and have imported the following SCA
    JTECHS, JEE, BUILDT, but while importing ESS, MSS SCA I am getting the following error:
    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.]
    It is failing in the first step:
    Repository import: ESS import failed.
    Have checked notes mentioned in threads with similar issues, but didnt help my issue.
    Points assured to the right answer
    Regards,
    Anish

    Hi Guys,
    I have installed the sneak preview 04s SR 1  version and still facing issues while Importing ESS SCA, please let me know how to resolve it.
    The defaulttrace.trc says some table / view is missing not able to figure out how to deal with this...
    Processing HTTP request to servlet [DTRServlet] finished with error.
    The error is: javax.servlet.ServletException: The SQL statement "UPDATE "DAV_RESOURCE" SET "RESOURCETYPE" = ?,"MODIFICATIONTIME" = ? WHERE "RESOURCEID" IN (SELECT "VSE1"."VERSIONID" FROM "PVC_ACTVERSVIEW" "VSE1" INNER JOIN "PVC_ACTVERSVIEW" "VSE2" ON "VSE1"."VERSIONID" = "VSE2"."VERSIONID" WHERE "VSE1"."VERSIONSETID" = ? AND "VSE2"."VERSIONSETID" = ?) AND "RESOURCETYPE" <> ?" contains the semantics error[s]: - 1:139 - the table or view >>PVC_ACTVERSVIEW<< does not exist
    CMS Trace says ....
    Exc=com.sap.cms.tcs.interfaces.exceptions.TCSCommunicationException: communication error: VcmFailure received: Internal Server Error [(pre||post)-condition failed: Internal Server Error]
    I tried out many notes .... any help on this would be appreciated ...
    Regards,
    Anish

  • 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

  • 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