Application Express

PreviousNext

Source Code Control

Exporting Applications

Oracle Application Express exports create SQL script files that can be imported into any Oracle Application Express instance provided the versions of Oracle Application Express are compatible. Applications can be exported directly from the Oracle Application Express Application Builder, from SQL Developer (if the connection is to the Oracle Application Express schema owner), or from the command-line.

When developers have completed development of an application, Oracle recommends that developers export their application and save it into a source code control system. This export file should then be used to build into all other environments (Testing, Production, and so on)

Automating Application Exports

The Oracle Application Express installation includes a utilities folder which contains APEXExport programs that can be used to export applications from the command-line, without requiring a manual export from the Web interface of Application Express. There are two programs available - one for exporting the entire application and the other which splits application components into separate SQL scripts.

It is recommended that you automatically back up your Oracle Application Express applications using these command line programs as part of your disaster recovery strategy. Implementing a daily database job that automatically exports all Application Express applications provides easy to implement recovery processes.

Application Splitting

Application Express applications can include optional installation scripts which provide single file deployment. The splitter generates many files, for example each page is its own SQL script file. The splitter also generates a control file that calls the split files. When combined with a source code control system such as SVN, this provides the ability to manage Oracle Application Express application change control at a fine grained level.

Packaged Applications

Applications developed in Oracle Application Express are saved as metadata in the Oracle Application Express repository within the Oracle Database. However, applications are based on various database objects such as tables and views, and may invoke other database objects such as packages, functions, and procedures. Furthermore, before running an application it may be necessary to insert, update or delete various database records. All of these DDL and DML changes should be written in SQL scripts and executed within the target environment prior to importing the Oracle Application Express application. By utilizing the Oracle Application Express Supporting Objects, these SQL script files can be uploaded and included within the application export, creating a packaged application. This will ensure that the prerequisite scripts are executed correctly.

Static files can also be incorporated into a packaged application to simplify the installation as only one file needs to be deployed.

Packaging Applications

Packaging an application combines the installation of all components needed to install or update an application. This includes database objects such as tables, database data, the Oracle Application Express application itself, all supporting files such as images, CSS, and JavaScript.

Application Installation

once an application has been packaged into a single file, you install it by uploading the application to Oracle Application Express using the import feature. Importing starts a wizard that parses the file, performs defined pre-installation checks, executes specified installation or upgrades scripts, and then installs the application. Once the Application Express application definition is installed the supporting objects can also be installed.

Debugging

Code Instrumentation

You can instrument your Oracle Application Express PL/SQL code and code within PL/SQL procedures and functions using the APEX_DEBUG_MESSAGE package. Debugging can be selectively enabled, and can be enabled at up to 7 different levels. For example:

begin
   apex_debug_message.log_message('I AM HERE');
end;

Debugging can be enabled by clicking the Debug link in the Developer Toolbar, or it can be selectively enabled using the APEX_DEBUG_MESSAGE package. For example if you wanted to enable debugging for a user named MIKE at level 3 you could issue the following Oracle Application Express API call in a before header process at the application or page level.

begin
   if :APP_USER = 'MIKE' then
      apex_debug_message.enable_debug_messages(3);
   end if;
end;
Built in Debugging

Enabling debug from the developer tool bar, via the URL, or programmatically, via the APEX_DEBUG_MESSAGE package, can enable standard Oracle Application Express debug messages. These messages indicate numerous page processing events and display highly granular timings so you can track down performance and logic errors.

Viewing Debug Output

Developers can view debug output by clicking the View Debug link in the Developer Toolbar. Debug output shows timing data to 1/10000 of a second, and displays the application user, session and other information useful to debug performance and logic issues.

Remote Debugging

You can use Oracle SQL Developer to debug PL/SQL remotely. This capability is especially useful when an application isn't failing but also isn't producing the results you expect. When implemented, SQL Developer will be invoked when the database package, procedure, or function is called from Application Express and will allow you to step through complex PL/SQL processing that's not performing its intended function. Reviewing the data values as you step through the program often helps to identify incorrect logic.

Internal Server Error

500 - Internal Server Error

Request Path passes syntax validation
Mapping request to database pool: PoolMap [_poolName=apex, _regex=null, _workspaceIdentifier=null, _failed=false, _lastUpdate=-1, _template=null, _type=REGEX]
Applied database connection info
Attempting to process with PL/SQL Gateway
==== Processing Request: ====
GET /apex/f?p=4600:4:22652013628989::NO:::
==== Headers in Request ====
accept: */*
user-agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
accept-encoding: gzip, br, zstd, deflate
referer: http://reconquistatramites.gov.ar:9095/apex/f?p=4600%3A4%3A6525954118794%3A%3ANO%3A%3A%3A
cookie: ORA_WWV_USER_63113586886954=ORA_WWV-DitFuMpBaWZbwijN/ASm0Drb
host: reconquistatramites.gov.ar:9095
==== Cookies in Request ====
ORA_WWV_USER_63113586886954 =  ORA_WWV-DitFuMpBaWZbwijN/ASm0Drb
request parameter: p=4600:4:22652013628989::NO:::
isValidRequest(), procedure name: 
Validating: f
*** Total number of arguments: 15
SID: 69
Parse: 0 ms
-----
begin 
 f(p=>?);
commit;
  end;
*** Total number of arguments: 15
{p=4600:4:22652013628989::NO:::}
p=4600:4:22652013628989::NO:::
p= 4600:4:22652013628989::NO:::
Exec: 54 ms
Got results length: 13935
==== Headers from Results ====
Setting Content-Type (Content-type): text/html; charset=utf-8
Adding X-Frame-Options: DENY
Adding X-DB-Content-length: 13935
Processed PL/SQL Gateway request

WebException [statusCode=500]
	at oracle.dbtools.rt.web.WebException.webException(WebException.java:343)
	at oracle.dbtools.rt.web.WebException.internalError(WebException.java:262)
	at oracle.dbtools.rt.web.WebErrorResponse.internalError(WebErrorResponse.java:101)
	at oracle.dbtools.rt.web.WebErrorResponse.error(WebErrorResponse.java:75)
	at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:132)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
	at java.util.AbstractList$ListItr.set(AbstractList.java:409)
	at java.util.Collections.sort(Collections.java:121)
	at oracle.dbtools.apex.statistics.Statistics.toString(Statistics.java:226)
	at oracle.dbtools.apex.statistics.Statistics.print(Statistics.java:174)
	at oracle.dbtools.apex.statistics.Statistics.finishRequest(Statistics.java:141)
	at oracle.dbtools.apex.ModApexContext.close(ModApexContext.java:324)
	at oracle.dbtools.common.util.Closeables$2.closeType(Closeables.java:155)
	at oracle.dbtools.common.util.Closeables$2.closeType(Closeables.java:149)
	at oracle.dbtools.common.util.Closeables$BaseCloser.close(Closeables.java:239)
	at oracle.dbtools.common.util.Closeables.close(Closeables.java:97)
	at oracle.dbtools.apex.ModApex.close(ModApex.java:176)
	at oracle.dbtools.apex.ModApex.doGet(ModApex.java:101)
	at oracle.dbtools.apex.ModApex.service(ModApex.java:301)
	at oracle.dbtools.rt.web.HttpEndpointBase.modApex(HttpEndpointBase.java:347)
	at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:130)
	... 13 more