Reliability of Indefinite HTTP response streams

          Hi all,
          As we all know, when the server receives an http request it
          creates a ServletResponse object (or subclass thereof) for use
          by the servlet. This object supplies an output stream for
          sending data back to the client. Now suppose that an an
          indefinite loop is placed at some point within the execution
          path of the service method. If this loop simply writes to the
          output stream, never returning, the client will receive the
          output (consider the client to be a stand alone application or
          applet). Aside from managing the server timeout on the
          connection, are there any reliability issues that can affect
          the integrity of the connection?
          Thanks
          

One of my favorite topics!
          http://www.javaworld.com/jw-03-2000/jw-03-pushlet.html
          Peace,
          Cameron Purdy
          Tangosol, Inc.
          http://www.tangosol.com
          +1.617.623.5782
          WebLogic Consulting Available
          "Troy Ferguson" <[email protected]> wrote in message
          news:[email protected]..
          >
          > Hi all,
          >
          > As we all know, when the server receives an http request it
          > creates a ServletResponse object (or subclass thereof) for use
          > by the servlet. This object supplies an output stream for
          > sending data back to the client. Now suppose that an an
          > indefinite loop is placed at some point within the execution
          > path of the service method. If this loop simply writes to the
          > output stream, never returning, the client will receive the
          > output (consider the client to be a stand alone application or
          > applet). Aside from managing the server timeout on the
          > connection, are there any reliability issues that can affect
          > the integrity of the connection?
          > Thanks
          

Similar Messages

  • Scheduled report failures - Unexpected error getting the HTTP response

    Getting this error when scheduled report executes:
    Unexpected error getting the HTTP response stream while generating report: http://cdmdb1c.nam.nsroot.net:4889/em/console/reports/render

    Hi..
    Thanks for the comment.
    Below is how my web.xml entry looks like.
    The requirement is to send a 404 error response and that will be handled by a servlet which inturn writes the output to the response object.
         <servlet>
              <servlet-name>ErrorPageServlet</servlet-name>
              <servlet-class>com.test.ErrorPageServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>ErrorPageServlet</servlet-name>
              <url-pattern>/error</url-pattern>
         </servlet-mapping>
         <error-page>
              <error-code>404</error-code>
              <location>/error</location>
         </error-page>>>
    the first option to turn off the "show friendly html error pages" works fine.
    It would be better if I can get a different solution

  • Received HTTP response code 500 with acknowledgment

    Hello,
    This is my process : R/3 (Idoc) -> XI -> 3rdParty(CSV).
    I use R/3 4.6C and XI 3.0 SP10
    This work fine but there is a problem with the acknowledgment :
    Transmitting the message to endpoint http://<server>:8000/sap/xi/engine/entry?action=execute using connection AFW failed, due to: Received HTTP response code 500..
    I use this Weblog : /people/saravanakumar.kuppusamy2/blog/2005/01/20/configuration-tips-for-a-business-serviceintegration-process-to-send-back-ale-audit-idoc
    and all I can find in this forum.
    What can I do ?
    Thanks
    Regards
    Message was edited by: Christophe DUMONT

    HTTP 500 is an error caused at the Web Server side. Any http connection happens in 4 steps:
    1) Obtain the IP address from the URL - provied by DNS
    2) Open Ip Socket for that IP
    3) Use this socket to write data
    4) Receive data stream back from the server.
    This data stream which is passed by the server has status codes. If there is a status code 500, this is trapped only at the last level and client is not able to resolve the status.
    You would want to look at the 4 points of faliure mentioned above. And it would help if u get someone on the Web Server side to look at the server logs. These logs are more descriptive and will provide a clue to set things right.
    let us know if u are able to resolve the issue.

  • IOException  :server returned http response code:505 for url url

    hi,
    my program creates IOException server returned http response code:505 for url <some url>
    I close the i/p stream.I dont know ,where is the problem.plz let me know.Thanks in advance.
    Here is the code:
    public class CallApplicationURL
    private static final String className = "[CallApplicationURL] ";
    private MailAlert ma = new MailAlert();
    public String callURL(String purl, RequestObject ro, Debug log)
         URL url = null;
         String URLResponse = "No response from Provider";
         ProxySetter ps = new ProxySetter();
         try
              ps.setProxy(ro, log);
              url = new URL (purl);
         catch (Exception e)
         URLResponse = className+"Exception while URL assignment \n"+purl+"\n, Exception is "+e;
         return (URLResponse);
         try
         HttpURLConnection h = (HttpURLConnection) url.openConnection();
         h.connect();
         BufferedReader br = new BufferedReader( new InputStreamReader( h.getInputStream() ) );
         URLResponse = br.readLine();
         br.close();
         catch (Exception e)
              URLResponse = className+"Exception while calling URL "+purl+", Exception is "+e;
         return (URLResponse);
         return (URLResponse);
    }

    http response 505: http://libraries.ucsd.edu/about/tools/http-response-codes.html
    This would indicate nothing is wrong with your applet but with your http server (not supporting http 1.1??)
    A full trace might help:
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    When you catch the exception you should print the stacktrace: (e.printStackTrace()).

  • Java.io.IOException: Server returned HTTP response code: 500

    Hi,
    I am connecting to a servlet from an applet to send and receive data using the following code.
    try
    URL servletURL = new URL("http://www.progressivecoding.com/servlet/gatesqlang");
                   URLConnection servletConnection = null;
                   URLConnection servletConnection = servletURL.openConnection();
                   servletConnection.setDoOutput(true);
                   servletConnection.setUseCaches(false);
                   PrintStream out = new PrintStream(servletConnection.getOutputStream());
                   out.println("hhd8836gh828dhhskjdhn38847gosf747");
                   out.close();
                   InputStream in = servletConnection.getInputStream();
                   StringBuffer response = new StringBuffer();
                   int chr;
                   while ((chr=in.read())!=-1)
                        response.append((char) chr);
                   in.close();
                   return response.toString();
              catch (IOException e)
              e.printStackTrace();
              tfTxtFile.setText(e.toString());
              return "An error occurred: " + e.toString();
    Everything was working well and fine. All of a sudden without any change of code. It began to return this error to applet
    An error occurred: java.io.IOException: Server returned HTTP response code: 500 for URL: http://www.progressivecoding.com/servlet/gatesqlang
    But I am able to access the same URL from a browser.
    Someone please tell me what could be the problem

    hi, that error got solved, the SessID i was receiving in that code had some leading or trailing white spaces. so SessID = SessID.trim() did the job.
    But i have a question. This program workd fine when i compile and run from my local system. But when i port this on to the oracle server (JAVA_TOP) and access this from a JSP, then the program performs very un-reliably.
    The first data transfer works fine, i get the SessID, when i pass that SessID along with the DTSSessionID to the server, the server says that i doesn't recognise my SessID, and throws a client.Authentication Error.
    So there goes the parsing out of the window for the data in the second iteration.

  • HTTP_RESP_STATUS_CODE_NOT_OK HTTP response contains status code 500 with th

    hello friend,
    I have developed a proxy to JDBC synchronous scenario.
    My scenario works like this.
    i run an abap program which calls a client proxy,
    the proxy fetches the data from database table and returns the data in the ABAP program.
    My program is working fine but there is a small problem.
    when i run the report for the first time, it gives me an exception while calling proxy
    HTTP_RESP_STATUS_CODE_NOT_OK HTTP response contains status code 500 with the description Timeout
    and when i run the report for the second time with same variant it works fine.
    i can see the exception mostly in the morning when i run the report for the first time
    please help me to find the solution of this problem.
    thanks
    kannu.

    1. Increase the proctimeout in smicm as per note - 824554
    2.   Application threads in the J2EE engine might have got consumed in high load situations.
    Increase the count of application threads in config tool at location Config Tool -> cluster-data ->
    <configuration template> -> <instance-ID> -> managers -> ApplicationThreadManager ->
    MaxThreadCount
    3.    Increase the parameter ServletInputStreamTimeout from 180000 to 1728000000.
    Steps for setting this parameter:
    a.   If you have configured ICM to forward requests to the J2EE dispatcher then apply Note
    1048692. If the problem is not resolved, then apply section b.
    b.   The request bytes are reaching the Engine too slowly
    i.    Start the configtool in <J2EE>/configtool directory
    ii.    Browse the tree in the left pane
    cluster-data -> Global server configuration -> services -> http
    iii.    Press the ServletInputStreamTimeout key in the keylist on the right
    iv.    Change the value of the "Value" field at the bottom of the right pane to the
    preferred one (in milliseconds).
    -1 means there is no timeout - that is unless the full request comes into a single
    chunk, an error will be thrown
    180000 means the Engine would wait for 3 minutes for any byte to be entered in
    the stream.
    1728000000 means the Engine would wait for 20 days for any byte to be entered
    in the stream 
    v.    Press the "Set" button in the top-right corner
    vi.    Select from the menu File -> Apply and confirm all popups.
    vii.    Restart the Engine for changes to take effect

  • Servlet with 2 Response Streams

    I want to create a Servlet with 2 response streams. I need to use 1 response Stream to send Continuous Updates received on the server
    and the other response Stream would be used to send Heartbeats to the Client. I tried to create the Servlet but the response I create to send the continuous data just stops sending data to the Client after many attempts. In this attached Servlet, The response for continuous data stopped after 150 refreshes.
    Please let me know how to fix the issue. I tried reset() too but does not seem to work. Will very much appreciate any help.
    package com.XX;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class TestServlet extends HttpServlet{
         private static final long serialVersionUID = 1L;
         public static int count = 0;
         private TestSave testSave = null;
         private HttpServletResponse resp = null;
         public void init(){
              testSave = new TestSave();
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
              count ++;
              if(testSave == null){
                   System.out.println(" test save = null");
                   return;
              if(testSave.getRes()==null){
              System.out.println(" test save resp is null");          
              testSave.setRes(res);
              res.getWriter().println(" Initial Daily count Response ");
              }else{
              res.getWriter().println(" Daily response " + count);
              //res.getWriter().close();
         System.out.println(" test save resp is not null");
              resp = testSave.getRes();
              String data = "Count is "+count;
              System.out.println(" Writing response " + resp);
              System.out.println(" Writing Data " + data);
              System.out.println(" Response committed 1 - " + count + " : " + resp.isCommitted());
              resp.getWriter().println(data);
              System.out.println(" Response committed 2 - " + count + " : " + resp.isCommitted());
              System.out.println(" Daily Response committed ??? " + res.isCommitted());
         protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
              doGet(req,res);          
    }

    The TestSave code.
    import javax.servlet.http.HttpServletResponse;
    public class TestSave {
         HttpServletResponse res;
         public HttpServletResponse getRes() {
              return res;
         public void setRes(HttpServletResponse res) {
              this.res = res;
    }

  • How can a http response be delayed?

    Hi,
    I have a "simple" problem to solve but I am new to J2EE so I hope to find someone who has already faced with this problem.
    I know a servlet can receive an http request from a client and prepare the response. The response will be sent as soon as the servlet returns. The same servlet serves the requests of many users, so if there are 100 users requesting for a servlet I guess the requests are queued and there will be a response outcoming the web-server for each request in the same order.
    Please correct me if I say wrong things.
    Now I would like to write a java code that receives the request but waits for a trigger event to send the response, without blocking other users.
    I mean, a user sends a request, a servlet should forward the request to a thread (what else?) and exit without sending any response. The thread (I thought about a thread for each user) will wait for a trigger event and ONLY if the event happens the response will be sent to the requesting client.
    In the meantime other users can send their requests and receive their response when their trigger events has happened.
    1. Can J2EE technology allow me to do that?
    2. How can I let the thread send the response to the right client?
    3. Http packets do not contain the info about the client, how can I trigger the sending of the response?
    I had a look to pushlet and comet but the problem I have seems to me different from let the server start a communication with a client. In my case the paradigm request-response is kept but the response is delayed. Of course the time-out should be increased (I have read that time out is settable in the client).
    To be more clear I'm adding two examples:
    1. one client (an applet) sends its request, the server receives the http packet and it will start a timer of 5 sec. Only when the timer expires the response will be sent. In the meantime other clients perform their requests and they all will be answered after 5 secs from their request (because there is a timer for each request).
    2. the trigger is the number of requests received: if the server receives 10 requests from 10 clients then all the 10 clients will receive the response. If the server receives less of 10 requests in the time out period there will be issued a time-out error.
    Please could you help me?
    Thanks in advance.

    maxqua72 wrote:
    Hi,
    I have a "simple" problem to solve but I am new to J2EE so I hope to find someone who has already faced with this problem.
    I know a servlet can receive an http request from a client and prepare the response. The response will be sent as soon as the servlet returns. Not exactly. The request is sent with the contents of the output stream are flushed to the client. This may be right away, or it may not be. This usually does happen before the 'servlet returns' but you have control of when that happens.
    The same servlet serves the requests of many users, so if there are 100 users requesting for a servlet I guess the requests are queued and there will be a response outcoming the web-server for each request in the same order.Again, not really true. requests are handled in the order in which they are received, but that does not mean that the first in is the first out. It just means the first in will begin before the second in. The second in could very well finish before the first one.
    Please correct me if I say wrong things.
    Now I would like to write a java code that receives the request but waits for a trigger event to send the response, without blocking other users.
    I mean, a user sends a request, a servlet should forward the request to a thread (what else?) and exit without sending any response. The thread (I thought about a thread for each user) will wait for a trigger event and ONLY if the event happens the response will be sent to the requesting client.
    In the meantime other users can send their requests and receive their response when their trigger events has happened.Each request will have its own thread. There is no need to make your own. You could delay the response as long as you like without making your own thread.
    This assumes you do not implement the 'SingleThreadModel' deprecated interface on your servlet.
    >
    1. Can J2EE technology allow me to do that?
    2. How can I let the thread send the response to the right client?
    3. Http packets do not contain the info about the client, how can I trigger the sending of the response?Yes, JEE can do that. Because each request has its own thread, you can do your delay right in the servlet's service method (doXXX). You would then have the same access to the request/response as always. Alternatively, you could pass the request/response to whatever method/object that will do your work.
    Note that using a new thread for this will actually be a detriment, since that will allow the thread the servlet is called in to return, which will end the request cycle and destroy the response object. So you should do it in the same thread that your request is made in.
    >
    I had a look to pushlet and comet but the problem I have seems to me different from let the server start a communication with a client. In my case the paradigm request-response is kept but the response is delayed.This is actually the same thing as what pushlets do. Pushlets require the user to make an initial request, then the Pushlets hold on to the initial request's thread by never closing the response stream or returning from the service method. It lets Pushlets then continuously send data to the client. Your system would be simpler, you would receive the request, open the response stream, maybe send initial data to client, then delay. When the delay finishes send the rest of the content and close the response stream and let the request die.
    Of course the time-out should be increased (I have read that time out is settable in the client).That is true, but is a nightmare if you expect your client base to be more than a few people whom you know. A better option would be to regularly send small bits of 'keep alive' packets so the client knows the page is still active (which may also help prevent the client from navigating away from your site because it would appear frozen). What you could do is send small bits of javascript that update a specific portion of the page (like a count of current request, or a countdown until activation... whatever seems appropriate). Or just send nonsense javascript that doesn't affect the client at all (but which doesn't break your page either).
    To be more clear I'm adding two examples:
    1. one client (an applet) sends its request, the server receives the http packet and it will start a timer of 5 sec. Only when the timer expires the response will be sent. In the meantime other clients perform their requests and they all will be answered after 5 secs from their request (because there is a timer for each request).No problem. Adding a Thread.sleep(5000) will do this nicely.
    >
    2. the trigger is the number of requests received: if the server receives 10 requests from 10 clients then all the 10 clients will receive the response. If the server receives less of 10 requests in the time out period there will be issued a time-out error.Again, possible, but you would need to device a means of locking and unlocking threads based on client count. Two quickie methods would be to keep a member variable count of current request. Each request would use synchronized blocks to first increment the count, then in a loop, check the count, wait if it is < 10, or end the synchronized block if it is >= 10.
        public void doGet(...) {
            int localCount = 0;
            //Count this request, then recall how many total requests are already made
            synchronized (countLock) {
                this.count++;
                localCount = this.count;
            //Loop until this thread knows there are 10 requests
            while (localCount <10) {
                //wait for a while, and let other threads work
                try { Thread.sleep(100); } catch (InterruptedException ie) { /* don't care */ }
                //get an updated count of requests
                synchronized (countLock) {
                    localcount = this.count;
            } //end while
            //do the rest of the work
            //Remove this request from the count
            synchronized(countLock) {
                this.count--;
        }A second, better approach would use a 'request registrar' which each request adds itself to. The registrar blocks each request on the condition that 10 requests come in, then releases them all. This would use the tools available in java.util.concurrent to work (java 5+). Untested example:
    public class RequestRegistrar {
        private final ReentrantLock requestLock = new ReentrantLock();
        private final Condition requestCountMet = requestLock.newCondition();
        private int count;
        private static final int TARGET_COUNT  = 10;
        private static final RequestRegistrar instance = new RequestRegistrar();
        public static RequestRegistrar getInstance() { return instance; }
        private RequestRegistrar() { }
        public void registerRequest() {
            this.requestLock.lock();
            try {
                this.count++;
                if (this.count < TARGET_COUNT) {
                    while (this.count < TARGET_COUNT) {
                        try {
                            this.requestCountMet.await();
                        } catch (InterruptedException ie) {
                            /* don't care, will just loop back and await again */
                    } //end loop of waiting
                } else { //the target count has been met or exceeded
                    this.count = 0; //reset count
                    this.requestCountMet.signalAll();
            } finally {
                this.requestLock.unlock();
    //Then your requests would all do:
        public void doGet(...) {
            RequestRegistrar.getInstance().registerRequest(); //waits for 10 requests to be registered
            //The rest of your work
        }Undoubtedly there is a lot of work to fix this up, but if you understand Locks and conditions it won't be hard (and if you don't perhaps now is a good time to learn...)
    >
    Please could you help me?
    Thanks in advance.

  • Processing sync http response code XI

    We are receiving a synchronous HTTP response code from the 3rd party using HTTP adapter. The requirement is based on the response code (either 200 or 4xx or 5xx), email or some action needs to be generated, so that the user knows what happened to the Outbound message processing.
    I am not very sure how to trap and process further this HTTP response code. Please note that this is a syn scenario and has been achieved without using BPM.
    Any suggestion is highly appreciated.
    Thank you.
    Anuradha.

    Hello Stephan.
    I have the impression, that the mentioned response code is not the HTTP code, but part of the HTTP message payload. Is this correct?
    -->> The response code is part of the synch response message that we are getting from the 3rd party
    When you send a message with HTTP adapter to external system, any other HTTP code than 2xx will make the XI message fail.
    If I am not correct, could you provide the HTTP stream of the response message here? This will help to understand the issue.
    This is the attached payload: (response sync message)
      <?xml version="1.0" encoding="UTF-8" ?>
      <!DOCTYPE cXML (View Source for full doctype...)>
    - <cXML timestamp="2011-06-2916:08:49-0400" payloadID="50000011930000000220110629200753" version="1.2.011">
    - <Response>
      <Status code="200" text="OK" />
      </Response>
      </cXML>
    Thanks.
    Anuradha.

  • Server returned HTTP response code: 400 for URL

    Hi,
    I am trying to send a POST via https. But I am getting the error:
    java.io.IOException: Server returned HTTP response code: 400 for URL: https://148.91.92.44:443/TPIS-VALEACCENTURE-Incident
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1149)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
         at lerxml.ConectaUrl05.main(ConectaUrl05.java:67)My code:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.URL;
    import java.net.URLConnection;
    import java.net.URLEncoder;
    import javax.net.ssl.HostnameVerifier;
    import javax.net.ssl.HttpsURLConnection;
    import javax.net.ssl.SSLSession;
    public class ConectaUrl05 {
        public ConectaUrl05() {
        public static void main(String[] args) {
            ConectaUrl05 conectaUrl05 = new ConectaUrl05();
            try
                        trustAllHttpsCertificates();
                        HostnameVerifier hv = new HostnameVerifier()
                            public boolean verify(String urlHostName, SSLSession session)
                                System.out.println("Warning: URL Host: " + urlHostName + " vs. "
                                        + session.getPeerHost());
                                return true;
                        HttpsURLConnection.setDefaultHostnameVerifier(hv);
                        URL url = new URL("https://148.91.92.44:443/TPIS-VALEACCENTURE-Incident");
                        URLConnection conn = url.openConnection();
                        HttpsURLConnection urlConn = (HttpsURLConnection) conn;
                        urlConn.setRequestProperty("Content-Type", "text/xml");
                        urlConn.setRequestProperty("Content-transfer-encoding", "UTF-8");
                        urlConn.setRequestProperty("Content-length", "36");
                        urlConn.setRequestMethod("POST");
                        urlConn.setDoOutput(true);
                        urlConn.setDoInput(true);
                        conectaUrl05.debug("URL READY");
                        String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
                        data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
                        OutputStreamWriter wr = new OutputStreamWriter(urlConn.getOutputStream());
                        wr.write(data);
                        wr.flush();
                        // Write to the output stream for server
                        PrintWriter out = new PrintWriter(urlConn.getOutputStream());
                        out.println("<test><from>my test client</from></test>");
                        out.close();
                        BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
                        conectaUrl05.debug("INPUT READY");
                        String str;
                        while( (str=in.readLine()) != null) {
                                System.out.println(str);
                        in.close();
                        conectaUrl05.debug("EVERYTHING IS DONE!!!");
                    catch (Exception e)
                        e.printStackTrace();
        private void debug(String s)
                System.out.println("[DEBUG] -- TestServlet -- \n" + s);
                private static void trustAllHttpsCertificates() throws Exception
                //  Create a trust manager that does not validate certificate chains:
                javax.net.ssl.TrustManager[] trustAllCerts =
                new javax.net.ssl.TrustManager[1];
                javax.net.ssl.TrustManager tm = new miTM();
                trustAllCerts[0] = tm;
                javax.net.ssl.SSLContext sc =
                javax.net.ssl.SSLContext.getInstance("SSL");
                sc.init(null, trustAllCerts, null);
                javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(
                sc.getSocketFactory());
    class miTM implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager{
         public java.security.cert.X509Certificate[] getAcceptedIssuers(){
              return null;
         public boolean isServerTrusted(     java.security.cert.X509Certificate[] certs){
              return true;
         public boolean isClientTrusted(java.security.cert.X509Certificate[] certs){
              return true;
         public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType)
            throws java.security.cert.CertificateException
                        return;
                public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType)
            throws java.security.cert.CertificateException
                        return;
    }Thanks a lot.

    I've created new, empty project. It fails while running on Tomcat. Debugger console message is:
    init:
    deps-module-jar:
    deps-ear-jar:
    deps-jar:
    library-inclusion-in-archive:
    library-inclusion-in-manifest:
    compile:
    compile-jsps:
    do-dist:
    dist:
    debug:
    In-place deployment at C:\Projects\justATesst\build\web
    Server returned HTTP response code: 400 for URL: http://localhost:8084/manager/deploy?config=file:/C:/DOCUME~1/nikita/LOCALS~1/Temp/context63755.xml&path=/justATesst
    C:\Projects\justATesst\nbproject\build-impl.xml:396: Deployment failed.
    build-impl.xml:396 stands for: <nbdeploy debugmode="true" clientUrlPart="${client.urlPart}"/>

  • Internal error while committing HTTP response

    I got this error when I made the stress test to our system (5 users). The error does not Occur when using only 1 user and occurs rarely if concurrent users is set to 20. But with 5 users i got about 200 errors in 10 minutes (Total calls was about 1600).
    Internal error while committing HTTP response
    java.lang.RuntimeException: Internal Server Error, out was null
         at com.evermind.server.http.EvermindHttpServletResponse.commit(EvermindHttpServletResponse.java:271)
         at com.evermind.server.http.EvermindServletOutputStream.flushBuffer(EvermindServletOutputStream.java:80)
         at com.evermind.server.http.EvermindServletOutputStream.flushBuffer(EvermindServletOutputStream.java:56)
         at com.evermind.server.http.EvermindServletOutputStream.flush(EvermindServletOutputStream.java:269)
         at javax.imageio.stream.FileCacheImageOutputStream.flushBefore(FileCacheImageOutputStream.java:212)
         at com.sun.imageio.plugins.png.ChunkStream.finish(PNGImageWriter.java:120)
         at com.sun.imageio.plugins.png.PNGImageWriter.write_IHDR(PNGImageWriter.java:368)
         at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1071)
         at javax.imageio.ImageWriter.write(ImageWriter.java:591)
         at javax.imageio.ImageIO.write(ImageIO.java:1434)
         at javax.imageio.ImageIO.write(ImageIO.java:1508)
         at com.genimap.map.PngFormat.getStream(PngFormat.java:40)
         at com.genimap.test.BPC_Tester.doGet(BPC_Tester.java:81)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    The code looks like this: (bi is BufferedImage 300*300 pixels)
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    MapParams mp=getMapParams(request);
    BufferedImage bi=gm.getMap(mp,null);
    PngFormat.getStream(bi,response.getOutputStream());
    The class PngFormat contains only one method:
    public static void getStream(BufferedImage imageData, OutputStream out) throws IOException
              ImageIO.write(imageData,"png",out);
    And i have not touched the response object before call PngFormat.getStream(bi,response.getOutputStream());
    The users get "Could not get data!". What should i do? This works fine with Bea WebLogic.
    Regards
    Rami

    Just forget to add. The OC4J where I run this is:
    C:\OC4J\j2ee\home>java -Xms256m -Xmx512m -jar oc4j.jar
    04/02/18 15:33:06 Oracle Application Server Containers for J2EE 10g (9.0.4.0.1)

  • Parse http response

    Hi all :)
    I am trying to parse an http response that I get back from a webserver that I sent my request to. The reponse is recieved as an InputStream which I then wrap in a Buffered Reader:
    BufferedReader input = new BufferedReader(new InputStreamReader( urlConn.getInputStream()));
    The content of the InputStream looks is in the following format:
    name1=intValue&name2=strValue&name3=strValue&name4=&name5=strValue
    ...etc
    The content always comes back to me with the same variables in the same order, even if the variables have no value (see name4=&name5 indicates name4 has no value, but the variable is still returned). What I'd like to do is separate the value of name1 and store it in a local variable of the same name. So I have:
    String name1 = ?? //some code to browser input stream for "name1" then retrieve the value after the '=' and before the '&'
    I am not exactly sure how to write this code? I am looking at the API's for InputStream, StreamTokenizer, and BufferedReader, but I am not having that much luck finding out how to do this.
    Any advice or direction is greatly appreciated. Thanks!

    StringTokenizer st = new StringTokenizer(response, "&");
    // creates a tokenizer that uses "&" as the delimiter to break up the response
    while (st.hasMoreTokens()) {
      String parameter = st.nextToken();
      // this should have something like "name1=intValue"
      int break = parameter.indexOf("=");
      // find where the equals sign is in it
      // I leave it to you to use the substring() method to get the 2 bits
    }I just noticed the bit about "store it in a local variable of the same name". Forget about that, variables are created at compile time. You need some kind of a Map where the parameter name is the key and the parameter value is the value.

  • Java Networking - displaying HTTP Request stream

    Hi all,
    I am using java.net.HttpURLConnection object to get a response from a http server. I need to see/display the actual HTTP Request stream (containing POST HTTP/1.1 etc.) being sent to the server. How do I do it?
    Please help.
    Nikhil

    Pete_The_Hat,
    Thanks a lot for advising the packet sniffer. It works pretty well for HTTP requests. However, for HTTPS requests (SSL), the data in the packets (that I can see through the sniffer) is encrypted. How do I collaborate with the Browser (where the encryption/decryption keys are stored) to see the decrypted/unencrypted code?
    It seems too much of work to manually assemble the encrypted data from different packets and then try to decrypt it somehow.
    What's the right approach to see/sniff unencrypted HTTPS Streams? It appears to me to be outside the realm of packet sniffers because data in SSL packets is already encrypted before packets are constructed.
    Networking Gurus please help.

  • What are frist 9 bytes of HTTP Response

    on the server side i m doing some operation and then write a few bytes to the http response output stream if the operation is successful and if operation is unsuccessful i do not write anything. on the client side when i do an HTTP post request to this server side component, in the response i get 9 bytes + data (if the operation on server side was successful ) or just 9 bytes(if the operation was unsucessful). What are these 9 bytes. What does response body contains by default ?

    One of the things that the response header always contains is a 3 digit code indicating the outcome. For example 200 is no errors/html should follow, 404 is file not found, 302 is redirection (I think), etc... I think if you get a 200 code, there should be a content length which indicates the size of the html which will follow. I'm not sure what else would always be in the header. What are the 9 bytes you are seeing?

  • Deploying simple HTML page to WLS 10.3.6 fails with HTTP response code: 502

    - I created a simple HTML page and want to test deployment to WLS 10.3.6 on Linux. I created WAR file and when using JDev 11.1.1.4.0 to deploy to WebLogic Server, it fails to deploy. Full errors/messages are:
    [04:40:56 PM] ---- Deployment started. ----
    [04:40:56 PM] Target platform is (Weblogic 10.3).
    [04:40:59 PM] Retrieving existing application information
    [04:40:59 PM] Running dependency analysis...
    [04:40:59 PM] Building...
    [04:40:59 PM] Deploying profile...
    [04:40:59 PM] Wrote Web Application Module to C:\JDeveloper\mywork\Simpe_HTML\Project1\deploy\SimpleHTML.war
    [04:41:01 PM] Deploying Application...
    [04:41:01 PM] Weblogic Server Exception: weblogic.deploy.api.internal.utils.DeployerHelperException: The source 'C:\DOCUME~1\NGOLDR~1.LAT\LOCALS~1\Temp\SimpleHTML.war' for the application 'SimpleHTML' could not be loaded to the server 'http://dupe:7031/bea_wls_deployment_internal/DeploymentService'.
    Server returned HTTP response code: 502 for URL: http://dupe:7031/bea_wls_deployment_internal/DeploymentService
    [04:41:01 PM] See server logs or server console for more details.
    [04:41:01 PM] weblogic.deploy.api.spi.exceptions.ServerConnectionException: [J2EE Deployment SPI:260041]Unable to upload 'C:\JDeveloper\mywork\Simpe_HTML\Project1\deploy\SimpleHTML.war' to 't3://dupe:7031'
    [04:41:01 PM] #### Deployment incomplete. ####
    [04:41:01 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
    - The Application Server connection is accessible within JDev. 'dupe' is my server name and it's running RH 5.4
    - Any help or suggestions appreciated, although I've already asked Mr. Google without success.
    Thanks in advance,
    Neville

    HTTP response code 502 means temporarily overloaded.
    I would say that we have to check the deployment error on the weblogic server logs located at <Domain_Home>\servers\dupe\logs\dupe.log
    Check for any errors like OutOfMemory etc OR any deployment failures.
    If possible, try accessing the console at http://dupe:7031/console
    Check if you are able to successfully deploy your application using the console.
    From the error it looks like the "dupe" server might not be healthy. So, the log file would really help here to get clues into the root cause.
    Arun

Maybe you are looking for

  • Print Apps. ePrint center App

    Is there a App.for eprinting center? If yes how do you download the app? Thank you for any help you can provide me with.

  • SOME  books will not open in iBooks on my iMac. OS X 10.9.5

    SOME books will not open in iBooks on my iMac.  OS X 10.9.5

  • How can I set focus on TextField?

    Hi, I can't find a method or solution to set focus on TextField,I'd like to set the cursor into a special TextField when user enter my form.how can i implement this functionality? Any suggestion? Hanlin Li. Edited by: noob on Apr 13, 2012 4:28 PM

  • MBP having sleep issues: won't sleep by itself & waking up randomly

    Lately my Macbook Pro's been having a few sleep issues. I set my energy saver settings so that the display should sleep after 10 minutes and the computer should sleep after 20, however what I often come back to after being away from my computer for a

  • Automatically run full screen?

    My Captivate simulation has to be run full screen. Rather than having a page with links where the learner can click, the links must be embedded into a PowerPoint presentation (I know, I know, but that's what they want). My client wants to avoid havin