Oracle REST Data Services (ORDS) / Apex Listener 2.0 FOP Gives 404 Error When Called from APEX_UTIL.GET_PRINT_DOCUMENT

(Doc ID 1554090.1)

Last updated on NOVEMBER 28, 2017

Applies to:

Oracle Database Cloud Service - S50 - Version N/A and later
Oracle REST Data Services - Version 2.0.2 and later
Oracle Application Express (formerly HTML DB) - Version 4.2.2 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Cloud Service - S20 - Version N/A and later
Information in this document applies to any platform.

Symptoms

Calling the Oracle REST Data Services (ORDS) / APEX Listener FOP from the Apex Print API Generates a 404 error and corrupt PDF.

The APEX code would be similar to the following:

1) Created a PL/SQL process on an application page run on submit.
2) This PL/SQL process refers to a 'Report Query' in the shared components section of the application.
3) The PDF document created as a result of this process contains a report ran in the called 'Report Query'

 

 ACCESS_LOG Shows an error like the following:

<IP ADDRESS> - - [09/May/2013:14:02:44 -0400] "POST /apex/_/fop2pdf HTTP/1.1" 404 3868

 

The web server log (Ex. Tomcat catalina.out) related to the configuration shows output similar to the following:

Nov 20, 2017 10:51:45 AM
SEVERE: null
ServiceUnavailableException [statusCode=503, reasons=[The FOP service is disabled, set misc.enableOldFOP to true in the configuration settings]]
at oracle.dbtools.fop.FOP2PDFService.doPost(FOP2PDFService.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at oracle.dbtools.http.servlet.DispatchableServletAdaptor.service(DispatchableServletAdaptor.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at oracle.dbtools.http.servlet.DispatchableServletBase.service(DispatchableServletBase.java:58)
at oracle.dbtools.http.entrypoint.Dispatcher.dispatch(Dispatcher.java:125)
at oracle.dbtools.http.entrypoint.EntryPoint$FilteredServlet.service(EntryPoint.java:240)
at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:73)
at oracle.dbtools.http.forwarding.QueryFilteringRewrite.doFilter(QueryFilteringRewrite.java:90)
at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)
at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)
at oracle.dbtools.http.forwarding.ForwardingFilter.doFilter(ForwardingFilter.java:68)
at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)
at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)
at oracle.dbtools.http.cors.CORSPreflightFilter.doFilter(CORSPreflightFilter.java:66)
...

Nov 20, 2017 10:51:45 AM oracle.dbtools.apex.hooks.postProcess.FOP2PDF postProcess
SEVERE: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1960)
at oracle.dbtools.apex.hooks.postProcess.FOP2PDF.requestTOPDF(FOP2PDF.java:106)
at oracle.dbtools.apex.hooks.postProcess.FOP2PDF.postProcess(FOP2PDF.java:75)
at oracle.dbtools.apex.hooks.ProcessorRegistry.postProcess(ProcessorRegistry.java:56)
at oracle.dbtools.apex.ModApex.handleRequest(ModApex.java:294)
at oracle.dbtools.apex.ModApex.doPost(ModApex.java:174)
at oracle.dbtools.apex.ModApex.service(ModApex.java:102)
....

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms