HttpServletResponse - CharacterEncoding - PDF

I'm trying to write a PDF that containts special (French) characters, but the characters are displayed incorrectly.
response = HttpServletResponse
doc= byte[] that contains my PDF
response.setContentType("application/pdf;charset=UTF-8;");
response.setHeader("Content-Disposition", "filename=document-" + doc.getId() + ".pdf");
response.setCharacterEncoding("UTF-8");
response.getOutputStream().write(doc);
response.flushBuffer();When I try to write � I get some weird useless characters.
I read that response.setCharacterEncoding("UTF-8"); doesn't do anthing if you write to response.getOutputStream()
So I changed that to:
response.setContentType("application/pdf;charset=UTF-8;");
response.setHeader("Content-Disposition", "filename=document-" + doc.getId() + ".pdf");
response.setCharacterEncoding("UTF-8");
Writer goodWriter = new java.io.OutputStreamWriter(response.getOutputStream(), "UTF-8" );
for (int i = 0 ; i <  doc.length ; i++) {
     goodWriter.write(doc);
response.flushBuffer();
However, that also doens't work. I still get the same useless characters. Which I find strange because the following code does display the characters correctly (to HTML, not to PDF)response.setContentType( "text/html;charset=UTF-8" );
response.setHeader("Content-Disposition", "filename=document-" + doc.getId() + ".pdf");
response.setCharacterEncoding("UTF-8");
Writer goodWriter = new java.io.OutputStreamWriter(response.getOutputStream(), "UTF-8" );
for (int i = 0 ; i < doc.length ; i++) {
goodWriter.write("���");
response.flushBuffer();
So the last code block, gives me the desired result: "���".
Anyone can tell me how I can get "���" in my PDF? Am I missing something?
(the last for-loop is useless, I'm just trying to get it to work)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Bart_Blommaerts wrote:
I'm trying to write a PDF that containts special (French) characters, but the characters are displayed incorrectly.Why do you think that this is been caused by HTTP/HTML? You're sending nothing more than a binary stream to the client side. A PDF is a binary file, not a text file. The client side application which is used to view the PDF file must be configured properly.
I read that response.setCharacterEncoding("UTF-8"); doesn't do anthing if you write to response.getOutputStream()You need HttpServletResponse#getWriter() rather than getOutputStream(). Reader and Writer handles character streams. InputStream and OutputStream handles binary streams. But you shouldn't be using a Writer when you want to send binary data.
Anyone can tell me how I can get "���" in my PDF? Am I missing something?Are you generating a PDF on the fly or just streaming it from local disk? If the first, you should be setting the correct charset in the PDF generator API used. If the last, then it is a client side setting.

Similar Messages

  • Crystal Report generate PDF with J2EE problem

    Dear All
    I am having a great problem on generating PDF file by Crystal Report in J2EE.
    I have my J2EE application runs Crystal Report to generate PDF files.
    However for a report, i hit the following error (red color) when the PDF is generating.
    But is no problem for the other reports.
    Here is the code  that i used to generate the PDF
    My OS and Java version as follows
    Window 2003 server.
    Java 1.4.2_04
    Please Kindly Help
    Thanks very much
    public static void export(HttpServletRequest request, HttpServletResponse response, String reportPath, ArrayList paramList, ReportExportFormat outFormat) throws Exception{
         System.gc();
      HttpSession session = request.getSession(false);
      Object reportSource = getReportSource(request, reportPath);
      ReportExportControl exportControl = new ReportExportControl();
      if(paramList != null && paramList.size()>0){
       exportControl.setParameterFields(getParamFields(paramList));
      ExportOptions exportOptions = new ExportOptions();
      exportOptions.setExportFormatType(outFormat);
      PDFExportFormatOptions pdfexpopts = new PDFExportFormatOptions();
      exportOptions.setFormatOptions(pdfexpopts);
      exportControl.setReportSource(reportSource);
      exportControl.setExportOptions(exportOptions);
      exportControl.processHttpRequest(request, response, session.getServletContext(), null);
      exportControl.dispose();
        public static IReportSource getReportSource(HttpServletRequest request, String reportPath) throws Exception{
      ReportClientDocument oReportClientDocument = new ReportClientDocument();
      HttpSession session = request.getSession(false);
      oReportClientDocument.open(reportPath, 0);
      return oReportClientDocument.getReportSource();
    00:57:08,671 ERROR reportdefinition Thread-28 - Report printer was not valid, switching to default printer.
    00:57:08,687 ERROR objectformatter Thread-28 - com.crystaldecisions.reports.dataengine.k: |Y
    00:57:09,343 ERROR b Thread-28 - Disk Exporter: no output file was created by an exporter
    00:57:09,343 ERROR b Thread-28 - PdfExporter: caught Exception in PDFFormatter.finalizeFormatJob (from destination?); java.lang.IllegalArgumentException

    Hi,
    I have tried this code but stil the same.
    However i tried setup another tomcat and application in the other machine and the only job for  the application is exporting the report that has problem, then the error is gone.
    So i guess that is the memory size problem.
    Thanks for this
    One more question about the memory size between Tomcat and Crystal report.
    I have set in catalina.bat as
    set JAVA_OPTS = "-Xms2048M -Xmx1024M"
    and CRConfig as
    <JVMMaxHeap>1024000000</JVMMaxHeap>
    <JVMMinHeap>512000000</JVMMinHeap>
    1. Is that the correct setting.?
    2. The memory in the JAVA_OPT and is the MAX and MIN memory that java would use,
        then is the Max memory in CRConf is 1024M out of the java heap size or the application use another 1024 memory

  • Open PDF file in a new browser window

    I have a PDF file on the harddrive and I call a function from BalusC :
    public static void downloadPDF(FacesContext facesContext, String path, String fileName)
    util.Logger.append("Path = " + path );
    util.Logger.append("file name = " + fileName);
    ExternalContext externalContext = facesContext.getExternalContext();
    HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();
    File file = new File(path, fileName);
    BufferedInputStream input = null;
    BufferedOutputStream output = null;
    try
    //open file
    util.Logger.append("1");
    input = new BufferedInputStream(new FileInputStream(file), 10240);
    //Init servlet response
    util.Logger.append("2");
    response.reset();
    util.Logger.append("3");
    response.setContentType("application/pdf");
    util.Logger.append("4");
    response.setContentLength((int)file.length());
    util.Logger.append("5");
    response.setHeader("Content-disposition", "inline; filename=\"" + fileName + "\"");
    util.Logger.append("6");
    output = new BufferedOutputStream(response.getOutputStream(), 10240);
    util.Logger.append("7");
    //write file contents to response
    byte[] buffer = new byte[10240];
    int length;
    util.Logger.append("8");
    while ((length = input.read(buffer)) > 0)
    output.write(buffer, 0, length);
    util.Logger.append("9");
    //finalize task
    output.flush();
    util.Logger.append("10");
    catch (IOException e)
    util.Logger.append("reporting.Utilities :: downloadPDF :: " + e.getMessage());
    finally
    util.Logger.append("finally");
    close(output);
    close(input);
    //inform JSF that it doesn't need to handle response
    //this is very important, otherwise you will get the following exception in logs:
    //java.lang.IllegalStateException: cannot forward after response has been comitted
    facesContext.responseComplete();
    private static void close(Closeable resource)
    if (resource != null)
    try
    resource.close();
    catch (IOException e)
    e.printStackTrace();
    This works like a charm, but the problem is that the PDF is opened in current window instead of a new one. I checked posts on this problem on this forum but i haven't found any answer to my problem. As you can see i added some 'idiot' logs just to make sure i have no errors. I see them all in my log file and there is absolutely no error. I simply see the PDF in the same window.
    Can anyone help me, please?
    Thank you.
    (Pls tell me if you need any other information)

    My problem is that the parent form has 4 buttons and a grid.
    3 buttons are Add/Edit/Delete for records in the grid. Only the 4th button is the Print report and this is the only one i need to open in another page.
    Even if I create another page and I navigate to it, setting target of newly created page to open a new window will bring me the problem of having 2 windows to close once users wants to close the PDF which is kind of awkward.
    What is your advice?
    Thank you
    Marius

  • Command button remains disabled after a request redirect to a PDF Servlet

    Hi All,
    I've a command button to generate PDF on the fly and used to work in JDev 10.1.3.3.
    When we migrated to 11g, it works for the first time on a page, and the file Open/Save dialog will come up.
    But then the command button remains grayed out, and clicking doesn't generate a server call.
    If I do something on the page which does a partial or full submit, then the button will get enabled again.
    Any suggestions?
    Thanks,
    Jaimon
    Sample code:
    Facelets:
    <af:commandButton text="Create PDF" action="#{fs02.createPDF}" />
    Java:
    public String createPDF() {
    //Validation checks here. If there are any errors, it gets added to FacesMessages to display on the same page.
    if(!validate()) {
    //sf.addInfoMessage('message here..');
    }else {
    FacesContext ctx = FacesContext.getCurrentInstance();
    HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
    HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
    RequestDispatcher rd = request.getRequestDispatcher("/pdfdownloader");
    rd.forward(request, response);
    ctx.responseComplete();
    return null;
    pdfdownloader is mapped as a servlet, which writes the actual PDF content as a stream.

    Herewith the code which is triggered with the post-forms-commit trg. As far as I can see it, there is no code to disable/enable the save button in the menubar.
    ===
    PROCEDURE validate_enbr_records IS
    CURSOR c_enbr
    IS
    SELECT exlb.exlb_length
    , enbr.enbr_ind_break
    FROM dog_envelop_breaks enbr
    , dog_extrnl_labels exlb
    WHERE enbr_appl_cod = :flow_appl_cod
    AND enbr_flow_cod = :flow_cod
    AND enbr_sort_seqnr <> :enbr_sort_seqnr
    AND enbr_appl_cod = exlb_appl_cod
    AND enbr_exlb_cod = exlb_cod;
    CURSOR c_exlb
    IS
    SELECT exlb_length
    FROM dog_extrnl_labels
    WHERE exlb_appl_cod = :flow_appl_cod
    AND exlb_cod = :enbr_exlb_cod;
    l_lengte_break_label NUMBER := 0;
    l_lengte_sort_label NUMBER := 0;
    l_length NUMBER := 0;
    l_aant NUMBER := 0;
    r_enbr c_enbr%ROWTYPE;
    mi_id MenuItem;
    BEGIN
    FOR r_enbr in c_enbr LOOP
    IF r_enbr.enbr_ind_break = 'Y'
    THEN
    l_lengte_break_label := l_lengte_break_label + r_enbr.exlb_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + r_enbr.exlb_length;
    END IF;
    l_aant := l_aant + 1;
    END LOOP;
    OPEN c_exlb;
    FETCH c_exlb INTO l_length;
    CLOSE c_exlb;
    IF :enbr_ind_break = 'Y' THEN
    l_lengte_break_label := l_lengte_break_label + l_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + l_length;
    END IF;
    IF l_lengte_break_label > 48
    THEN
    qms$errors.show_message('DOG-10194');
    END IF;
    IF l_lengte_sort_label > 50
    THEN
    qms$errors.show_message('DOG-10195');
    --set_record_property(3,'enbr',status,changed_status);
    END IF;
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    END;
    ===
    After the message has been throughn and the OK-button has been clicked, the code is never reaching the code:
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    The save-button remains disabled.
    Best regards
    John.

  • Export to PDF not working

    Presses "Export to PDF" Submit Button (custom button) and pdf comes up (Grey) and throws error message
    Adobe reader cannot open RequisiitonDetails.pdf because it is either not a supported file type or the file has been damaged.....
    My Code:
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
    DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
    try {         
    // Get the Data XML File as the XMLNode
    Serializable[] methodparam = {voname};
    //XMLNode xmlnode = (XMLNode)am.invokeMethod("getDataXML",methodparam);
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    OAViewObject vo = (OAViewObject)am.findViewObject(voname);
    XMLNode xmlnode;
    if (vo.isPreparedForExecution())
    xmlnode = (XMLNode)vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);
    xmlnode.print(outputStream);
    System.out.println(outputStream.toString());
    else
    xmlnode = null;
    if (null != xmlnode){
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=RequisitionDetails.pdf";
    response.setHeader("Content-Disposition",contentDisposition);
    response.setContentType("application/pdf");
    xmlnode.print(outputStream);
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    //Generate the Excel Report
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    "XXX",
    "XXXX_ICX_REQ_SRCH_XTRACT",/*template_code,*/
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF,
    null,
    pdfFile);
    // Write the Excel Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    //xlsFile.flush();
    //xlsFile.close();
    else {
    OAException extractErrMsg = new OAException("There is no data to export.",OAException.ERROR);
    pageContext.putDialogMessage(extractErrMsg);
    catch(Exception e) {
    response.setContentType("text/html");
    System.out.println("Error Export Data in pdf");
    throw new OAException(e.getMessage(), OAException.ERROR);
    Error Message
    [050712_052819574][][EXCEPTION] [DEBUG] ------- Preferences defined PreferenceStore -------
    [050712_052819574][][EXCEPTION] [DEBUG] ------- Environment variables stored in EnvironmentStore -------
    [050712_052819574][][EXCEPTION] [DEBUG] [ICX_COOKIE_NAME]:[PCHEBSO1]
    [050712_052819574][][EXCEPTION] [DEBUG] [JDBC:processEscapes]:[true]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_IDLE_THRESHOLD.LOW]:[-1]
    [050712_052819574][][EXCEPTION] [DEBUG] [APPL_SERVER_ID]:[BDF99B587C72A876E040980A985601FB23644546563679454296293043166890]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_STMT_CACHE_SIZE]:[100]
    [050712_052819574][][EXCEPTION] [DEBUG] [NLS_DATE_LANGUAGE]:[AMERICAN]
    [050712_052819574][][EXCEPTION] [DEBUG] [ICX_SESSION_COOKIE_VALUE]:[LxKyqB6fKisXd4VSGypzth6X6c]
    [050712_052819574][][EXCEPTION] [DEBUG] [EMPLOYEE_ID]:[197133]
    [050712_052819574][][EXCEPTION] [DEBUG] [ICX_TRANSACTION_ID]:[-1]
    [050712_052819574][][EXCEPTION] [DEBUG] [NLS_DATE_FORMAT]:[DD-MON-RRRR]
    [050712_052819574][][EXCEPTION] [DEBUG] [RESP_APPL_ID]:[178]
    [050712_052819574][][EXCEPTION] [DEBUG] [LOGIN_ID]:[18817150]
    [050712_052819574][][EXCEPTION] [DEBUG] [DB_PORT]:[5025]
    [050712_052819574][][EXCEPTION] [DEBUG] [USER_ID]:[99136]
    [050712_052819574][][EXCEPTION] [DEBUG] [DISPLAY_LANGUAGE]:[US]
    [050712_052819574][][EXCEPTION] [DEBUG] [APPLICATION_ID]:[xxetfc.oracle.apps.icx.por.reqmgmt.server.ReqMgmtAMEx]
    [050712_052819574][][EXCEPTION] [DEBUG] [NLS_NUMERIC_CHARACTERS]:[.,]
    [050712_052819574][][EXCEPTION] [DEBUG] [NLS_LANGUAGE]:[AMERICAN]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_MIN]:[1]
    [050712_052819574][][EXCEPTION] [DEBUG] [GUEST_USER_PWD]:[GUEST/ORACLE]
    [050712_052819574][][EXCEPTION] [DEBUG] [RESP_ID]:[53865]
    [050712_052819574][][EXCEPTION] [DEBUG] [NLS_SORT]:[BINARY]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_PLSQL_RESET]:[false]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_PROFILE_VALIDATION_ENABLED]:[null]
    [050712_052819574][][EXCEPTION] [DEBUG] [FUNCTION_ID]:[-1]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_DECAY_SIZE]:[5]
    [050712_052819574][][EXCEPTION] [DEBUG] [ICX_PV_SESSION_MODE]:[115P]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_CONTEXT_CHECK]:[true]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_USABLE_CHECK]:[false]
    [050712_052819574][][EXCEPTION] [DEBUG] [NLS_LANG]:[null]
    [050712_052819574][][EXCEPTION] [DEBUG] [APPS_JDBC_URL]:[jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS=(PROTOCOL=tcp)(HOST=sitmisdb1w86m7.etrade.com)(PORT=5025)))(CONNECT_DATA=(SERVICE_NAME=PCHEBSO1)))]
    [050712_052819574][][EXCEPTION] [DEBUG] [MODULE_NAME_TAG]:[icx.por.reqmgmt.server.ReqMgmtAMEx]
    [050712_052819574][][EXCEPTION] [DEBUG] [FNDNAM]:[APPS]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_PROXY_USER]:[null]
    [050712_052819574][][EXCEPTION] [DEBUG] [TWO_TASK]:[PCHEBSO1]
    [050712_052819574][][EXCEPTION] [DEBUG] [APPS_JDBC_DRIVER_TYPE]:[THIN]
    [050712_052819574][][EXCEPTION] [DEBUG] [MODULE_TYPE_TAG]:[fwk]
    [050712_052819574][][EXCEPTION] [DEBUG] [DB_HOST]:[sitmisdb1w86m7.etrade.com]
    [050712_052819574][][EXCEPTION] [DEBUG] [DBC_FILE_PATH]:[C:\jdeveloper\jdevhome\jdev\dbc_files\secure\PCHEBSO1.dbc]
    [050712_052819574][][EXCEPTION] [DEBUG] [APPLICATION_NAME]:[Oracle iProcurement]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_IDLE_THRESHOLD.HIGH]:[-1]
    [050712_052819574][][EXCEPTION] [DEBUG] [SECURITY_GROUP_ID]:[0]
    [050712_052819574][][EXCEPTION] [DEBUG] [LANG_CODE]:[US]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_MAX_JDBC_CONNECTIONS]:[500]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_DECAY_INTERVAL]:[300]
    [050712_052819574][][EXCEPTION] [DEBUG] [USER_NAME]:[ASHARMA2]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_MAX]:[5]
    [050712_052819574][][EXCEPTION] [DEBUG] [DB_NAME]:[null]
    [050712_052819574][][EXCEPTION] [DEBUG] [NLS_CHARACTERSET]:[UTF8]
    [050712_052819574][][EXCEPTION] [DEBUG] [ORG_ID]:[240]
    [050712_052819574][][EXCEPTION] [DEBUG] [DB_ID]:[PCHEBSO1]
    [050712_052819574][][EXCEPTION] [DEBUG] [GWYUID]:[APPLSYSPUB/PUB]
    [050712_052819574][][EXCEPTION] [DEBUG] [NLS_TERRITORY]:[AMERICA]
    [050712_052819574][][EXCEPTION] [DEBUG] [ICX_SESSION_ID]:[213276334]
    [050712_052819574][][EXCEPTION] [DEBUG] [JDBC:oracle.jdbc.maxCachedBufferSize]:[358400]
    [050712_052819574][][EXCEPTION] [DEBUG] ------- Properties stored in Java System Properties -------
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vendor]:[Sun Microsystems Inc.]
    [050712_052819574][][EXCEPTION] [DEBUG] [ajp.connection.listener.state]:[down]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.management.compiler]:[HotSpot Client Compiler]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.j2ee.container.version]:[10.1.3.3.0]
    [050712_052819574][][EXCEPTION] [DEBUG] [os.name]:[Windows XP]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.boot.class.path]:[C:\jdev12_1_3\jdevbin\jdk\jre\lib\rt.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\i18n.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\sunrsasign.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\jsse.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\jce.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\charsets.jar;C:\jdev12_1_3\jdevbin\jdk\jre\classes]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.desktop]:[windows]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vm.specification.vendor]:[Sun Microsystems Inc.]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.runtime.version]:[1.5.0_05-b05]
    [050712_052819574][][EXCEPTION] [DEBUG] [com.oracle.corba.ee.security.trusted.clients]:[*]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.security.jazn.config]:[C:\jdeveloper\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\jazn.xml]
    [050712_052819574][][EXCEPTION] [DEBUG] [user.name]:[asharma2]
    [050712_052819574][][EXCEPTION] [DEBUG] [user.language]:[en]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.naming.factory.initial]:[com.evermind.server.ApplicationInitialContextFactory]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.boot.library.path]:[C:\jdev12_1_3\jdevbin\jdk\jre\bin]
    [050712_052819574][][EXCEPTION] [DEBUG] [oc4j.jms.usePersistenceLockFiles]:[false]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.version]:[1.5.0_05]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.util.logging.manager]:[oracle.classloader.util.ApplicationLogManager]
    [050712_052819574][][EXCEPTION] [DEBUG] [user.timezone]:[America/New_York]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.net.preferIPv4Stack]:[true]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.arch.data.model]:[32]
    [050712_052819574][][EXCEPTION] [DEBUG] [javax.rmi.CORBA.UtilClass]:[com.sun.corba.ee.impl.javax.rmi.CORBA.Util]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.endorsed.dirs]:[C:\jdev12_1_3\jdevbin\jdk\jre\lib\endorsed]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.cpu.isalist]:[]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.jnu.encoding]:[Cp1252]
    [050712_052819574][][EXCEPTION] [DEBUG] [file.encoding.pkg]:[sun.io]
    [050712_052819574][][EXCEPTION] [DEBUG] [DBCFILE]:[C:\jdeveloper\jdevhome\jdev\dbc_files\secure\PCHEBSO1.dbc]
    [050712_052819574][][EXCEPTION] [DEBUG] [file.separator]:[\]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.specification.name]:[Java Platform API Specification]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.class.version]:[49.0]
    [050712_052819574][][EXCEPTION] [DEBUG] [user.country]:[US]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.home]:[C:\jdev12_1_3\jdevbin\jdk\jre]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vm.info]:[mixed mode]
    [050712_052819574][][EXCEPTION] [DEBUG] [os.version]:[5.1]
    [050712_052819574][][EXCEPTION] [DEBUG] [org.omg.CORBA.ORBSingletonClass]:[com.sun.corba.ee.impl.orb.ORBImpl]
    [050712_052819574][][EXCEPTION] [DEBUG] [path.separator]:[;]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vm.version]:[1.5.0_05-b05]
    [050712_052819574][][EXCEPTION] [DEBUG] [user.variant]:[]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.protocol.handler.pkgs]:[oracle.apps.xdo.common.net.protocol|com.evermind.protocol]
    [050712_052819574][][EXCEPTION] [DEBUG] [checkForUpdates]:[adminClientOnly]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.awt.printerjob]:[sun.awt.windows.WPrinterJob]
    [050712_052819574][][EXCEPTION] [DEBUG] [RUN_FROM_JDEV]:[true]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.io.unicode.encoding]:[UnicodeLittle]
    [050712_052819574][][EXCEPTION] [DEBUG] [com.sun.jts.pi.INTEROP_MODE]:[false]
    [050712_052819574][][EXCEPTION] [DEBUG] [awt.toolkit]:[sun.awt.windows.WToolkit]
    [050712_052819574][][EXCEPTION] [DEBUG] [MetaObjectContext]:[oracle.adf.mds.jbo.JBODefManager]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_TOP]:[C:\jdeveloper\jdevhome\jdev\dbc_files\]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.j2ee.http.socket.timeout]:[500]
    [050712_052819574][][EXCEPTION] [DEBUG] [com.oracle.corba.ee.security.ssl.port]:[5656]
    [050712_052819574][][EXCEPTION] [DEBUG] [JRAD_ELEMENT_LIST_PATH]:[C:\jdeveloper\jdevhome\jdev\myhtml\OA_HTML\jrad\]
    [050712_052819574][][EXCEPTION] [DEBUG] [JTFDBCFILE]:[C:\jdeveloper\jdevhome\jdev\dbc_files\secure\PCHEBSO1.dbc]
    [050712_052819574][][EXCEPTION] [DEBUG] [com.sun.CORBA.POA.ORBServerId]:[1000000]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.naming.factory.url.pkgs]:[oracle.oc4j.naming.url]
    [050712_052819574][][EXCEPTION] [DEBUG] [user.home]:[C:\Documents and Settings\asharma2]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.specification.vendor]:[Sun Microsystems Inc.]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.home]:[C:\jdev12_1_3\jdevbin]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.dms.sensors]:[5]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.library.path]:[C:\jdev12_1_3\jdevbin\jdk\bin;.;C:\WINNT\system32;C:\WINNT;C:\DevSuiteHome_10g\jdk\jre\bin\classic;C:\DevSuiteHome_10g\jdk\jre\bin;C:\DevSuiteHome_10g\jdk\jre\bin\client;C:\DevSuiteHome_10g\jlib;C:\DevSuiteHome_10g\bin;C:\DevSuiteHome_10g\jre\1.4.2\bin\client;C:\DevSuiteHome_10g\jre\1.4.2\bin;C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\OraHome_1\bin;C:\Program Files\Java\jre1.5.0_15\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Microsoft Application Virtualization Client;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\OraHome_1;C:\Program Files\QuickTime\QTSystem\]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vendor.url]:[http://java.sun.com/]
    [050712_052819574][][EXCEPTION] [DEBUG] [XDO_TOP]:[etrade/pkgs/linux/intel/oracle/appldev/apps/apps_st/appl/xdo/12.0.0]
    [050712_052819574][][EXCEPTION] [DEBUG] [javax.rmi.CORBA.StubClass]:[com.sun.corba.ee.impl.javax.rmi.CORBA.StubDelegateImpl]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.j2ee.dont.use.memory.archive]:[true]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vm.vendor]:[Sun Microsystems Inc.]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.runtime.name]:[Java(TM) 2 Runtime Environment, Standard Edition]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.class.path]:[C:\jdev12_1_3\jdevbin\jdk\jre\lib\rt.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\jsse.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\jce.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\charsets.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\ext\dnsns.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\ext\localedata.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\ext\sunjce_provider.jar;C:\jdev12_1_3\jdevbin\jdk\jre\lib\ext\sunpkcs11.jar;C:\jdev12_1_3\jdevbin\j2ee\home\oc4j-api.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\oc4j-unsupported-api.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\activation.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\mail.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\persistence.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\ejb30.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\ejb.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\javax77.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\javax88.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\servlet.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\jms.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\jta.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\jacc-api.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\connector.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\jmx_remote_api.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\jax-qname-namespace.jar;C:\jdev12_1_3\jdevbin\webservices\lib\jaxr-api.jar;C:\jdev12_1_3\jdevbin\webservices\lib\jaxrpc-api.jar;C:\jdev12_1_3\jdevbin\webservices\lib\saaj-api.jar;C:\jdev12_1_3\jdevbin\webservices\lib\jws-api.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\oc4j-internal.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\oems-jms-oc4j.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\oems-jms-client.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\oems-jms-server.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\oc4j-schemas.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\ojsp.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\oc4j_orb.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\iiop_support.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\orbbase.jar;C:\jdev12_1_3\jdevbin\j2ee\home\iiop_gen_bin.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\jmxcluster.jar;C:\jdev12_1_3\jdevbin\j2ee\home\jaccprovider.jar;C:\jdev12_1_3\jdevbin\javavm\lib\jasper.zip;C:\jdev12_1_3\jdevbin\j2ee\home\lib\adminclient.jar;C:\jdev12_1_3\jdevbin\opmn\lib\optic.jar;C:\jdev12_1_3\jdevbin\j2ee\home\jacc-spi.jar;C:\jdev12_1_3\jdevbin\j2ee\home\jazncore.jar;C:\jdev12_1_3\jdevbin\j2ee\home\jazn.jar;C:\jdev12_1_3\jdevbin\jlib\ospnego.jar;C:\jdev12_1_3\jdevbin\jlib\ldapjclnt10.jar;C:\jdev12_1_3\jdevbin\webservices\lib\wsserver.jar;C:\jdev12_1_3\jdevbin\webservices\lib\wsif.jar;C:\jdev12_1_3\jdevbin\webservices\lib\orawsmetadata.jar;C:\jdev12_1_3\jdevbin\webservices\lib\orajaxr.jar;C:\jdev12_1_3\jdevbin\jlib\jssl-1_1.jar;C:\jdev12_1_3\jdevbin\jlib\ojmisc.jar;C:\jdev12_1_3\jdevbin\toplink\jlib\toplink-oc4j.jar;C:\jdev12_1_3\jdevbin\diagnostics\lib\ojdl2.jar;C:\jdev12_1_3\jdevbin\xqs\lib\xqs-api.jar;C:\jdev12_1_3\jdevbin\xqs\lib\xds.jar;C:\jdev12_1_3\jdevbin\jdev\lib\jdev-oc4j-embedded.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\pcl.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\ext;C:\jdev12_1_3\jdevbin\lib\dmsapp.jar;C:\jdeveloper\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\applications\admin_ejb.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\bc4jdomorcl.jar;C:\jdev12_1_3\jdevbin\jlib\jsp-el-api.jar;C:\jdev12_1_3\jdevbin\jlib\commons-el.jar;C:\jdev12_1_3\jdevbin\jlib\oracle-el.jar;C:\jdev12_1_3\jdevbin\jlib\jewt4.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\regexp.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\share.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\uix2.jar;C:\jdev12_1_3\jdevbin\oaext\mds\lib\mdsrt.jar;C:\jdev12_1_3\jdevbin\oaext\lib\mdsdt.jar;C:\jdev12_1_3\jdevbin\oaext\lib\oamdsdt.jar;C:\jdev12_1_3\jdevbin\javacache\lib\cache.jar;C:\jdev12_1_3\jdevbin\lib\xschema.jar;C:\jdev12_1_3\jdevbin\BC4J\lib;C:\jdev12_1_3\jdevbin\BC4J\lib\adfbinding.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\adfcm.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\adfm.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\adfmweb.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\adfs-jazn.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\adfs.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\adfshare.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\bc4jct.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\bc4jctejb.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\bc4jimdomains.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\bc4jmt.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\bc4jmtejb.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\bc4jsyscat.jar;C:\jdev12_1_3\jdevbin\BC4J\lib\collections.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\fwkjbo.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\fwk.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\atg.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\collections.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\iasjoc.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\rosettaRt.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\portalFlexComps.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\svc.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\pat.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\concurrent.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\oamMaintMode.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\fwkCabo.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\wsrp-container.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\pdkjava.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\ptlshare.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\xml.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\wsrp-container-types.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\jaxb-impl.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\jaxb-libs.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\jazn.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\jazncore.jar;C:\jdev12_1_3\jdevbin\bibeans\lib\biamlocal.jar;C:\jdev12_1_3\jdevbin\bibeans\lib\bipres.jar;C:\jdev12_1_3\jdevbin\bibeans\lib\bicmn.jar;C:\jdev12_1_3\jdevbin\bibeans\lib\bidatasvr.jar;C:\jdev12_1_3\jdevbin\bibeans\lib\bidataclt.jar;C:\jdev12_1_3\jdevbin\bibeans\lib\bidatacmn.jar;C:\jdev12_1_3\jdevbin\bibeans\lib\biext.jar;C:\jdev12_1_3\jdevbin\bibeans\lib\bicmn-nls.zip;C:\jdev12_1_3\jdevbin\bibeans\lib\bipres-nls.zip;C:\jdev12_1_3\jdevbin\bibeans\lib\bidata-nls.zip;C:\jdev12_1_3\jdevbin\oaext\config\oac\oacfilter.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\scheduler.jar;C:\jdev12_1_3\jdevbin\jdev\lib\jdev-rt.jar;C:\jdev12_1_3\jdevbin\jdev\lib\ojc.jar;C:\jdeveloper\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\connectors\datasources\datasources\datasources.jar;C:\jdev12_1_3\jdevbin\diagnostics\lib\ojdl.jar;C:\jdev12_1_3\jdevbin\lib\dms.jar;C:\jdev12_1_3\jdevbin\jdbc\lib\ojdbc14dms.jar;C:\jdev12_1_3\jdevbin\opmn\lib\ons.jar;C:\jdev12_1_3\jdevbin\jdbc\lib\ocrs12.jar;C:\jdev12_1_3\jdevbin\rdbms\jlib\aqapi.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\ojms-provider.jar;C:\jdev12_1_3\jdevbin\jdbc\lib\orai18n.jar;C:\jdev12_1_3\jdevbin\lib\xmlparserv2.jar;C:\jdev12_1_3\jdevbin\lib\xml.jar;C:\jdev12_1_3\jdevbin\lib\xmlmesg.jar;C:\jdev12_1_3\jdevbin\lib\xsu12.jar;C:\jdev12_1_3\jdevbin\lib\xquery.jar;C:\jdev12_1_3\jdevbin\jlib\osdt_core.jar;C:\jdev12_1_3\jdevbin\jlib\osdt_cert.jar;C:\jdev12_1_3\jdevbin\jlib\osdt_xmlsec.jar;C:\jdev12_1_3\jdevbin\jlib\osdt_wss.jar;C:\jdev12_1_3\jdevbin\jlib\osdt_saml.jar;C:\jdev12_1_3\jdevbin\jlib\ojpse.jar;C:\jdev12_1_3\jdevbin\jlib\oraclepki.jar;C:\jdev12_1_3\jdevbin\toplink\jlib\toplink.jar;C:\jdev12_1_3\jdevbin\toplink\jlib\antlr.jar;C:\jdev12_1_3\jdevbin\toplink\jlib\toplink-essentials.jar;C:\jdev12_1_3\jdevbin\webservices\lib\wsclient.jar;C:\jdev12_1_3\jdevbin\webservices\lib\orasaaj.jar;C:\jdev12_1_3\jdevbin\webservices\lib\xsdlib.jar;C:\jdev12_1_3\jdevbin\webservices\lib\mdds.jar;C:\jdev12_1_3\jdevbin\webservices\lib\relaxngDatatype.jar;C:\jdev12_1_3\jdevbin\webservices\lib\soap.jar;C:\jdev12_1_3\jdevbin\sqlj\lib\runtime12.jar;C:\jdev12_1_3\jdevbin\sqlj\lib\translator.jar;C:\jdev12_1_3\jdevbin\webservices\lib\orawsdl.jar;C:\jdev12_1_3\jdevbin\j2ee\home\applib;C:\jdev12_1_3\jdevbin\j2ee\home\jsp\lib\taglib;C:\jdev12_1_3\jdevbin\j2ee\home\jsp\lib\taglib\ojsputil.jar;C:\jdev12_1_3\jdevbin\lib\dsv2.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\http_client.jar;C:\jdev12_1_3\jdevbin\j2ee\home\lib\jgroups-core.jar;C:\jdeveloper\jdevhome\jdev\myhtml\OA_HTML;C:\jdeveloper\jdevhome\jdev\myclasses;C:\jdev12_1_3\jdevbin\jlib\jdev-cm.jar;C:\jdev12_1_3\jdevbin\BC4J\jlib\bc4jhtml.jar;C:\jdev12_1_3\jdevbin\BC4J\jlib\datatags.jar;C:\jdev12_1_3\jdevbin\BC4J\jlib\bc4juixtags.jar;C:\jdev12_1_3\jdevbin\BC4J\jlib\graphtags.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\wsp.zip;C:\jdev12_1_3\jdevbin\jdev\appslibrt\diagnostics.jar;C:\jdev12_1_3\jdevbin\jdev\appslibrt\svctester.jar]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.j2ee.home]:[C:\jdeveloper\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.application.environment]:[development]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vm.specification.name]:[Java Virtual Machine Specification]
    [050712_052819574][][EXCEPTION] [DEBUG] [JRAD_XML_PATH]:[C:\jdeveloper\jdevhome\jdev\myclasses\JRADXML;C:\jdeveloper\jdevhome\jdev\myprojects;C:\jdev12_1_3\jdevbin\jdev\oamdsxml\fwk]
    [050712_052819574][][EXCEPTION] [DEBUG] [javax.rmi.CORBA.PortableRemoteObjectClass]:[com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject]
    [050712_052819574][][EXCEPTION] [DEBUG] [org.omg.PortableInterceptor.ORBInitializerClass.oracle.oc4j.corba.iiop.server.IIOPInitializer]:[NO_VALUE]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vm.specification.version]:[1.0]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.cpu.endian]:[little]
    [050712_052819574][][EXCEPTION] [DEBUG] [oracle.j2ee.container.name]:[Oracle Containers for J2EE 10g (10.1.3.3.0) ]
    [050712_052819574][][EXCEPTION] [DEBUG] [sun.os.patch.level]:[Service Pack 3]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.io.tmpdir]:[C:\DOCUME~1\asharma2\LOCALS~1\Temp\]
    [050712_052819574][][EXCEPTION] [DEBUG] [com.sun.jts.pi.CLIENT_POLICY_CHECKING]:[false]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vendor.url.bug]:[http://java.sun.com/cgi-bin/bugreport.cgi]
    [050712_052819574][][EXCEPTION] [DEBUG] [com.oracle.corba.ee.security.ssl.mutual.auth.port]:[5657]
    [050712_052819574][][EXCEPTION] [DEBUG] [FND_JDBC_STMT_CACHE_SIZE]:[200]
    [050712_052819574][][EXCEPTION] [DEBUG] [os.arch]:[x86]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.awt.graphicsenv]:[sun.awt.Win32GraphicsEnvironment]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.ext.dirs]:[C:\jdev12_1_3\jdevbin\jdk\jre\lib\ext]
    [050712_052819574][][EXCEPTION] [DEBUG] [user.dir]:[C:\jdeveloper\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config]
    [050712_052819574][][EXCEPTION] [DEBUG] [CACHENODBINIT]:[true]
    [050712_052819574][][EXCEPTION] [DEBUG] [line.separator]:[
    [050712_052819574][][EXCEPTION] [DEBUG] [java.vm.name]:[Java HotSpot(TM) Client VM]
    [050712_052819574][][EXCEPTION] [DEBUG] [com.sun.CORBA.connection.ORBSocketFactoryClass]:[oracle.oc4j.corba.iiop.IIOPSSLSocketFactory]
    [050712_052819574][][EXCEPTION] [DEBUG] [javax.management.builder.initial]:[oracle.oc4j.admin.jmx.server.Oc4jMBeanServerBuilder]
    [050712_052819574][][EXCEPTION] [DEBUG] [com.oracle.corba.ee.security.use.ssl]:[false]
    [050712_052819574][][EXCEPTION] [DEBUG] [org.omg.CORBA.ORBClass]:[com.sun.corba.ee.impl.orb.ORBImpl]
    [050712_052819574][][EXCEPTION] [DEBUG] [file.encoding]:[Cp1252]
    [050712_052819574][][EXCEPTION] [DEBUG] [java.specification.version]:[1.5]
    12/05/07 17:28:20 Error Export Data in pdf

    - RTF Processor Engine PROBLEM IN CREATE XSL FILE
    answered

  • A big problem of Generate report with PDF format....Urgent

    I want to generate a report with pdf format through one java file, it have two page 1)gen_report.jsp 2) report_gen.java , the compliation was failed. However, i don't what the problem is .... i hope anyone can help me as it is very argent for me ....Thanks a lot
    1)gen_report.jsp
    <table  id="AutoNumber1">
       <tr>
         <td background="images/top5movie.png">
         <p align="center"> </p>
        </td>
       </tr>
       <tr>
       <td >
          <div align="center">
            <table id="AutoNumber2" >
                  <form method="GET" action="../report_gen" name="report_gen" target="_blank" onSubmit="javascript:return checkr1(this)">
                    <tr>
                      <td ><b>Report Description:</b></td>
                      <td >This report is to show the top five popular movies in cinemix for a period </td>
                    </tr>
                    <tr>
                      <td><b>Data scope:</b></td>
                      <td >Start from
                      <input type="text" name="start" value="2003-1-1" >to
                      <input type="text" name="end" value="2006-1-1" ></td>
                     </tr>
                     <tr>
                      <td><b>Data processing:</b></td>
                      <td >Show
                        <select name="order_by">
                          <option value="desc" selected>top</option>
                          <option value="asc">bottom</option>
                        </select>
                      5 films</td>
                    </tr>
                    <tr>
                      <td> <p align="center">
                          <input type="submit" value="View_Report" name="subm">
                        </p></td>
                    </tr>
                    <input type="hidden" name="report" value="r1">
                  </form>
                  <form method="GET" action="../report_gen" name="report_gen" target="_blank" onSubmit="javascript:return checkr2(this)">
                    <input type="hidden" name="report" value="r2">
                  </form>
                </table>
         </div>
          </td>
        </tr>
      </table>Then my java code is here
    report_gen.java
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.sql.*;
    // chart and pdf out
    import java.awt.Graphics2D;
    import java.awt.geom.Rectangle2D;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import org.jfree.chart.ChartFactory;
    import org.jfree.chart.JFreeChart;
    import org.jfree.chart.plot.PlotOrientation;
    import org.jfree.data.category.DefaultCategoryDataset;
    import org.jfree.data.xy.*;
    import org.jfree.data.xy.XYBarDataset;
    import org.jfree.data.general.DefaultPieDataset;
    import org.jfree.data.statistics.SimpleHistogramDataset;
    import org.jfree.data.xy.XYSeries;
    import org.jfree.data.xy.XYSeriesCollection;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.Rectangle;
    import com.lowagie.text.pdf.DefaultFontMapper;
    import com.lowagie.text.pdf.PdfContentByte;
    import com.lowagie.text.pdf.PdfTemplate;
    import com.lowagie.text.pdf.PdfWriter;
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    import com.lowagie.text.pdf.PdfPCell;
    public class report_gen extends HttpServlet
       private final String titles[] = {"Top Five popular movies ",
                        "Financial cirumstance of cinemas",
                        "Distribution of time segment",
                        "Distribution of favourite movie type"
       private final String descs[] = {"This report is to show the top five  popular movies in cinemix for a period ",
                   "This report is to show the financial circumstance of each cinema site ",
                   "This report is to analysis the customer when is the most visit time ",
                   "This report is to analysis the customer which type of movie do they watch the most"
        private final String bigTitle = "Cinemix";
        private final String driver = "org.gjt.mm.mysql.Driver";
        private final String url= "jdbc:mysql://localhost:3306/cinemix";
        private final String userID = "abc";
        private final String passwd = "abc";     
        public void init(ServletConfig config) throws ServletException
          super.init(config);
       protected void doGet(HttpServletRequest request, HttpServletResponse response)
       throws ServletException, IOException
          final int width = 550;
         final int height = 200;
    / title font (centre and report title)
         final Font fTitle0 = FontFactory.getFont("Helvetica", 42, Font.BOLD);
         final Font fTitle1 = FontFactory.getFont("Helvetica", 30, Font.BOLD);
              // centre name:
        final String title0 = bigTitle;
       // Default category for DefaultCategoryDataset
       final String cat = "data";
       Connection conn;
      JFreeChart chart;
       String title1     = "xyz Report";
       String chartDesc = "description";
       String notes[] = new String[4];
       String chartTitle = "so bad this is title";
       String chartXTitle = "this is x";
       String chartYTitle = "this is y.";
       String report = request.getParameter("report");     
       int max=-10000;
       int min=10000;
       int j=0;          
      // do some basic checking
       if (report == null || report.equals(""))
         report = "-1";  // this course unknow report error message
         String start   = request.getParameter("start");
         String end  = request.getParameter("end");
         String order_by  = request.getParameter("order_by");  // ToDo: check invalid string
           int topN  = 5;
        String order = (order_by.equals("desc")) ? "Top" : "Last";
       String inv[] = {"08:30", "09:30", "10:30", "11:30", "12:30", "11:30", "12:30", "13:30", "14:30", "15:30", "16:30", "17:30","18:30","19:30","20:30","21:30","22:30","23:30"};
         int inv_val[] = new int[inv.length - 1];
         try
            Class.forName(driver).newInstance();
             catch(Exception e)
            printE("Cannot load mysql database driver!", response);
              e.printStackTrace();
               return;
           try
                 conn = DriverManager.getConnection(url, userID, passwd);
                  if (report.equals("r1")) {  // report 1
               DefaultCategoryDataset dataset = new DefaultCategoryDataset();
              Statement stmt = conn.createStatement();
              String sql = "select *,count(f.Name),f.Name from film f, filmDetail fd, ticket t where f.startDate > '" + start + "' and f.endDate <  '" + end + "'and fd.filmID = f.filmID and fd.filmDetailID = t.filmDetailID group by f.name order by fd.filmDetailID asc limit '" +topN+"'";
              ResultSet rs = stmt.executeQuery(sql);
            while (rs.next())
           if (rs.getInt("fd.filmDetailID") > max) max = rs.getInt("fd.filmDetailID");
         if (rs.getInt("fd.filmDetailID") < min) min = rs.getInt("fd.filmDetailID");
          j++;
           ataset.setValue(rs.getInt("fd.filmDetailID"), cat,rs.getString("f.Name"));
           title1     = titles[0];
         chartDesc  = descs[0];
         chartTitle = order + " " + topN + " popular movie";
          chartYTitle = "Box Office record";
          chartXTitle = "Film Name";
          gender = " ";
          chart = ChartFactory.createBarChart(chartTitle, chartXTitle,   chartYTitle, dataset,PlotOrientation.VERTICAL, false, true, false);
        else
              print("Error: I don't inderstand your request!", response);
         return;
           catch (SQLException e)
         printE("Cannot open database connection? <br>", response);
         // printE(e.toString);
      e.printStackTrace();
      return;
         response.setContentType("application/pdf");
         Document document = new Document(PageSize.A4, 5, 5, 5, 5);
        try
             PdfWriter writer;
         writer = PdfWriter.getInstance(document, response.getOutputStream());
        HeaderFooter footer = new HeaderFooter(new Phrase("Page: "), true);
         footer.setBorder(Rectangle.NO_BORDER);
    document.setFooter(footer);
                   footer.setAlignment(Element.ALIGN_CENTER);
                   // step 3
                   document.open();
                   document.add(getHeader(title0, title1, start, end, gender, order, topN, chartDesc));
                   document.add(printChart(chart, writer));
                   document.add(getFooter(notes));
              catch(DocumentException de)
                   de.printStackTrace();
              // step 5
              document.close();
              return;
         }// end doGet()
         /** Handles the HTTP <code>POST</code> method.
          * @param request servlet request
          * @param response servlet response
         protected void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException
              // processRequest(request, response);
         /** Returns a short description of the servlet.
         public String getServletInfo()
              return "Generate reports for " + bigTitle;
         /* To print en error and exit(?) */
         private void printE(Object obj, HttpServletResponse response) throws IOException
              response.setContentType("text/html");
              PrintWriter out;
              out = response.getWriter();
              out.print(obj.toString());
              out.close();
              // To-Do: how to force exiting?
         // create data chart
         private PdfPTable getHeader(String title0, String title1, String start, String end, String sex, String order, int topN, String desc)
              Font fTitle0 = FontFactory.getFont("Helvetica", 42, Font.BOLD);
              Font fTitle1 = FontFactory.getFont("Helvetica", 24, Font.BOLD);
              Font fTitle3 = FontFactory.getFont("Helvetica", 12, Font.BOLD);
              Font fValue = FontFactory.getFont("Helvetica", 12, Font.UNDERLINE);
              Paragraph parStartEnd = new Paragraph();
              parStartEnd.add(new Phrase("Data start from:                  ", fTitle3));
              parStartEnd.add(new Phrase(start, fValue));
              parStartEnd.add(new Phrase("     to     ", fTitle3));
              parStartEnd.add(new Phrase(end, fValue));
              Paragraph parGenerateDate = new Paragraph();
              parGenerateDate.add(new Phrase("Report generated at:         ", fTitle3));
              parGenerateDate.add(new Phrase(new java.util.Date().toString(), fValue));
              Paragraph parGender = new Paragraph();
              parGender.add(new Phrase("Current show gender:       ", fTitle3));
              parGender.add(new Phrase(sex, fValue));
              Paragraph parTopN = new Paragraph();
              parTopN.add(new Phrase("Now is showing                 ", fTitle3));
              parTopN.add(new Phrase(order, fValue));
              parTopN.add(new Phrase("  ", fValue));
              parTopN.add(new Phrase(new Integer(topN).toString(), fValue));
              parTopN.add(new Phrase("   record(s)", fTitle3));
              // Start main table
              PdfPTable tblMain = new PdfPTable(1);
              tblMain.getDefaultCell().setBorder(0);
              // Print title
              tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
              tblMain.addCell(new Paragraph(title0, fTitle0));
              tblMain.addCell(new Paragraph(title1, fTitle1));
              tblMain.addCell("");
              tblMain.addCell("");
              tblMain.addCell("");
              // Print headers data
              //tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
              //tblMain.addCell(parInvoiceNum);
              //tblMain.addCell("");
              tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
              tblMain.addCell(parStartEnd);
              tblMain.addCell("");
              tblMain.addCell(parGenerateDate);
              tblMain.addCell("");
              if (sex != " ")
                   tblMain.addCell(parGender);
              else if(order != null && topN > 0)
                   tblMain.addCell(parTopN);
              else
                   tblMain.addCell(" \n");
              tblMain.addCell("");
              tblMain.setWidthPercentage(96);
              tblMain.addCell(new Paragraph("Description of this report:", fTitle3));
              tblMain.addCell(desc);
              tblMain.addCell("\n");
              // Finish main table
              return tblMain;
         // print a chart _directly_ to pdf and return a empty Pdftable...
         public PdfPTable printChart(JFreeChart chart, PdfWriter writer)
              PdfContentByte cb = writer.getDirectContent();
              int width = 550;
              int height = 450;
              PdfTemplate tp = cb.createTemplate(width, height);
              Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());
              Rectangle2D r2d = new Rectangle2D.Double(0, 0, width, height); //->,
              chart.draw(g2d, r2d);
              g2d.dispose();
              cb.addTemplate(tp, 20, 170);
              // quick method to push down the footer text
              // the only things this method return
              PdfPTable tblDownDown = new PdfPTable(1);
              tblDownDown.getDefaultCell().setBorder(0);
              tblDownDown.addCell(" \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n");
              tblDownDown.addCell(" \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n");
              tblDownDown.addCell(" \n \n \n \n \n \n");
              return tblDownDown;
         public PdfPTable getFooter(String notes[])
              Font fNote = FontFactory.getFont("Helvetica", 14, Font.UNDERLINE);
              Font fComment = FontFactory.getFont("Helvetica", 12, Font.ITALIC);
              Font fTitle1 = FontFactory.getFont("Helvetica", 30, Font.ITALIC);
              // Start footer table
              PdfPTable tblFooter = new PdfPTable(1);
              tblFooter.getDefaultCell().setBorder(0);
              if (notes != null)
                   tblFooter.addCell(new Paragraph("Notes:", fNote));
                   tblFooter.addCell("");
                   tblFooter.addCell("");
                   tblFooter.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
                   for (int i=0;i<notes.length;i++)
                        if (notes[i] != null)
                             tblFooter.addCell(new Paragraph("" + (i+1) + ". " + notes[i] + "", fComment));
                             tblFooter.addCell("");
                             tblFooter.addCell("");
                        tblFooter.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
                        tblFooter.addCell(new Paragraph("- End of report -", fComment));
                        return tblFooter;
    }

    Go to the cache directory and see if you can open the report directly from here (not in IE).
    I have seen posts on problems with Acrobat Reader Plugin for IE (I believe it was version 6 of Reader).

  • PDF report to display on new window

    Hi,
    I am working on JSF and jasper reports. I have the following requirement, When I click the h:command button I should get the report in a new window based on the parameters selected in the h:form. I am currently getting in the same window. Help is greatly appreciated.
    following is the action method code in the bean
    connection = DBConnect.getDBConnection();
                /* PDF report */
                String              jasperFileName = "";
                jasperFileName = "C:\\report8.jasper";
                // jasperFileName = FacesUtils.getRequest().getContextPath();
                // jasperFileName += "/jasper/ApplicantBiographic.jasper";
                Map<String, Object> parameterMap   = new HashMap<String, Object>();
                /* data input */
                File file = new File(jasperFileName);
                reportInputStream = new FileInputStream(file);
                //FacesContext fc;
                /* write to file */
                request  = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
                String selectedParam = request.getParameter("rpt1:selectParam");
                System.out.println("Param value"+selectedParam);
                response            = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
                servletOutputStream = response.getOutputStream();
                String     spParms   = "4";
                 parameterMap.put("prgmId_sel", spParms);
                /* load input parameters */
                //BigDecimal aacomasId = new BigDecimal("10014122008");
                //Integer    applYear  = new Integer(2008);
                // String     spParms   = aacomasId + ", " + applYear;
                //parameterMap.put("SP_PARMS", spParms);
                log.info("file: " + file);          
                log.info(parameterMap);
                /* call jasper method to run report. */
                JasperRunManager.runReportToPdfStream(reportInputStream,
                                                      servletOutputStream, parameterMap, connection);
                FacesContext.getCurrentInstance().responseComplete();
                servletOutputStream.flush();
                servletOutputStream.close();Thanks
    Sandeep

    Hi,
    You may convert the spool of your report into PDF quite simply, this has been discussed many times in this forum.
    If you want to provide additional functionalities, especially of your report consists in a table (well, that is generally the case, isn't it), you can use a tableView that provides sorting, filtering, ...
    Besides, it is also possible to turn the tableView content into Excel but you already have this one...  
    Any reason (release ?) you chose BSP over Web Dynpro ABAP ?
    Best regards,
    Guillaume

  • Pdf reports on webtoGo ? urgent plz

    Hi ,
    I developed a webtogo offline application and successfully generated the jasper pdf reports on local jdeveloper.Now i am publishing the same on olite server.
    The pdf report first save in /report folder and then open on popup in a new window(works fine on local machine with jdev).
    Now i have a doubt if the same works on server too?
    Does my code works or not?
    becoz i am getting some null pointer exception.The same code i have deployed which is working on local machine.
    error log:
    java.lang.NullPointerException
         at purchasing.pages._error._jspService(_error.java:54)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.lite.web.JupServlet.service(Unknown Source)
         at oracle.lite.web.JspRunner.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at oracle.lite.web.JupServlet.service(Unknown Source)
         at oracle.lite.web.MimeServletHandler.handle(Unknown Source)
         at oracle.lite.web.JupApplication.handle(Unknown Source)
         at oracle.lite.web.JupApplication.service(Unknown Source)
         at oracle.lite.web.JupHandler.handle(Unknown Source)
         at oracle.lite.web.HTTPServer.process(Unknown Source)
         at oracle.lite.web.HTTPServer.include(Unknown Source)
         at oracle.jsp.runtime.OraclePageContext.include(OraclePageContext.java:514)
         at purchasing.pages._main._jspService(_main.java:96)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.lite.web.JupServlet.service(Unknown Source)
         at oracle.lite.web.JspRunner.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at oracle.lite.web.JupServlet.service(Unknown Source)
         at oracle.lite.web.MimeServletHandler.handle(Unknown Source)
         at oracle.lite.web.JupApplication.handle(Unknown Source)
         at oracle.lite.web.JupApplication.service(Unknown Source)
         at oracle.lite.web.JupHandler.handle(Unknown Source)
         at oracle.lite.web.HTTPServer.process(Unknown Source)
         at oracle.lite.web.HTTPServer.forward(Unknown Source)
         at com.osi.sew.servlet.SEWControllerServlet.doDispach(SEWControllerServlet.java:89)
         at com.osi.sew.servlet.ReportServlet.doPost(ReportServlet.java:111)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at oracle.lite.web.JupServlet.service(Unknown Source)
         at oracle.lite.web.AppServletHandler.handle(Unknown Source)
         at oracle.lite.web.JupApplication.handle(Unknown Source)
         at oracle.lite.web.JupApplication.service(Unknown Source)
         at oracle.lite.web.JupHandler.handle(Unknown Source)
         at oracle.lite.web.HTTPServer.process(Unknown Source)
         at oracle.lite.web.HTTPServer.handleRequest(Unknown Source)
         at oracle.lite.web.JupServer.handle(Unknown Source)
         at oracle.lite.web.SocketListener.process(Unknown Source)
         at oracle.lite.web.ClientListener.process(Unknown Source)
         at oracle.lite.web.SocketListener$ReqHandler.run(Unknown Source)
    Thanks

    r.jsp ----------------- <%@ page contentType="text/html;charset=windows-1252"%> <% String path = com.osi.sew.utils.SEWConstants.SEW_KEYS.CONTEXT_PATH;%> <script type="text/javascript">
    function populateDetails(){
    var processKey = populateDetails.arguments[0];
    var args = populateDetails.arguments[1];
    var ajaxIndex = populateDetails.arguments[2];
    if(processKey == 'advisedby'){
    // <![CDATA[
    function display(obj,id1,id2,id3) {
    txt = obj.options[obj.selectedIndex].value;
    document.getElementById(id1).style.display = 'none';
    document.getElementById(id2).style.display = 'none';
    document.getElementById(id3).style.display = 'none';
    if ( txt.match(id1) ) {
    document.getElementById(id1).style.display = 'block';
    if ( txt.match(id2) ) {
    document.getElementById(id2).style.display = 'block';
    if ( txt.match(id3) ) {
    document.getElementById(id3).style.display = 'block';
    // ]]>
    var url1='<%=(String)request.getAttribute("jasperPrint")%>';
    function open_on_entrance()
    url1 = '<%=(String)request.getAttribute("jasperPrint")%>';
    if(url1 != null)
    window.open(url1, 'iuiu', 'menubar,resizable,status,width=900,height=550,left=30,top=30');
    window.onload = function(){
    if(url1 == 'null'){
    //alert('url is null');
    }else{
    open_on_entrance();
    </script>
    <form action="%3C%=path%20+%20">" method="post" id="reportForm" name="reportForm" &gt;
    <table width="540" cellspacing="0" cellpadding="2">
    <thead>
    <tr>
    <td class="title">Report Type:</td>
    <td class="field"><select name="reportName">
    <option>Please select:</option>
    <option value="vendorReport">Gate Pass - Material Return to Vendor</option>
    <option value="report2">Report 2</option>
    <option value="report3">Report 3</option>
    </select></td>
    </tr>
    </thead>
    <tfoot>
    <tr>
    <td class="align-center" colspan="2"><input type="submit" value="Submit" id="submit" name="submit" class='submit'>
    <input type="reset" value="Reset">
    </td>
    </tr>
    </tfoot>
    <tbody id="report2" style="display: none;">
    <tr>
    <td class="title">B'First Name:</td>
    <td class="field"><input type="text" name="fname" size="15">
    </td>
    </tr>
    <tr>
    <td class="title">B'Last Name:</td>
    <td class="field"><input type="text" name="lname" size="15">
    </td>
    </tr>
    </tbody>
    <tbody id="report3" style="display: none;">
    <tr>
    <td class="title">G'First Name:</td>
    <td class="field"><input type="text" name="fname" size="15">
    </td>
    </tr>
    <tr>
    <td class="title">G'Last Name:</td>
    <td class="field"><input type="text" name="lname" size="15">
    </td>
    </tr>
    </tbody>
    <tbody id="vendorReport" style="display: none;">
    <tr>
    <td class="title">PO Number:</td>
    <td class="field"><input type="text" name="poNumber" size="15">
    </td>
    </tr>
    <tr>
    <td class="title">Receipt Number:</td>
    <td class="field"><input type="text" name="receiptNumber" size="15">
    </td>
    </tr>
    <tr>
    <td class="title">Advised By:</td>
    <td class="field">
    <div><input size="25" type="text" id="advisedBy" name="advisedBy">
    </div>
    <span id="spanEmp" name="spanEmp" class='hidespan'></span></td>
    </tr>
    <tr>
    <td class="title">Prepared By:</td>
    <td class="field">
    <div><input size="25" type="text" id="preparedBy" name="preparedBy">
    </div>
    <span id="spanEmp2" name="spanEmp2" class='hidespan'></span></td>
    </tr>
    </tbody>
    </table>
    </form>
    Servlet.java --------------------------------
    public class ReportServlet extends SEWControllerServlet { private static final String CONTENT_TYPE = "text/html; charset=windows-1252"; public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request,response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String key4nav = request.getParameter(SEWConstants.SEW_KEYS.PARAM_KEY); System.out.println("key4nav..report servlet"+key4nav); String key4next = key4nav; System.out.println("key4next"+key4next); boolean statusFlag = false; JasperReport jasperreport; Connection conn = null; try { if(key4nav.equals(SEWConstants.MODULE_PURCHASING.REPORT)) { String submitBtn = request.getParameter("submit"); String reportName = request.getParameter("reportName"); String location = SEWLoggedInUser.getLocation(); Map parameters = new HashMap(); if(request.getParameter("reportName").equalsIgnoreCase("vendorReport")) { String poNumber = request.getParameter("poNumber"); String receiptNumber = request.getParameter("receiptNumber"); String advisedBy = request.getParameter("advisedBy"); String preparedBy = request.getParameter("preparedBy"); String reportPath= request.getRealPath("/reports"); String reportImagepath= request.getRealPath("/images"); System.out.println("reportImagepath&gt;&gt;"+reportImagepath); jasperreport = JasperCompileManager.compileReport(reportPath+ "/vendor_report.xml"); parameters.put("poNumber",poNumber); parameters.put("receiptNumber",receiptNumber); parameters.put("location",location); parameters.put("advisedBy",advisedBy); parameters.put("preparedBy",preparedBy); parameters.put("reportImagepath",reportImagepath); conn = SEWConnectionManager.getConnection(); // response.setContentType("application/pdf"); // response.setContentLength(0); // ServletOutputStream out = response.getOutputStream(); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperreport, parameters, conn); byte[] bytes= JasperExportManager.exportReportToPdf(jasperPrint); response.setContentType("application/pdf"); //response.addHeader("Content-Disposition", "inline;"); //open in current window response.setHeader ("Content-Disposition","attachment;filename=\"report.pdf\""); //open in new browser window response.setContentLength(bytes.length); ServletOutputStream ouputStream = response.getOutputStream(); ouputStream.write(bytes, 0, bytes.length); ouputStream.flush(); ouputStream.close(); if(conn!=null){ conn.close(); } }
    Here i am the report Image and report xml path using
    String reportPath= request.getRealPath("/reports");
    String reportImagepath= request.getRealPath("/images");
    Does this work on webtogo?How does it look for the location of reports folder and then the xml file?
    Can you tell me how you are getting pdf in your application
    Edited by: rbojja on Jul 14, 2009 1:01 PM
    Edited by: rbojja on Jul 14, 2009 1:02 PM
    Edited by: rbojja on Jul 14, 2009 8:42 PM

  • OAF : Could not open PDF from Self Service Page or Jdeveloper.

    Hi Friends,
    We are on R12 Applications.
    Appreciate any help.
    Requirement :
    1. Open the PDF from Self Service Page.
    Error :
    Adobe Reader Could Not Open the PDF because it is either not a supported file type or the file is damaged.
    Below is my Controller and AM code
    ======================
    Controller Code
    ==========
    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package XXX.oracle.apps.ak.xml.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.xml.parser.v2.XMLNode;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletResponse;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.server.OADBTransactionImpl;
    import oracle.apps.xdo.XDOException;
    import oracle.apps.xdo.oa.schema.server.TemplateHelper;
    import oracle.cabo.ui.data.DataObject;
    import oracle.jbo.XMLInterface;
    * Controller for ...
    public class XMLIntegrationCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    public static final int DEPTH = 4;
    public static final int APP_ID = 20003;
    public static final String APP_NAME = "XBOL";
    public static final String TEMPLATE_CODE ="Emp_Template";
    public static final int BUFFER_SIZE = 32000;
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModuleImpl am= (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
    am.invokeMethod("initEmpVO");
    am.invokeMethod("getEmpDataXML");
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModuleImpl am= (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    System.out.println("XXX : Event "+event);
    if("GenerateReport".equals(event))
    // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
    DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
    try {
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=EmpReport.pdf";
    response.setHeader("Content-Disposition",contentDisposition);
    response.setContentType("application/PDF");
    // Get the Data XML File as the XMLNode
    XMLNode xmlNode = (XMLNode) am.invokeMethod("getEmpDataXML");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlNode.print(outputStream);
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    //Generate the PDF Report.
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    APP_NAME,
    TEMPLATE_CODE,
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF,
    null,
    pdfFile);
    // Write the PDF Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    catch(Exception e)
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    pageContext.setDocumentRendered(true);
    AM CODE
    ======
    package subba.oracle.apps.ak.xml.server;
    import java.io.ByteArrayOutputStream;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.apps.fnd.framework.test.inputscanner.server.EmpVOImpl;
    import oracle.help.common.xml.*;
    import oracle.jbo.XMLInterface;
    import oracle.xml.parser.v2.XMLDocument;
    import oracle.xml.parser.v2.XMLElement;
    import oracle.xml.parser.v2.XMLNode;
    // --- File generated by Oracle ADF Business Components Design Time.
    // --- Custom code may be added to this class.
    // --- Warning: Do not modify method signatures of generated methods.
    public class testXMLAMImpl extends OAApplicationModuleImpl {
    /**This is the default constructor (do not remove)
    public testXMLAMImpl() {
    /**Sample main for debugging Business Components code using the tester.
    public static void main(String[] args) {
    launchTester("XXX.oracle.apps.ak.xml.server", /* package name */
    "testXMLAMLocal" /* Configuration Name */);
    public void initEmpVO()
    EmployeeVOImpl vo = getEmployeeVO1();
    if(vo == null)
    MessageToken errTokens[] = {
    new MessageToken("OBJECT_NAME", "EmployeeVO1")
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    } else
    vo.executeQuery();
    public void getEmpDataXML()
    try {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    OAViewObject vo = (OAViewObject)findViewObject("EmployeeVO1");
    ((XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    System.out.println(outputStream.toString());
    catch(Exception e)
    throw new OAException (e.getMessage());
    /**Container's getter for EmployeeVO1
    public EmployeeVOImpl getEmployeeVO1() {
    return (EmployeeVOImpl)findViewObject("EmployeeVO1");
    }

    Try the OA Framework Forum

  • Generate PDF using Managed Bean with custom HTTP headers

    Background
    Generate a report in various formats (e.g., PDF, delimited, Excel, HTML, etc.) using JDeveloper 11g Release 2 (11.1.2.3.0) upon clicking an af:commandButton. See also the StackOverflow version of this question:
    http://stackoverflow.com/q/13654625/59087
    Problem
    HTTP headers are being sent twice: once by the framework and once by a bean.
    Source Code
    The source code includes:
    - Button Action
    - Managed Bean
    - Task Flow
    Button Action
    The button action:
    <af:commandButton text="Report" id="submitReport" action="Execute" />
    Managed Bean
    The Managed Bean is fairly complex. The code to `responseComplete` is getting called, however it does not seem to be called sufficiently early to prevent the application framework from writing the HTTP headers.
    HTTP Response Header Override
    * Sets the HTTP headers required to indicate to the browser that the
    * report is to be downloaded (rather than displayed in the current
    * window).
    protected void setDownloadHeaders() {
    HttpServletResponse response = getServletResponse();
    response.setHeader( "Content-Description", getContentDescription() );
    response.setHeader( "Content-Disposition", "attachment, filename="
    + getFilename() );
    response.setHeader( "Content-Type", getContentType() );
    response.setHeader( "Content-Transfer-Encoding",
    getContentTransferEncoding() );
    Issue Response Complete
    The bean indirectly tells the framework that the response is handled (by the bean):
    getFacesContext().responseComplete();
    Bean Run and Configure
    public void run() {
    try {
    Report report = getReport();
    configure(report.getParameters());
    report.run();
    } catch (Exception e) {
    e.printStackTrace();
    private void configure(Parameters p) {
    p.put(ReportImpl.SYSTEM_REPORT_PROTOCOL, "http");
    p.put(ReportImpl.SYSTEM_REPORT_HOST, "localhost");
    p.put(ReportImpl.SYSTEM_REPORT_PORT, "7002");
    p.put(ReportImpl.SYSTEM_REPORT_PATH, "/reports/rwservlet");
    p.put(Parameters.PARAM_REPORT_FORMAT, "pdf");
    p.put("report_cmdkey", getReportName());
    p.put("report_ORACLE_1", getReportDestinationType());
    p.put("report_ORACLE_2", getReportDestinationFormat());
    Task Flow
    The Task Flow calls Execute, which refers to the bean's `run()` method:
    entry -> main -> Execute -> ReportBeanRun
    Where:
    <method-call id="ReportBeanRun">
    <description>Executes a report</description>
    <display-name>Execute Report</display-name>
    <method>#{reportBean.run}</method>
    <outcome>
    <fixed-outcome>success</fixed-outcome>
    </outcome>
    </method-call>
    The bean is assigned to the `request` scope, with a few managed properties:
    <control-flow-rule id="__3">
    <from-activity-id>main</from-activity-id>
    <control-flow-case id="ExecuteReport">
    <from-outcome>Execute</from-outcome>
    <to-activity-id>ReportBeanRun</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <managed-bean id="ReportBean">
    <description>Executes a report</description>
    <display-name>ReportBean</display-name>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    The `<fixed-outcome>success</fixed-outcome>` strikes me as incorrect -- I don't want the method call to return to another task.
    Restrictions
    The report server receives requests from the web server exclusively. The report server URL cannot be used by browsers to download directly, for security reasons.
    Error Messages
    The error message that is generated:
    Duplicate headers received from server
    Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple distinct Content-Disposition headers received. This is disallowed to protect against HTTP response splitting attacks.Nevertheless, the report is being generated. Preventing the framework from writing the HTTP headers would resolve this issue.
    Question
    How can you set the HTTP headers in ADF while using a Task Flow to generate a PDF by calling a managed bean?
    Ideas
    Some additional ideas:
    - Override the Page Lifecycle Phase Listener (`ADFPhaseListener` + `PageLifecycle`)
    - Develop a custom Servlet on the web server
    Related Links
    - http://www.oracle.com/technetwork/middleware/bi-publisher/adf-bip-ucm-integration-179699.pdf
    - http://www.slideshare.net/lucbors/reports-no-notes#btnNext
    - http://www.techartifact.com/blogs/2012/03/calling-oracle-report-from-adf-applications.html?goback=%2Egde_4212375_member_102062735
    - http://docs.oracle.com/cd/E29049_01/web.1112/e16182/adf_lifecycle.htm#CIABEJFB
    Thank you!

    The problem was that the HTTP headers were in fact being written twice:
    1. The report server was returning HTTP response headers.
    2. The bean was including its own HTTP response headers (as shown in the question).
    3. The bean was copying the entire contents of the report server response, including the headers, into the output stream.
    Firefox ignored the duplicate header errors, but Google Chrome did not.

  • See my code that no me error after complied but not give me pdf result and

    hi master
    sir i use this code for create the pdf
    ExternalContext econtext = getExternalContext();
    InputStream stream = econtext.getResourceAsStream(PREFIX);
    try {
    JRResultSetDataSource mcon = new JRResultSetDataSource(getSessionBean1().getChartofaccRowSet());
    JasperPrint jasperPrint = null;
    jasperPrint = JasperFillManager.fillReport(stream, null, mcon);
    JRExporter exporter = null;
    HttpServletResponse response = (HttpServletResponse)econtext.getResponse();
    FacesContext fcontext = FacesContext.getCurrentInstance();
    exporter = new JRPdfExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM,
    response.getOutputStream());
    exporter.exportReport();
    fcontext.responseComplete();
    } catch (Exception ex) {
    log(" Error Description" , ex);
    error("Error counting rows: " + ex.getMessage() );
    error("Error counting rows: " + ex ); }
    sir this code not give any error but also not create /display the pdf
    i try to find the where problem occurred i get textfiled and send some value after one by one line
    like is this
    first time try
    JRResultSetDataSource mcon = new JRResultSetDataSource(getSessionBean1().getChartofaccRowSet());
    textField2.setValue(PREFIX);
    is given me right result and show /WEB-INF/reports/mfa.jasper in textfield2
    second time
    jasperPrint = JasperFillManager.fillReport(stream, null, mcon);
              textField2.setValue(PREFIX);
    when i press button second time this time page not give me result in textfield2 and show blank it means
    only this line have error but what i could not foud out jasperPrint = JasperFillManager.fillReport(stream, null, mcon);
    use see my code and give me idea or solution of my problem
    thank�s
    aamir

    I found and easier way to do it and wrote it up here: http://developers.sun.com/jscreator/learning/tutorials/2/reports.html

  • Cannot open the pdf when using the xml publisher to generate rtf report

    Hello Everyone,
    I followed the below link to generate a pdf using xml publisher in OAF.
    http://apps2fusion.com/at/ps/260-integrating-xml-publisher-and-oa-framework
    When i try to save the pdf and open it, i get the below error:
    Adobe Reader could not open the pdf because it is either not a supported file type or because the file has been damaged(for example, it was sent as an email attachment and wasn't correctly decoded).
    Below is the code in CO.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am= (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if("GenerateReport".equals(event))
    // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
    DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
    try {
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=EmpReport.pdf";
    response.setHeader("Content-Disposition",contentDisposition);
    response.setContentType("application/pdf");
    // Get the Data XML File as the XMLNode
    XMLNode xmlNode = (XMLNode) am.invokeMethod("getEmpDataXML");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlNode.print(outputStream);
    // System.out.println(outputStream.toString());//Testing the output by printing the contents in the outputstream.
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    // System.out.println("language is "+pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage());
    // System.out.println("country is "+pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().geCountry());
    //Generate the PDF Report.
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    // APP_NAME,
    "PER",
    // TEMPLATE_CODE,
    "Emp_Template",
    // ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    "English",
    // ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    "United States",
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF,
    null,
    pdfFile);
    // Write the PDF Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    pdfFile.flush();
    pdfFile.close();
    catch(Exception e)
    response.setContentType("application/pdf");
    throw new OAException(e.getMessage(), OAException.ERROR);
    pageContext.setDocumentRendered(false);
    Any suggestions on this would be great!
    Thanks
    Kumar

    Below is the code. Can you change so that that the output can be seen in HTML? I checked the language, country etc and they are fine.
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am= (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if("GenerateReport".equals(event))
    // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
    DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
    try {
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=PrintPage.pdf";
    response.setHeader("Content-Disposition",contentDisposition);
    response.setContentType("application/pdf");
    // Get the Data XML File as the XMLNode
    XMLNode xmlNode = (XMLNode) am.invokeMethod("getEmpDataXML");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    // xmlNode.print(outputStream);
    // System.out.println(outputStream.toString());//Testing the output by printing the contents in the outputstream.
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    // System.out.println("language is "+pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage());
    // System.out.println("country is "+pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().geCountry());
    //Generate the PDF Report.
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    // APP_NAME,
    "PER",
    // TEMPLATE_CODE,
    "Emp_Template",
    // ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    "en",
    // ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    "US",
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF,
    null,
    pdfFile);
    // Write the PDF Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    pdfFile.flush();
    pdfFile.close();
    catch(Exception e)
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    pageContext.setDocumentRendered(true);
    Thanks

  • Link Item Style to open a PDF hangs if opened in IE in 30 seconds

    Hi,
    I am using Jdeveloper version 9.0.3.
    I have a page in which, I have an advanced table, in which there is a column, with item style - link.
    On the link item there is a PPR event and it should open a PDF file, residing on the server.
    I am using java code to open the PDF file.
    In Internet Explorer, the link doesnt work, infact the Explorer hangs and the user has to exit the window.
    This doesnt happen in Firefox. However, this is critical as , use of firefox is not allowed, and the users have to ultimately use IE.
    Below is the java code for opening the PDF file from the server:
    public void downloadFileFromServer(OAPageContext pageContext, String file_name_with_path, String file_name_with_ext)
    HttpServletResponse response = (HttpServletResponse) pageContext.getRenderingContext().getServletResponse();
    if (file_name_with_path == null || "".equals(file_name_with_path)){
    throw new OAException("File path is invalid.");
    File fileToDownload = null;
    try{
    fileToDownload = new File(file_name_with_path);
    }catch (Exception e){
    throw new OAException("Invalid File Path or file does not exist.");
    if (!fileToDownload.exists()){
    throw new OAException("File does not exist.");
    if (!fileToDownload.canRead()){
    throw new OAException("Not Able to read the file.");
    String fileType = getMimeType(file_name_with_ext);
    response.setContentType(fileType);
    response.setContentLength((int)fileToDownload.length());
    response.setHeader("Content-Disposition", "attachment; filename=\"" + file_name_with_ext + "\"");
    InputStream in = null;
    ServletOutputStream outs = null;
    try{
    outs = response.getOutputStream();
    in = new BufferedInputStream(new FileInputStream(fileToDownload));
    int ch;
    while ((ch = in.read()) != -1){
    outs.write(ch);
    }catch (IOException e){
    e.printStackTrace();
    }finally{
    try{
    outs.flush();
    outs.close();
    if (in != null){
    in.close();
    }catch (Exception e){
    e.printStackTrace();
    }//end catch
    }//end finally
    }//end method
    public String getMimeType(String s)
    int i = s.lastIndexOf(".");
    if (i > 0 && i < s.length() - 1){
    String s1 = s.substring(i + 1);
    if (s1.equalsIgnoreCase("pdf")){
    return "application/pdf";
    }//end if
    }//end if
    return "application/octet-stream";
    }//end method
    Thanks,
    AJ

    Hi Kristofer,
    We did look at the possibility for using messageDownload bean instead of a link, but we do not want to store the file as a LOB.
    The file needs to be stored in the server location.
    Any clue as to why the file opened in the browser ( on clicking on the link) hangs and this is happening only in IE.
    Thanks,
    AJ

  • XML Publisher Integration: OAF Page in invalid after PDF creation

    Hello,
    after days of googling and trying out various code changes in vain I hope to find help in this forum.
    The requirement is to extend the shipment page PosAsnMainPage in iSupplier Portal, adding the creation and download of PDF shipping documents for the orders selected in the table. These documents can be created for multiple shipments at once, always resulting in exactly one PDF file.
    To achieve this, I have added a button to the page that triggers the event "XxpoPrintShippingDocuments". In the controller class that extends the standard iSupplier Portal Controller, I have extended processFormRequest as follows:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(strEvent.equals("XxpoPrintShippingDocuments") && ("Y").equals(pageContext.getProfile("XXPO_DROPSHIPDOCUMENTS_SECURITY")))
    outputDropshipDocuments();
    }//end processFormRequest
    private void outputDropshipDocuments()
    * on the view object, compose a list of PoHeaderId, PoLineId, LineLocationId from the rows that were selected
    OAViewObject vo = (OAViewObject) am.findViewObject("PosShipmentsVO");
    * Create PDF and a pop-up window for download
    //file info
    String fileName = pageContext.getMessage("XXPO", "XXPO_SD_FILENAME", null);
    String fileType = "PDF";
    boolean appendDate = true;
    //template info
    String appName = getApplicationName(vendorSiteId);
    String templKey = getTemplateKey(vendorSiteId);
    //user info
    Integer userId = new Integer(pageContext.getUserId());
    try
    XxpoShippingDocumentsOut out = new XxpoShippingDocumentsOut(pageContext, webBean);
    * Save the printed status
    * This is supposed to be done here instead of during xml generation.
    * If any uncaught exception occurs before, the printed status remains unchanged.
    Class printClasses[] = {Map.class, Integer.class};
    Serializable printParams[] = {selectedOrders, userId};
    am.invokeMethod("savePrintStatus", printParams, printClasses);
    out.setFileInfo(fileName, fileType, appendDate);
    out.outputFile(xmlDoc, templKey, appName);
    } catch (Exception e)
    throw new OAException(e.getMessage(), OAException.WARNING);
    Finally, in XxpoShippingDocumentsOut.outputFile there is the following code:
    public void outputFile(XMLDocument xmlDoc, String templateKey, String appName)
    try {
    ServletOutputStream os = response.getOutputStream();
    response.setHeader("Content-Disposition", contentDisposition);
    response.setContentType(contentType);
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlDoc.print(outputStream);
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream File = new ByteArrayOutputStream();
    OADBTransactionImpl transaction = (OADBTransactionImpl) am.getOADBTransaction();
    TemplateHelper.processTemplate(
    transaction.getAppsContext(),
    appName,
    templateKey,
    transaction.getUserLocale().getLanguage(),
    transaction.getUserLocale().getCountry(),
    inputStream,
    outputType.byteValue(),
    null,
    File);
    * write the output to the HttpServletResponse object and flush -
    * this creates the pop-up window
    byte[] b = File.toByteArray();
    response.setStatus(HttpServletResponse.SC_OK);
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    } catch (Exception e) {
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    Most of this works just fine - I select some orders on the standard iSP page, press the button and download the PDF file. But after that, the page is not "valid" any longer: the selections made are still visible but when a button is pressed (for instance the Create Shipment Notice or my own button), I get an error stating that items must be selected first.
    If I deactivate the lines in outputFile that set the response or flush the output stream, I can further use the previously made selections and everything works fine - except I don't get the PDF I need, obviously.
    Does anyone have an idea of what is missing here to reload the page or anything? Is there any workaround (i.e. opening the file downlad in a separate browser tab)?
    I'd be grateful for any advice on this. If you wish any further information, please let me know.
    Best regards,
    Michelle
    Edited by: 968905 on 01.11.2012 06:09
    Edited by: 968905 on 12.11.2012 03:02

    Hello,
    after days of googling and trying out various code changes in vain I hope to find help in this forum.
    The requirement is to extend the shipment page PosAsnMainPage in iSupplier Portal, adding the creation and download of PDF shipping documents for the orders selected in the table. These documents can be created for multiple shipments at once, always resulting in exactly one PDF file.
    To achieve this, I have added a button to the page that triggers the event "XxpoPrintShippingDocuments". In the controller class that extends the standard iSupplier Portal Controller, I have extended processFormRequest as follows:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(strEvent.equals("XxpoPrintShippingDocuments") && ("Y").equals(pageContext.getProfile("XXPO_DROPSHIPDOCUMENTS_SECURITY")))
    outputDropshipDocuments();
    }//end processFormRequest
    private void outputDropshipDocuments()
    * on the view object, compose a list of PoHeaderId, PoLineId, LineLocationId from the rows that were selected
    OAViewObject vo = (OAViewObject) am.findViewObject("PosShipmentsVO");
    * Create PDF and a pop-up window for download
    //file info
    String fileName = pageContext.getMessage("XXPO", "XXPO_SD_FILENAME", null);
    String fileType = "PDF";
    boolean appendDate = true;
    //template info
    String appName = getApplicationName(vendorSiteId);
    String templKey = getTemplateKey(vendorSiteId);
    //user info
    Integer userId = new Integer(pageContext.getUserId());
    try
    XxpoShippingDocumentsOut out = new XxpoShippingDocumentsOut(pageContext, webBean);
    * Save the printed status
    * This is supposed to be done here instead of during xml generation.
    * If any uncaught exception occurs before, the printed status remains unchanged.
    Class printClasses[] = {Map.class, Integer.class};
    Serializable printParams[] = {selectedOrders, userId};
    am.invokeMethod("savePrintStatus", printParams, printClasses);
    out.setFileInfo(fileName, fileType, appendDate);
    out.outputFile(xmlDoc, templKey, appName);
    } catch (Exception e)
    throw new OAException(e.getMessage(), OAException.WARNING);
    Finally, in XxpoShippingDocumentsOut.outputFile there is the following code:
    public void outputFile(XMLDocument xmlDoc, String templateKey, String appName)
    try {
    ServletOutputStream os = response.getOutputStream();
    response.setHeader("Content-Disposition", contentDisposition);
    response.setContentType(contentType);
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlDoc.print(outputStream);
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream File = new ByteArrayOutputStream();
    OADBTransactionImpl transaction = (OADBTransactionImpl) am.getOADBTransaction();
    TemplateHelper.processTemplate(
    transaction.getAppsContext(),
    appName,
    templateKey,
    transaction.getUserLocale().getLanguage(),
    transaction.getUserLocale().getCountry(),
    inputStream,
    outputType.byteValue(),
    null,
    File);
    * write the output to the HttpServletResponse object and flush -
    * this creates the pop-up window
    byte[] b = File.toByteArray();
    response.setStatus(HttpServletResponse.SC_OK);
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    } catch (Exception e) {
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    Most of this works just fine - I select some orders on the standard iSP page, press the button and download the PDF file. But after that, the page is not "valid" any longer: the selections made are still visible but when a button is pressed (for instance the Create Shipment Notice or my own button), I get an error stating that items must be selected first.
    If I deactivate the lines in outputFile that set the response or flush the output stream, I can further use the previously made selections and everything works fine - except I don't get the PDF I need, obviously.
    Does anyone have an idea of what is missing here to reload the page or anything? Is there any workaround (i.e. opening the file downlad in a separate browser tab)?
    I'd be grateful for any advice on this. If you wish any further information, please let me know.
    Best regards,
    Michelle
    Edited by: 968905 on 01.11.2012 06:09
    Edited by: 968905 on 12.11.2012 03:02

  • Opening a pdf document in a new window on click of commandLink in ADF

    Hi,
    I am having a command link in my page and on click of that i am calling a webservice and getting the contents as bytes and writing the contents to the response outputstream. And i followed the below given steps. Everything works fine and i am getting the PDF displayed in new window. But i am getting a pop up blocker issue in IE and Firefox. Is there any workaround for that?
    1: open a dialog , and get url of servlet
    <af:commandButton text="Dialog Report" id="cbdialogReport"
    action="#{ReportBean.cbdialogReport_action}"
    useWindow="true" windowHeight="1000"
    windowWidth="1100"/>
    public String cbdialogReport_action() {
    try {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext =
    facesContext.getExternalContext();
    HttpServletRequest request = (HttpServletRequest)externalContext.getRequest();
    String strUrl = request.getRequestURL() + "";
    int iPosition = strUrl.indexOf("/faces/");
    strUrl = strUrl.substring(0,iPosition+6) + "/doreport";
    this.reportURL = strUrl;
    System.out.println("strUrl=" + strUrl);
    //System.out.println("request.getRequestURI()= " + request.getRequestURI());
    return "dialog:ReportDialog";
    } catch (Exception ex) {
    System.out.println(ex);
    return null;
    2:diaolog
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelStretchLayout id="psl1">
    <f:facet name="bottom"/>
    <f:facet name="center">
    <af:inlineFrame id="if1"
    source="#{ReportBean.reportURL}"/>
    </f:facet>
    <f:facet name="start"/>
    <f:facet name="end"/>
    <f:facet name="top"/>
    </af:panelStretchLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    3: create a serlet
    package com.pansoft.myerp.servlet;
    import com.pansoft.myerp.view.Function;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import net.sf.jasperreports.engine.JasperRunManager;
    public class doReport extends HttpServlet {
    private static final String CONTENT_TYPE = "text/html; charset=UTF-8";
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    /**Process the HTTP doGet request.
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException,
    IOException {
    try
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext =
    facesContext.getExternalContext();
    //String strUrl = request.getRequestURL() + "";
    //System.out.println("URL: " + strUrl);
    response.setContentType("application/pdf");
    response.addHeader("Content-Type", "application/pdf");
    //response.setHeader("Content-Type", "application/pdf");
    //response.addHeader("Content-Disposition", "inline;filename=Report.pdf");
    Function function = new Function();
    Connection conn = function.getCurrentConnection();
    OutputStream outputStream = response.getOutputStream();
    InputStream reportStream = externalContext.getResourceAsStream("/Report/rptChar.jasper");
    JasperRunManager.runReportToPdfStream(reportStream, outputStream, null, conn);
    outputStream.flush();
    outputStream.close();
    //facesContext.responseComplete();
    }catch(Exception ex) {
    System.out.println("doGet():" + ex);
    Thanks!
    Ram

    I think you can't anything do about it if your popup blocker prevents the page to open.
    Some such blockers allow to add white lists of url which are allowed to open popups.
    Timo

Maybe you are looking for