Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Jasper server and Apex integration getting ora-06512

ApexMeisterJul 6 2016 — edited Jul 8 2016

I'm using Apex 5.0.3, JR Server 6.2 and11g DB.

I basically followed the article below.

http://damien.antipa.at/2011/11/04/apex-and-jasperserver-tunnel-plugin/

I did verify that the ACL is ok and also the URL being generated below can be access directly via browser and it works ok

http://serv-ora11g:8081/jasperserver/flow.html?_flowId=viewReportFlow&j_username=jasperadmin&j_password=jasperadmin&repo…

I debug the code, below is the error and also please see the bold line below causing an error.

ORA-29273: HTTP request failed

ORA-06512: at "SYS.UTL_HTTP", line 1369

ORA-29263: HTTP protocol error

PROCEDURE call_report(p_report_name VARCHAR2, p_parameter type_parameter)
    IS
    v_url           VARCHAR2(4000);
    v_request       sys.utl_http.req;
    v_response      sys.utl_http.resp;
    v_file          BLOB;
    v_download      RAW(32767);
  BEGIN
    v_url := build_url(p_report_name, p_parameter);

    v_request := sys.utl_http.begin_request(v_url);
    sys.utl_http.set_header(v_request, 'User-Agent', g_user_agent);

    -- this is the line causing an error
   v_response := sys.utl_http.get_response(v_request);
    dbms_lob.createtemporary(v_file, TRUE, dbms_lob.session);
    LOOP
    BEGIN
      sys.utl_http.read_raw(v_response, v_download);
      dbms_lob.writeappend(v_file, utl_raw.length(v_download), v_download);
      EXCEPTION WHEN sys.utl_http.end_of_body THEN
        EXIT;
      END;
    END LOOP;
    sys.utl_http.end_response(v_response);

    owa_util.mime_header('application/' || output_format, false);
    htp.p('Content-length: ' || dbms_lob.getlength(v_file));
    htp.p('Content-Disposition: attachment; filename="' || p_report_name || '.'|| output_format ||'"');
    owa_util.http_header_close;

    wpg_docload.download_file(v_file);

    dbms_lob.freetemporary(v_file);
  END call_report;

This post has been answered by Mahmoud_Rabie on Jul 8 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2016
Added on Jul 6 2016
4 comments
1,559 views