Web Analytics

How to run standalone Oracle APEX Listener 2.0 with Oracle 11g XE and APEX 4.1.1

This is short guide on how to run standalone Oracle APEX Listener 2.0 beta with Oracle 11g XE. I’m using Oracle Enterprise Linux 5.7 for running Oracle APEX Listener and Oracle Database 11g XE with APEX 4.1.1. Although running APEX Listener standalone is not supported I'm using it to run several internal applications for company needs.

When using APEX Listener with Oracle XE, APEX won't work properly and white screen appears when APEX is open. This is because the APEX images are stored in the XML DB repository, but APEX Listener have to be run with parameter --apex-images pointing to directory containing the images at the filesystem. To solve this I downloaded the latest patch of APEX and copied the images from the patch.

If you have another database running on the same machine, keep in mind this.

Install Oracle 11g XE and update Oracle APEX to latest version:

  1. Download Oracle Database Express Edition 11g Release 2 for Linux x64

  2. Install Oracle 11g XE:
    rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm

  3. Configure Express Edition:
    /etc/init.d/oracle-xe configure
    Port: 1522
    Password: secret

  4. Update APEX to 4.1

Download APEX 4.1
cd /tmp
unzip -q apex_4.1.zip
cd apex
sqlplus / as sysdba
@apxldimg.sql /tmp/apex

  1. Update APEX to version 4.1.1
    Download patch set 13331096 from MOS

Disable Oracle XML DB HTTP server:

PL/SQL procedure successfully completed.

Commit complete.


Run apxpatch.sql to patch the system:

SQL> @apxpatch.sql

Update the Images Directory When Running the Embedded PL/SQL Gateway:

@apxldimg.sql /tmp/patch

Commit complete.

Once the update finished do not enable Oracle XML DB HTTP server, because we’ll be using Oracle APEX Listener, which will setup next.

Install APEX Listener 2.0.0

  1. Download Oracle APEX Listener 2.0.0 beta

  2. Download and install latest JRE 1.6 version, currently latest version is 1.6.34

    Unpack to /opt/jre1.6.0_34

  3. Unlock and set password for apex_public_user at the Oracle XE database:
    alter user APEX_PUBLIC_USER account unlock;
    alter user APEX_PUBLIC_USER identified by secret;

  4. Patch Oracle APEX to support RESTful Services:
    cd /oracle/apxlsnr/apex_patch/
    sqlplus / as sysdba @catpatch.sql

Set passwords for both users APEX_LISTENER and APEX_REST_PUBLIC_USER.

  1. Install Oracle APEX Listener:
    mkdir /oracle/apxlsnr/
    cd /oracle/apxlsnr/
    unzip apex_listener.

Now this is tricky, for XE edition the images are kept in the XML DB repository, so images have to be copied from the patch to the listener home:
cp /tmp/patch/images .

  1. Configure Oracle APEX Listener:
    export JAVA_HOME=/opt/jre1.6.0_34
    export PATH=$JAVA_HOME/bin:$PATH
    Set APEX listener config dir:
    java -jar apex.war configdir $PWD/config
    Configure the listener:
    java -jar apex.war

Once configuration is complete, listener is started. It has to be stopped and run with appropriate parameters, use Ctrl-C to stop it.

  1. Finally start the listener:

java -jar apex.war standalone --apex-images /oracle/apxlsnr/images

In case you want to run it in background here’s how to do it:

nohup java -jar apex.war standalone --apex-images /oracle/apxlsnr/images > apxlsnr.log &

Periodically I was seeing exceptions like these:
ConnectionPoolException [error=BAD_CONFIGURATION]
Caused by: oracle.ucp.UniversalConnectionPoolException: Universal Connection Pool already exists in the Universal Connection Pool Manager. Universal Connection Pool cannot be added to the Universal Connection Pool Manager

I found that if APEX Listener is not configured with RESTful Services then these messages appeared in the log and could be safety ignored.