Response.getOutputStream returning error

Hi,
I have a graph I'm using jfreechart to make and I'm trying to write it to the response output stream inside a JSP scriptlet. It uses the following method
ChartUtilities.writeChartAsPNG( response.getOutputStream(), chart, width, height );
but this seems to return an error as it says it has already been called for this response. Is there any other means of obtaining the output stream? possible through the 'out' variable for JSP.

Do not write raw Java code in JSP files. There it is not for. Use of scriptlets is discouraged since ages. Use taglibs and EL in JSP only. Write raw Java code in Java classes only.
In this specific case, you're calling the OutputStream in a JSP which on its turn already has called the Writer to write content outside the scriptlets. You cannot call both. Call the one or the other. Also see the API docs of HttpServletResponse: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletResponse.html].
Solution is obvious: just write raw Java code in a Java class. That's where it belongs. A Servlet class is perfectly suitable for this purpose.

Similar Messages

  • Getting java.lang.IllegalStateException error with response.getOutputStream

    Hi,
    I am writer a JSP site for displaying JFreeChart. The main JSP page gets some parameters then the second page out put the chart as binary data with a Java class.
    I've located the part which generated the error, as follows:
    Code:
    OutputStream os = response.getOutputStream(); <--- this line cause the error
    response.setContentType("image/png");
    ChartUtilities.writeChartAsPNG(os, chart, 400, 300);
    (other than it, the JSP does nothing with response or out)
    Error:
    Servlet.service().for servlet jsp threw exception java.lang.IllegalStateException
    at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62)
    at org.apache.jsp.build005f005.seriesChart_jsp.jspService(org.apache.jsp.build_005f005.seriesChart_jsp:110)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWarpper.java:325)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    I've searched this forum and google and seeking for solution for thousands times. But sadly, ways such as adding out.reset(); doesn't work.
    Would any one has some suggestion for me? Your help is very appreciated. Thanks!

    A similar question / answers from jGuru.com
    Question I used getOutputStream() of response object in JSP. Below is the code for download a file in JSP.
    %>
    <%@ page import="java.util.*,
                        java.io.*"
    %>
    <%@ page language="java"
              session="false"
              contentType="text/html; charset=8859_1"
    %>
    <%
         //read the file name.
         File fFile = new File ("D:/Ibs/outdir/batchres.conf");
         String stFileName = "batchres.conf";
         //the content type set as excel
         response.setContentType ("application/excel");
         //the header and also the Nameis set by which user will be prompted to save
         response.setHeader ("Content-Disposition", "attachment;filename=\""+stFileName+"\"");
         //Open an input stream to the file and post the file contents thru the
         //servlet output stream to the client m/c
         InputStream isStream = null;
         ServletOutputStream sosStream = null;
         try
              //response.flushBuffer();
              isStream = new FileInputStream(fFile);
              sosStream = response.getOutputStream();
              int ibit = 256;
              while ((ibit) >= 0)
              ibit = isStream.read();
              sosStream.write(ibit);
         catch (IOException ioeException)
    sosStream.flush();
    sosStream.close();
    isStream.close();
    %>
    If run this code in Tomcat i am getting following error.. �<h1>Error: 500</h1> <h2>Location: /imu/jsp/ibUTLCmnDownloadView.jsp</h2>Internal Servlet Error:
    java.lang.IllegalStateException: getOutputStream() has already been called
         at org.apache.tomcat.facade.HttpServletResponseFacade.getWriter(Unknown Source)
         at org.apache.jasper.runtime.JspWriterImpl.initOut(Unknown Source)
         at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(Unknown Source)
         at jsp.ibUTLCmnDownloadView_12._jspService(ibUTLCmnDownloadView_12.java, Compiled Code)
         at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
         at org.apache.tomcat.core.Handler.invoke(Unknown Source)
         at org.apache.tomcat.core.Handler.service(Unknown Source)
         at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
         at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(Unknown Source)
         at org.apache.tomcat.facade.RequestDispatcherImpl.forward(Unknown Source)
         at JP.co.Hitachi.soft.IBS.Common.Servlet.ibUTLCmnDownloadScrGenServlet.doPost(ibUTLCmnDownloadScrGenServlet.java:75)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
         at org.apache.tomcat.core.Handler.invoke(Unknown Source)
         at org.apache.tomcat.core.Handler.service(Unknown Source)
         at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
         at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
         at org.apache.tomcat.core.ContextManager.service(Unknown Source)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:479)
    Answer
    Don't know if this will help--your code worked as is on my system (J2SDK 1.4.1, Tomcat 4.1.12, Linux)--but you're setting the content-type twice, and to two different values. In the page directive, you specify contentType="text/html; charset=8859_1", and then in the scriptlet, you do a response.setContentType ("application/excel");. Try changing the one in the page directive and deleting the one in the scriptlet. The servlet container may be calling getOutputStream() when it sees the text MIME type so it can prepare the out built-in variable.
    Also, according to the J2EE design patterns, JSP's should only be used to produce text output. Any binary output (such as Excel files) should be produced with servlets--otherwise, the JSP becomes one big scriptlet (like this one).
    If you still want to do this with a JSP, you might want to take out your try ... catch block since you're not doing anything with it. Doing so will allow you to let the servlet container handle the errors (i.e. specify error pages in the web application deployment descriptor). Either that, or at least put the close() and flush()calls in it since they can throw IOExceptions, too. :)
    Finally, you should never close the servlet's output stream. Leave that up to the servlet container.
    Is this item helpful? yes no Previous votes Yes: 2 No: 3
    To transfer file from client to server using jsp programs
    chalpati Rao, Aug 11, 2004 [replies:1]
    How to Download File using JSP program
    Re: To transfer file from client to server using jsp programs
    Saravanan Mani, Aug 24, 2004
    Try restarting the server.It worked for me (ie.you did all the code changes mentioned in the previous reply)
    Breakline problems
    David Machado, Jan 27, 2005 [replies:1]
    Hi! Maybe a problem with breaklines. Try this: ------------------------------------------------------
    %><%@ // don't send breakline here!!!
    page import="java.util.*,
    java.io.*"
    %><%@ // don't send breakline here too!!!
    page language="java"
    session="false"
    contentType="text/html; charset=8859_1"
    %><% // finally, don't send breakline here!!!
    //read the file name.
    File fFile = new File ("D:/Ibs/outdir/batchres.conf");
    String stFileName = "batchres.conf";
    //the content type set as excel
    response.setContentType ("application/excel"); // twice???
    //the header and also the Nameis set by which user will be prompted to save
    response.setHeader ("Content-Disposition", "attachment;filename=\""+stFileName+"\"");
    //Open an input stream to the file and post the file contents thru the
    //servlet output stream to the client m/c
    InputStream isStream = null;
    ServletOutputStream sosStream = null;
    try
    //response.flushBuffer();
    isStream = new FileInputStream(fFile);
    sosStream = response.getOutputStream();
    int ibit = 256;
    while ((ibit) >= 0)
    ibit = isStream.read();
    sosStream.write(ibit);
    catch (IOException ioeException)
    sosStream.flush();
    sosStream.close();
    isStream.close();
    %> // make sure that's no breakline an no spaces at the end!!
    Re: Breakline problems
    Aarthi Sivaram, Apr 19, 2005
    In the above code sosStream = response.getOutputStream(); must be removed. Use 'out' instead of sosStream i.e. out.write(""+ibit); If you look at the Java code generated for your JSP, you can find JspWriter out = null ... .. JspWriter calls response.getOutputStream(), thats why when u call getOutputStream, u get IllegalStateException. 'out' variable is available for direct use in all JSP's, like 'request'. So that can be directly used to write.
    A quick and working workaround
    Leslie Leng, May 20, 2005 [replies:1]
    I am not going to discuss the theory behind, as others gurus mentioned before me, are valid.
    In short, getOutputStream() could not be used more than once, and also it will conflict with JSPWriter's out.
    So, the quick workaround would be, at the end of the JSP page, add the following:
    out.clear();
    out = pageContext.pushBody();
    in example:
    catch(Exception e){
    System.out.print(e);
    out.clear();
    out = pageContext.pushBody();
    %>
    Re: A quick and working workaround
    ajit Pandey, Jul 15, 2005
    Thanks a ton Leslie ,it worked(Production issue) :) credit goes to you....indebted

  • Exchange 2007 Active sync error An HTTP 500 response was returned from Unknown.

    I tested using Microsoft Remote connectivity analyzer tool and getting following error. Please help me to fix the issue
    An ActiveSync session is being attempted with the server.
    Errors were encountered while testing the Exchange ActiveSync session.
    Additional Details
    Elapsed Time: 394 ms.
    Test Steps
    Attempting to send the OPTIONS command to the server.
    Testing of the OPTIONS command failed. For more information, see Additional Details.
    Additional Details
    An HTTP 500 response was returned from Unknown. Headers received: Content-Length: 3745 Cache-Control: private Content-Type: text/html; charset=utf-8 Date: Wed, 05 Mar 2014 18:09:36 GMT Server: Microsoft-IIS/6.0 X-AspNet-Version: 2.0.50727 X-Powered-By:
    ASP.NET HTTP Response Headers: Content-Length: 3745 Cache-Control: private Content-Type: text/html; charset=utf-8 Date: Wed, 05 Mar 2014 18:09:36 GMT Server: Microsoft-IIS/6.0 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET
    Elapsed Time: 394 ms.

    Hi Shadab,
    I have recreated the active sync virtual directory but didnt fix the issue. I have set the logging level for active sync to high and getting below event logs in apps log
    Event Type: Warning
    Event Source: ASP.NET 2.0.50727.0
    Event Category: Web Event 
    Event ID: 1310
    Date: 08/03/2014
    Time: 17:50:29
    User: N/A
    Computer: HP-01
    Description:
    Event code: 3008 
    Event message: A configuration error has occurred. 
    Event time: 08/03/2014 17:50:29 
    Event time (UTC): 08/03/2014 17:50:29 
    Event ID: 5ff3055057084fb49978442a86866e50 
    Event sequence: 15 
    Event occurrence: 14 
    Event detail code: 0 
    Application information: 
        Application domain: /LM/W3SVC/1/ROOT/Microsoft-Server-ActiveSync-1-130384798306406250 
        Trust level: Full 
        Application Virtual Path: /Microsoft-Server-ActiveSync 
        Application Path: C:\Program Files\Microsoft\Exchange Server\ClientAccess\sync\ 
        Machine name: HP-01 
    Process information: 
        Process ID: 1972 
        Process name: w3wp.exe 
        Account name: NT AUTHORITY\SYSTEM 
    Exception information: 
        Exception type: ConfigurationErrorsException 
        Exception message: Could not load file or assembly 'Microsoft.Exchange.Clients.Owa' or one of its dependencies. The system cannot find the file specified. (C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\web.config line 64) (C:\Program
    Files\Microsoft\Exchange Server\ClientAccess\Owa\web.config line 64) 
    Request information: 
        Request URL: https://mail.itech-it.co.uk:443/Microsoft-Server-ActiveSync/default.eas 
        Request path: /Microsoft-Server-ActiveSync/default.eas 
        User host address: 157.56.138.141 
        User:  
        Is authenticated: False 
        Authentication Type:  
        Thread account name: NT AUTHORITY\SYSTEM 
    Thread information: 
        Thread ID: 8 
        Thread account name: NT AUTHORITY\SYSTEM 
        Is impersonating: False 
        Stack trace:    at System.Web.Configuration.HttpModuleAction.get_Entry()
       at System.Web.Configuration.HttpModulesSection.CreateModules()
       at System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers)
       at System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context)
       at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
       at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
    Custom event details: 
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    Thanks!
    Rajeesh

  • File get currupt if downloaded by response.getOutputStream();

    Hi,
    I am trying to download file (of any type pdf/rar/any etc...) using following code,
    but SOME TIME downloaded file is currupted.
                File file = new File(filePath);  
                if (file.exists()) {  
                    if(isDebugEnabled)  
                        log.debug("File Found");  
                String quotes = "\"";    
                attachmentName =  quotes.concat(attachmentName).concat(quotes);  
                response.setContentType("application/unknown");  
                response.setHeader("Pragma", "public");  
                response.setHeader("Cache-Control", "max-age=0");  
                response.addHeader("Content-Disposition", "attachment; filename=" 
                        + attachmentName);  
                fileInputStream = new FileInputStream(file);  
                OutputStream tempStream = response.getOutputStream();  
                if (tempStream instanceof FileOutputStream && tempStream != null) {  
                    destination = ((FileOutputStream) tempStream).getChannel();  
                    source = new FileInputStream(file).getChannel();  
                    destination.transferFrom(source, 0, source.size());  
                } else {  
                    outputStream = tempStream;  
                int bytesRead;  
                while ((bytesRead = fileInputStream.read()) != -1){  
                    outputStream.write(bytesRead);  
    {code}
    but when I use
    {code}
           File f1=new File("MyFile");  
           OutputStream outputStream=new FileOutputStream(f1); 
    {code}
    insted of
    {code}OutputStream tempStream = response.getOutputStream();  {code}   
    It works, & download file by name "MyFile" in bin of tomcat folder.
    but not work with response object.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I did that in finally, here is the whole function code,
    public static boolean downloadAttachment(HttpServletResponse response,
                   String filePath, String attachmentName) throws Exception {
              boolean fileDownloadedStatus = false;
              FileInputStream fileInputStream = null;
              OutputStream outputStream = null;
              FileChannel source = null;
              FileChannel destination = null;
              try {
                   File file = new File(filePath);
                   if (file.exists()) {
                        if(isDebugEnabled)
                             log.debug("File Found");
                   String quotes = "\""; 
                   attachmentName =  quotes.concat(attachmentName).concat(quotes);
                   response.setContentType("application/unknown");
                   response.setHeader("Pragma", "public");
                   response.setHeader("Cache-Control", "max-age=0");
                   response.addHeader("Content-Disposition", "attachment; filename="
                             + attachmentName);
                   fileInputStream = new FileInputStream(file);
                   OutputStream tempStream = response.getOutputStream();
                   if (tempStream instanceof FileOutputStream && tempStream != null) {
                        destination = ((FileOutputStream) tempStream).getChannel();
                        source = new FileInputStream(file).getChannel();
                        destination.transferFrom(source, 0, source.size());
                   } else {
                        outputStream = tempStream;
                   int bytesRead;
                   while ((bytesRead = fileInputStream.read()) != -1){
                        outputStream.write(bytesRead);
                   fileDownloadedStatus = true;
              } catch (FileNotFoundException fileNotFoundException) {
                   log.error("FileNotFoundException");
                   throw fileNotFoundException;
              } catch (Exception exception) {
                   log.error("Exception");
                   throw exception;
              } finally {
                   if (source != null)
                        source.close();
                   if (destination != null)
                        destination.close();
                   if (fileInputStream != null)
                        fileInputStream.close();
                   if (outputStream != null)
                        outputStream.close();
              return fileDownloadedStatus;
         }     {code}
    I also checked with outputstream.flush, but not working.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • HTTP Response code 500 ERROR

    Dear All,
    I am using Tomcat 4 and J2SE 1.4.2 and winXp. I am try to write a simple server/client program using servlet to connect them.
    I am using URLConnection in client side to connect server. However, when i try to get the input/output stream from URLCOnnection object, Error Occur
    java.IO.Exception: server response return code: 500 for URL http://localhost:8080/examples/servlet/CPServlet
    I dunno why it happens, Can you tell the reason or simply tell me the solution.
    Below is my code
    // Client
    import java.net.URL;
    import java.net.URLConnection;
    import java.io.*;
    public class Customer
         ObjectInputStream oin = null;
         ObjectOutputStream oout = null;
         URLConnection conn = null;
         public Customer()
              try
                   URL url = new URL("http://localhost:8080/examples/servlet/CPServlet");
                   conn = url.openConnection();
                   conn.setDoOutput(true);
                   conn.setDoInput(true);
                   conn.setUseCaches(false);
                   conn.setRequestProperty("Content-type","application/x-java-serialized-object");
                   conn.connect();
                   oin = new ObjectInputStream(conn.getInputStream());
                   //oout = new ObjectOutputStream(conn.getOutputStream());
                   System.out.println("Connected");
              catch (Exception e)
                   e.printStackTrace();
                   System.exit(1);
         public static void main(String[] args)
              Customer cust = new Customer();
              try
                   //Message msg = cust.receiveContent();
                   //System.out.println("Received " + msg.getInt());
              catch (Exception e)
                   e.printStackTrace();
                   System.exit(1);
         public Message receiveContent()
              Message msg = (Message)MyUtil.getObjectThrSocket(oin);
              System.out.println("Successfully receive content from Server");
              return msg;
    // Server
    import java.io.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    public class CPServlet extends HttpServlet {
         // field
         ObjectOutputStream oout = null;
         ObjectInputStream oin = null;
         public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
              System.out.println(request.getMethod());
              response.setContentType("application/x-java-serialized-object");
              oout = new ObjectOutputStream(response.getOutputStream());
              oin = new ObjectInputStream(request.getInputStream());
    Thanks

    I'm new to Servlet development, but I'll try to help.
    The error code 500 usually means the servlet is confused, so you will want to focus server side. And in your case, you have created an output stream on your response object before you have created an input stream on your request object. I don't think that is correct. I think the order of those two processes needs to be reversed. Read the request headers first, then construct the response.

  • PI SOAP access to third party Webservice,Return ERROR

    Hi Experts,
    I have one soap synchronous scenario access to third party WEBSERVICE,Return error.While testing the wsdl in soap ui, I am getting response, messages showing successfully processed. I think it is pi to send  xmlns:ns1='http://tempuri.org/'  on both sides should not be a single quotation mark, but I don't know how to adjust  PI set. how do you see.
    1、SOAP UI submitted to Webserver XML
    [2014-05-26 08:47:24.662] --- Recv data from SocketId=272 Socket=10880
    POST /MWGate/wmgw.asmx HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: "http://tempuri.org/MongateCsSpSendSmsNew"
    User-Agent: Jakarta Commons-HttpClient/3.1
    Host: 10.0.0.253:8082
    Content-Length: 520
    <soapen:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
        <soapen:Header />
        <soapen:Body>
            <tem:MongateCsSpSendSmsNew>
                <tem:userId>DOA001</tem:userId>
                <tem:password>dennis</tem:password>
                <tem:pszMobis>1313773654</tem:pszMobis>
                <tem:pszMsg>1111</tem:pszMsg>
                <tem:iMobiCount>1</tem:iMobiCount>
                <tem:pszSubPort>*</tem:pszSubPort>
            </tem:MongateCsSpSendSmsNew>
        </soapen:Body>
    </soapen:Envelope>
    2、PI submitted to Webserver XML
    [2014-05-26 08:36:08.725] --- Recv data from SocketId=271 Socket=10704
    POST /MWGate/wmgw.asmx HTTP/1.0
    Accept: */*
    Host: 10.0.0.253:8082
    User-Agent: SAP-Messaging-com.sap.aii.af.sdk.xi/1.0505
    CallingType: SA
    content-id: <[email protected]>
    Content-Type: text/xml; charset=utf-8
    Content-Length: 417
    SOAPACTION: "http://tempuri.org/MongateCsSpSendSmsNew"
        <SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>
            <SOAP:Header />
            <SOAP:Body>
                <ns1:MongateCsSpSendSmsNew xmlns:ns1='http://tempuri.org/'>
                    <ns1:userId>DOA001</ns1:userId>
                    <ns1:password>dennis</ns1:password>
                    <ns1:pszMobis>13637731567</ns1:pszMobis>
                    <ns1:pszMsg>Constant</ns1:pszMsg>
                    <ns1:iMobiCount>1</ns1:iMobiCount>
                    <ns1:pszSubPort>*</ns1:pszSubPort>
                </ns1:MongateCsSpSendSmsNew>
            </SOAP:Body>
        </SOAP:Envelope>
    3、SXI_MONITOR   Payloads content:
      <ns1:MongateCsSpSendSmsNew xmlns:ns1="http://tempuri.org/">
            <ns1:userId>DOA001</ns1:userId>
            <ns1:password>dennis</ns1:password>
            <ns1:pszMobis>13637731567</ns1:pszMobis>
            <ns1:pszMsg>Constant</ns1:pszMsg>
            <ns1:iMobiCount>1</ns1:iMobiCount>
            <ns1:pszSubPort>*</ns1:pszSubPort>
        </ns1:MongateCsSpSendSmsNew>
    4、PI channel

    Hi Nathan,
    Have you tried the SOAP HTTP Axis function.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b092777b-ee47-2a10-17b3-c5f59380957f?overridelayout=t…
    https://help.sap.com/saphelp_nw04/helpdata/en/45/a39e244b030063e10000000a11466f/content.htm
    Configuring the Receiver Axis SOAP Adapter (SAP Library - SAP Exchange Infrastructure)
    Regards,
    Jannus Botha

  • Please help with SSL POST: Servlet returns Error 500

    I am struggling for many days to get a Java program to log in to an SSL page. The program is supposed to track ADSL usage statistics from https://secure.telkomsa.net/titracker/, but I never seem to get around Server returned Error 500.
    Could anyone please help me understand what I am doing wrong by looking at the method I used. (It seems on the server side it is a jsp servlet that handles authentication).
    Any help is deeply appreciated!
    I copy-paste the method directly from NetBeans:
    CODE>
    void connectHTTPS(String url){
    try {
    URL page = new URL(url); // login page necessary to get a jsp session cookie
    //------------ SET UP SSL - is it right?
    System.setProperty("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    try {
    //if we have the JSSE provider available,
    //and it has not already been
    //set, add it as a new provide to the Security class.
    final Class clsFactory = Class.forName("com.sun.net.ssl.internal.ssl.Provider");
    if( (null != clsFactory) && (null == Security.getProvider("SunJSSE")) )
    Security.addProvider((Provider)clsFactory.newInstance());
    } catch( ClassNotFoundException cfe ) {
    throw new Exception("Unable to load the JSSE SSL stream handler." +
    "Check classpath." + cfe.toString());
    URLConnection urlc = page.openConnection();
    urlc.setDoInput(true);
    *Get the session id cookie set by the TelkomInternet java server
    String cookie = urlc.getHeaderField("Set-Cookie");
    //textpane.setText(totextpane);
    textpane.setText(cookie);
    //---------------- form an auth request and post it with the cookie
    String postdata =URLEncoder.encode("ID_Field","UTF-8")+"="+URLEncoder.encode("myusrname","UTF-8")+"&"+URLEncoder.encode("PW_Field","UTF-8")+"="+URLEncoder.encode("mypwd","UTF-8")+"&"+URLEncoder.encode("confirm","UTF-8")+"="+URLEncoder.encode("false","UTF-8");
    // set the servlet that handles authentication as target
    URL page2 = new URL("https://secure.telkomsa.net/titracker/servlet/LoginServlet");
    // cast to httpConn to enable setRequestMethod()
    HttpURLConnection urlc2 = (HttpURLConnection)page2.openConnection();
    // formulate request with POST data urlc2.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    urlc2.setRequestMethod("POST"); // experimental
    urlc2.setRequestProperty("Content-Length",""+postdata.length());
    urlc2.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)");
    urlc2.setRequestProperty("Accept-Language","en-us");
    urlc2.setUseCaches(false);
    urlc2.setDoOutput(true);
    urlc2.setDoInput(true);
    urlc2.setFollowRedirects(true); // ??
    //send cookies
    urlc2.setRequestProperty("Set-Cookie", cookie); // or "Cookie" - doesn't work either
    //write other data
    PrintWriter out = new PrintWriter(urlc2.getOutputStream());
    out.print(postdata); // username and password here
    out.flush();
    out.close();
    //---------------- get the authenticated page with real ADSL statistics
    BufferedReader br = new BufferedReader(new InputStreamReader(urlc2.getInputStream()));
    String totextpane = "";
    String buffer = "";
    while (buffer != null) {
    try {
    totextpane = totextpane + "\n" + buffer;
    buffer = br.readLine();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    break;
    textpane.setText(totextpane);
    } catch (Exception ex) {
    System.err.println(ex.getMessage());
    ---- END CODE---
    Thank you very much for any attempt at helping with this problem!

    I am struggling for many days to get a Java program to log in to an SSL page. The program is supposed to track ADSL usage statistics from https://secure.telkomsa.net/titracker/, but I never seem to get around Server returned Error 500.
    Could anyone please help me understand what I am doing wrong by looking at the method I used. (It seems on the server side it is a jsp servlet that handles authentication).
    Any help is deeply appreciated!
    I copy-paste the method directly from NetBeans:
    CODE>
    void connectHTTPS(String url){
    try {
    URL page = new URL(url); // login page necessary to get a jsp session cookie
    //------------ SET UP SSL - is it right?
    System.setProperty("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    try {
    //if we have the JSSE provider available,
    //and it has not already been
    //set, add it as a new provide to the Security class.
    final Class clsFactory = Class.forName("com.sun.net.ssl.internal.ssl.Provider");
    if( (null != clsFactory) && (null == Security.getProvider("SunJSSE")) )
    Security.addProvider((Provider)clsFactory.newInstance());
    } catch( ClassNotFoundException cfe ) {
    throw new Exception("Unable to load the JSSE SSL stream handler." +
    "Check classpath." + cfe.toString());
    URLConnection urlc = page.openConnection();
    urlc.setDoInput(true);
    *Get the session id cookie set by the TelkomInternet java server
    String cookie = urlc.getHeaderField("Set-Cookie");
    //textpane.setText(totextpane);
    textpane.setText(cookie);
    //---------------- form an auth request and post it with the cookie
    String postdata =URLEncoder.encode("ID_Field","UTF-8")+"="+URLEncoder.encode("myusrname","UTF-8")+"&"+URLEncoder.encode("PW_Field","UTF-8")+"="+URLEncoder.encode("mypwd","UTF-8")+"&"+URLEncoder.encode("confirm","UTF-8")+"="+URLEncoder.encode("false","UTF-8");
    // set the servlet that handles authentication as target
    URL page2 = new URL("https://secure.telkomsa.net/titracker/servlet/LoginServlet");
    // cast to httpConn to enable setRequestMethod()
    HttpURLConnection urlc2 = (HttpURLConnection)page2.openConnection();
    // formulate request with POST data urlc2.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    urlc2.setRequestMethod("POST"); // experimental
    urlc2.setRequestProperty("Content-Length",""+postdata.length());
    urlc2.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)");
    urlc2.setRequestProperty("Accept-Language","en-us");
    urlc2.setUseCaches(false);
    urlc2.setDoOutput(true);
    urlc2.setDoInput(true);
    urlc2.setFollowRedirects(true); // ??
    //send cookies
    urlc2.setRequestProperty("Set-Cookie", cookie); // or "Cookie" - doesn't work either
    //write other data
    PrintWriter out = new PrintWriter(urlc2.getOutputStream());
    out.print(postdata); // username and password here
    out.flush();
    out.close();
    //---------------- get the authenticated page with real ADSL statistics
    BufferedReader br = new BufferedReader(new InputStreamReader(urlc2.getInputStream()));
    String totextpane = "";
    String buffer = "";
    while (buffer != null) {
    try {
    totextpane = totextpane + "\n" + buffer;
    buffer = br.readLine();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    break;
    textpane.setText(totextpane);
    } catch (Exception ex) {
    System.err.println(ex.getMessage());
    ---- END CODE---
    Thank you very much for any attempt at helping with this problem!

  • SCCM 2012 Deploy --- Error = The software change returned error code 0x87D00324(-2016410844).

    Deployment to the client is successful but the error reported within Clients "SCCM Software Center"  
    The software change returned error code 0x87D00324(-2016410844).
    Also States on "Status" Past Due - Will be Retired"
    Can't figure this one out and I did some googling with no success in finding a solution?
    I am running an Adobe Flash install (.EXE)
    Any help or direction would be greatly appreciated
    RF

    Hi,
    Thank you for your response
    ""Wow6432Node is not valid on x86 systems."""
    Yes, that I am aware of that.....Windows on Windows, for running x86 apps on x64 Windows<o:p></o:p>
    When I first created the detection method I had only created the "WoW" Check
    for Flash value in the reg, which was running against both x86 & x64 Win 7
    systems, and forgot to include the x64 check/, either case, the error appeared
    on the WOW check. Presently I have 2 "Detection Clauses" one for x86
    and the second clause is x64 ( non WOW Path), and still receive the same erorrs
    on both x86 & x64 systems. ( and x64 system have both reg entries since Win 7 has both x86 & x64 versions of IE)
    Looking at the registry of an x64 Win 7 system I find the Adobe Flash registry entry is
    located in both Wow6432Node and also in the x64 sections of the reg.....<o:p></o:p>
    """"Also, why use the default value? I doubt there's anything in there (the default value is the
    value display in a key in regedit with the name of
    "@").""""<o:p></o:p>
    When Default Value is selected the boxes/options below that allow for more detailed
    information to be entered when performing the "reg check"? This is
    where I had been able to enter specific Build/Version to look for, Flash
    11.4.402.265, so that if it does not discover the build # it will proceed with
    the install.....<o:p></o:p>
    I figured having the option to check for Build/Version # would omit SCCM reinstalling on
    systems that have build 11.4.402.265 already?<o:p></o:p>
    From what I understand is that Adobe Flash x64 installs both versions x86 & x64 since Win 7 has both IE
    x86 & IE x64 bit versions by default, and this would explain the Wow6432Node reg
    entries and the true x64 reg entries in both locations when installing.
    Overall, I am thinking I may be heading in the wrong direction in resolving this, as x86 & x64 versions install on the systems, so this tells me it is detecting when / what needs to be installed, the issue seems to be how it reports back after installing......
    Looking further, I view the Content Status Page, and there reporting info in Asset Detail under [Success]  all others { / In Progresss / Error /Unknown } has no info......
    If this helps provide further details.....
    Thanks
    Regards,
    Ron
    RF

  • Shell Script: Timeout and return error if Sqlplus hangs

    Shell Script: Timeout and return error if Sqlplus hangs
    Dear all,
    This morning, our production database hung with lots of ORA-600 and 7445. The issue has been escalated to Oracle Tech support but my monitoring script which tries to make a connection every 5 mins to the database to see if its up, did not alert me. The reason is that, it connected to the database and hung, never came out to report an error and so I never got alerted until a user called me.
    Can any one tell me how I can exit from the sqlplus block if I dont get a response in x seconds? This sqlplus block is being called with in a shell script.
    Any help is highly apprciated.

    I don't know of anything built into any shell scripting language that would do this, no. I'm not a Perl programmer, but I have a vague recollection that Perl may have something useful here.
    From the "separate thread" part of my comment, though, you could certainly spawn a separate thread (thread 2), have thread 2 wait a period of time, then look for a message from thread 1 and throw an error if the message hadn't been sent. I don't know that I'd be for writing multi-threaded shell scripts, though. The heartbeat also gives you a layer of redundancy so that something is monitoring the monitor in case that process stops working.
    Justin

  • Returning Errors from a webservice using XMLBeans

    I have a webservice that accepts XML as input and output parameters, and I'm using XMLBeans to handle this. I'm trying to work out how I can return error information from the webservice, so I created an Exception.xsd schema and 'include' it in the output XML Schema, so an exception xml element is valid in the output schema. The problem is, the XMLBean class generated from the output XML schema has no methods that allow me to create an Exception element. Is there some other way of handling the return of exceptions from webservices using XML?

    The answer is just throw a SoapFaultException and put the exception.xsd XMLBean in the FaultDetail section of the SoapFaultException.

  • How can I get responses to return to a specific email address?

    How do I get all my for responses to return to a specific email address? Does the Acrobat user need to be logged in with this email or is there an option for this?
    Any help would be appreciated!

    Looks to me like the Distribute Forms feature in Acrobat taps into the email address you have specified in Acrobat as your identity; that's where it gets the mailto: address associated with the submit button in the document message bar. 
    Furthermore, if you create a form in LiveCycle the distribute process still seems to tap into Acrobat.  Just for grins you can open the distributed form in LiveCycle (better make and open a copy so you don't break the Reader extended usage rights), go & look in the object palette at the submit address property of your email submit button and it will be blank.  Surprise!  This data has migrated to one or more than one script at the document level.  And if your user then opens your LiveCycle-made form in Reader to complete and return, the submit button in the document bar corresponds to your identity email address in Acrobat.
    So I managed a quick but ugly workaround for an email submitted form by:
    Going into Acrobat:Edit/Preferences/Identity
    changing the email address in my identity to the desired return address
    distributing my form (can do either in LiveCycle or in Acrobat)
    putting my Identity email address back where it was afterwards.
    Good luck with all that.  And if anyone knows a more elegant method, do share!

  • Bug Report - DB toolkit returns error when calling the DefaultDatabase property with SQLite

    There's an old bug in the DB toolkit where calling the DefaultDatabase property returns error -2147217887 if you're using certain DBs (such as SQLite or PostgreSQL and I believe MySQL as well).
    The problem is that this property is called by a VI which is used in some of the commonly used VIs (such as the insert VI),
    causing them to fail. Whoever wrote the code was aware of this issue,
    since they added a comment about it, as you can see below.
    The immediate fix for this is pretty easy -  add code to ignore the error or don't call the property at all. It's not used anywhere in the toolkit and unless you're using the VI yourself to get the property, this won't break any code. The problem with this is that you need to do this in every PC.
    NI already has a CAR for this (CAR 232063) and should hopefully fix it, so there's no need to take further action at the moment. This post is for people searching for this in the future.
    Try to take over the world!

    Interesting. I have seen this before but it returned a different error code. (Error -2147352567)
    =====================
    LabVIEW 2012

  • After upgrading to Lion the bookmarks in Preview returns error message.

    After upgrading to Lion the bookmarks in Preview returns error message : The File "****" couldn't be opened because you don't have permission to view it. To change the perimssion, select the item in finder and Choose File info.  I have bookmarked plenty of files in Preview.  How to overcome this error message???

    Doesn't work Steve. I think it is an issue with Preview being sandboxed (check the sandbox column in Activity Monitor: Preview = Yes). Sandboxed apps restrict file access to those the user has explicitly selected. My theory is that this causes the unfortunate side effect of bookmarked or linked PDFs not working. A simple test: open a file with bookmarks, manually open the bookmarked file and then select the bookmark in the first file - it should open with no complaints about permissions (which leads to a weak workaround: open all the PDFs you intend to work with!).

  • SSRS expression returns #error value in some cells

    Hello,
    What do you think below expression sometimes return #error value in ssrs.
    =SUM(Fields!X.Value / 100 * DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)) /
    IIF( SUM(DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)) = 0
    ,nothing
    ,SUM(DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value))

    Hi,
    Use below expression to overcome the issue:
    =
    IIF( SUM(DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)) = 0
    , 0
    , SUM(   Fields!X.Value / 100 
    * DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)
      SUM(DateDiff(DateInterval.Day,Fields!s_date.Value,Fields!e_date.Value)) 
    Thanks, Madhu
    Hi madhu,
    I have value for Month field as 0. I have used MonthName function in the report. So im getting error as #Error
    Expression:
    MONTHNAME(Fields!Month.Value)& " "& Fields!Day.Value &" "&  Fields!Year.Value
    Please help me to resolve the issue.
    Thanks in Advance..
    Regards,
    LuckyAbdul

  • Package Returning Error ORA-06502: PL/SQL: numeric or value error

    Hi,
    I create a package to export to spread sheet .xls, The package work for simple query if i pass the query to package.
    There is no error in package please create the package and do the following as mentioned below
    create or replace
    PACKAGE export_pkg_spread_sheet
    AS
    procedure download_excel(vsql in clob );
    PROCEDURE excel_header(p_header in out nocopy clob);
    procedure excel_content(p_content in out nocopy clob,
    vsql in clob );
    procedure excel_footer(p_footer in out nocopy clob);
    procedure get_usable_sql (p_sql_in IN clob,
    p_sql_out OUT clob);
    END export_pkg_spread_sheet;
    create or replace
    PACKAGE body export_pkg_spread_sheet
    AS
    PROCEDURE excel_header (p_header IN OUT nocopy CLOB)
    AS
    BEGIN
    p_header := '<html><body>';
    END;
    procedure download_excel( vsql in clob )
    as
    p_header clob;
    p_footer clob;
    p_content clob;
    begin
    owa_util.mime_header( 'application/octet', FALSE );
    htp.p('Content-Disposition: attachment; filename="report.xls"');
    owa_util.http_header_close;
    excel_header( p_header);
    excel_content(p_content,vsql);
    excel_footer(p_footer);
    dbms_output.put_line(p_header ||p_content|| p_footer);
    HTP.PRN( p_header ||p_content|| p_footer);
    htmldb_application.g_unrecoverable_error := true;
    end;
    procedure excel_content(p_content in out nocopy clob,
    vsql in clob)
    as
    p_sql_stmt clob;
    cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
    cols DBMS_SQL.DESC_TAB;
    ncols PLS_INTEGER;
    TYPE varColumn     IS TABLE OF varchar2(32000);
    vtab varColumn;
    v_column_count     NUMBER     DEFAULT 0;
    v_status      INTEGER;
    BEGIN
    htp.prn('am here');
    /* SELECT region_source into p_sql_stmt
    FROM apex_application_page_regions
    WHERE region_id = p_region_id AND
    page_id = p_page_id AND
    application_id = p_app_id; */
    get_usable_sql (vsql,p_sql_stmt);
    p_content := p_sql_stmt;
    -- Parse the query.
    DBMS_SQL.PARSE(cur, p_sql_stmt , DBMS_SQL.NATIVE);
    -- Retrieve column information
    DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols);
    -- Display each of the column names
    p_content := '<table> <tr>';
    FOR colind IN 1 .. ncols
    LOOP
    p_content := p_content || '<td>' || cols(colind).col_name || '</td>';
    END LOOP;
    p_content := p_content || '</tr>';
    vtab := varColumn(null);
    for i in 1..ncols
    loop
    vtab.extend;
    DBMS_SQL.DEFINE_COLUMN (cur, i, vtab(i), 2000);
    --dbms_output.put_line(vtab(i));
    end loop;
    v_status := DBMS_SQL.EXECUTE (cur);
    LOOP
    p_content := p_content || '<tr>';
    EXIT WHEN (DBMS_SQL.FETCH_ROWS (cur) <= 0);
    FOR i IN 1 ..ncols
    loop
    DBMS_SQL.COLUMN_VALUE (cur, i, vtab(i));
    -- p_content := p_content || '<td>' || 'xyz' || '</td>';
    p_content := p_content || '<td>' || vtab(i) || '</td>';
    END LOOP;
    p_content := p_content || '</tr>' ;
    END LOOP;
    p_content := p_content || '<table>' ;
    DBMS_SQL.CLOSE_CURSOR (cur);
    exception
    when others then
         p_content := '<td>Exception Error in printing data</td><table>' ;
    DBMS_SQL.CLOSE_CURSOR (cur);
    end;
    procedure excel_footer( p_footer in out nocopy clob)
    as
    begin
    p_footer := '</body></html>';
    end;
    PROCEDURE get_usable_sql (p_sql_in IN clob, p_sql_out OUT clob)
    IS
    v_sql clob;
    v_names DBMS_SQL.varchar2_table;
    v_pos NUMBER;
    v_length NUMBER;
    v_exit NUMBER;
    BEGIN
    v_sql := p_sql_in;
    v_names := wwv_flow_utilities.get_binds (v_sql);
    FOR i IN 1 .. v_names.COUNT
    LOOP
    <<do_it_again>>
    v_pos := INSTR (LOWER (v_sql), LOWER (v_names (i)));
    v_length := LENGTH (LOWER (v_names (i)));
    v_sql :=
    SUBSTR (v_sql, 1, v_pos - 1)
    || v_names (i)
    || SUBSTR (v_sql, v_pos + v_length);
    v_sql :=
    REPLACE (v_sql,
    UPPER (v_names (i)),
    '(SELECT v('''
    || LTRIM (v_names (i), ':')
    || ''') FROM DUAL)'
    IF INSTR (LOWER (v_sql), LOWER (v_names (i))) > 0
    THEN
    GOTO do_it_again;
    END IF;
    END LOOP;
    p_sql_out := v_sql;
    END;
    END export_pkg_spread_sheet;
    After creating the package pass the parameter to package like this
    begin
    export_pkg_spread_sheet.download_excel('select * from emp');
    end;
    Package will allow to download the spread shreet. If i try to pass the a complex query to package it is returning error as mentioned below
    ORA-06502: PL/SQL: numeric or value error
    In the above package there is a procedure called procedure excel_content which actuall prints the data in the spread sheet this is where the error is coming from there is a variable called vsql have declared it as clob to hold large string but still i am getting the same error when trying to pass a big string.
    Please check the error and let me know.
    Thanks
    Sudhir

    Hi Praveen,
    This is the query i am using to pass
    Declare
    qry clob;
    Begin
    qry := ' 'SELECT
    AR.REGION_CODE,
    AR.DISTRICT_CODE,
    AR.TERRITORY_CODE,
    CASE
    WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NULL AND AR.TERRITORY_NAME IS NULL THEN
    AR.REGION_NAME
    WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NULL THEN
    AR.DISTRICT_NAME
    WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NOT NULL THEN
    AR.TERRITORY_NAME
    END TERR_NAME,
    AR.EMPLOYEE_ID,
    AR.LAST_NAME,
    AR.FIRST_NAME,
    AR.GENDER,
    AR.DATE_OF_HIRE,
    AR.PROJECT_EMPLOYEE_TITLE_ID,
    AR.COMPANY_ID,
    AR.CUSTOMER_EMAIL,
    AR.BUSINESS_EMAIL,
    AR.CUSTOMER_VOICEMAIL,
    AR.CUSTOMER_VOICEMAIL_EXT,
    AR.QUINTILES_VOICEMAIL,
    AR.QUINTILES_VOICEMAIL_EXT , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ZipCode" FROM AR_V_ROSTER AR
    LEFT JOIN AR_V_ADDRESS_HISTORY AAH
    ON
    (AR.PROJECT_ID = AAH.PROJECT_ID AND
    AR.EMPLOYEE_ID = AAH.EMPLOYEE_ID)
    WHERE
    UPPER(AR.USER_EMPLOYEE_ID) = ''Q766730'' AND
    AR.PROJECT_ID = 81 ';
    export_pkg_spread_sheet.download_excel(qry);
    End;
    Praveen you can pass your DB table query to check the error. I am trying to pass as mentioned above.
    Please let me know if my question is not clear.
    Thanks
    Sudhir

Maybe you are looking for