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.


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(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at oracle.dbtools.http.servlet.DispatchableServletAdaptor.service(
at javax.servlet.http.HttpServlet.service(
at oracle.dbtools.http.servlet.DispatchableServletBase.service(
at oracle.dbtools.http.entrypoint.Dispatcher.dispatch(
at oracle.dbtools.http.entrypoint.EntryPoint$FilteredServlet.service(
at oracle.dbtools.http.filters.FilterChainImpl.doFilter(
at oracle.dbtools.http.forwarding.QueryFilteringRewrite.doFilter(
at oracle.dbtools.http.filters.HttpFilter.doFilter(
at oracle.dbtools.http.filters.FilterChainImpl.doFilter(
at oracle.dbtools.http.forwarding.ForwardingFilter.doFilter(
at oracle.dbtools.http.filters.HttpFilter.doFilter(
at oracle.dbtools.http.filters.FilterChainImpl.doFilter(
at oracle.dbtools.http.cors.CORSPreflightFilter.doFilter(

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(
at oracle.dbtools.apex.hooks.postProcess.FOP2PDF.requestTOPDF(
at oracle.dbtools.apex.hooks.postProcess.FOP2PDF.postProcess(
at oracle.dbtools.apex.hooks.ProcessorRegistry.postProcess(
at oracle.dbtools.apex.ModApex.handleRequest(
at oracle.dbtools.apex.ModApex.doPost(
at oracle.dbtools.apex.ModApex.service(


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