Com And Hosting

Installing Oracle Application Express is Windows Machine has never been so easy for me. This is the 6th time I have installed Oracle Application Express (APEX) version 4.2.5.x in Windows 7 Pro 64 bit machine. I have used GlassFish™ server in my all my previous installation including the latest one. I guess the difference with the current installation and previous installations are the Oracle Database version and APEX version. This time I have installed APEX 4.2.5.x in Oracle 11g version 11.2.0.x.

I guess the most important thing is to flow the step by step instruction and keep the sequence of in installing items. I was a bit lost when installing Oracle Application Express Listener at one stage because some of the documentation was out of date.

The steps I followed:

  1. Install Oracle Database 11g – you can download from Oracle site, click here to download. Choose your version depending on your operating system 64 or 32 bits.
    Please note you need Oracle Database version 11.2.x or higher to install Application Express (APEX).
  2. Install Glass Fish server 4 – you can download GlassFish Server 4.x from here.
  3. Install Oracle Application Express (APEX) – you can download APEX from here.
  4. Install and Configure Oracle Application Express Listener.

Now I am not going to describe step by step guide for installing each component here as they are already available in the Oracle Documentation rather I will focus on the possible issues during the installation which is basically not covered in Oracle documentation. You can also find all sorts of other source of documentation about installing APEX. Oracle Application Express installation guide can be found here.

Install Oracle database was easy and I didn’t have any major issues during the installation process. From my previous installation experience I found it creates different oracle home every time you uninstall and re-install oracle database.

At the end of the installation process of the database it will ask you to reset the password of the database users. Do that and make sure you keep the passwords in save place as you need them to access the database.

Once the database is installed you can do a quick check in SQL PLUS. To check your database version you login to the database as sysdba and type the following command.

select * from v$version where banner like 'Oracle%';

The screen should show something like this –

find_database_version

Once you happy with the database installation then you can proceed to the next step of installing GlassFish server.

I had some issues when I was trying to install Oralce GlassFish server 4.0. Every time I run the installer I get an error saying no valid JDK or JRE installation found even though I  have Java Run Time installed and I can find them under C:\Program Files and C:\Program Files (x86). Basically this was very stressful as I did not have any luck after uninstalling java and re-installing latest version of Java, restarted the computer and tried again to install the GlassFish sever but didn’t work. The most annoying thing was, when the installer could not find a valid path, it prompt to enter Java installation path and I have tried that too but no luck.

I have checked the path in system variables and tried to add variables for Java_home but no luck. The funny thing is I can see the java version from Command Prompt and I can execute the Java.exe.

java_version

Finally I have fixed it. How??

I have downloaded the JDK this time regardless of having JRE installed in my computer. You can see the installation folders located in C:\Program Files\Java folder –

JDK Version

After installing JDK, I have also created a system variable called JAVA_HOME to point to the installation directory. To do that right click on Computer then click on properties. Click on Advanced System properties in the left then under the Advanced tab, click on Environmental Variables.

Environmental Variables

Once you get the Environment Variables window open. Click on New under the system variables section and add the parameters for Name and Value. Value should be the path of your java installation directory.

Most important thing to remember here, you need to restart the computer to reflect the environmental variables. If you run the installer again without restarting the machine you might get the same error. Once you restart the machine, open command prompt then type the following command and press enter key.

set JAVA_HOME

It should display the Environmental Variables for Java now like below –

java_home_cmd

Now you can run the installer, hopefully this should pickup the Java installation directory now. I got the GlassFish server installed now and I can browse to http://localhost:4848 to access to the GlassFish admin portal.

You need admin password to login to the portal if you have chosen a password during installation process.

Next thing we need to install is Oracle Application Express. To do that I have downloaded the APEX in my Document folder and unzipped it. Here it is –

apex_download_directory

You should follow the instruction in Step by Step guide from now on to install APEX. Another important step to remember here is to copy all the images from APEX image folder to C:\glassfish4\glassfish\domains\domain1\docroot\i.

Please note you have to create a i folder in docroot directory before you copy all the images.

Once you unzip the file, open the command prompt and change the working directory tothe APEX folder by typing the following command.

cd C:\Users\mohammedta-dev\Documents\apex_4.2.5_en\apex

This should look like this –

change_working_directory

Once you get the work directory changed, you can open the SQL Plus to run the APEX installer.

It might take a few minutes to install the Oracle Application Express. During the installation process it creates three users for APEX application.

  1. APEX_LISTENER
  2. APEX_PUBLIC_USER
  3. APEX_REST_PUBLIC_USER

Oracle Application Express (APEX) uses APEX_PUBLIC_USER to access to the database. Now by default all the users assigned to default profile. Lets check the parameters for default profile. Type the following command in SQL Plus –

SELECT RESOURCE_NAME, LIMIT FROM DBA_PROFILES
WHERE PROFILE LIKE 'DEFAULT%'

This should display something like this –

default database profile

By default you can see the password life time for every user is 180 days which means the APEX application would not be able to access the database if the password expired after 180 days unless it has been changed and reconfigured again.

To avoid this situation I have created a custom profile with UNLIMITED password life time and assigned the APEX_PUBLIC_USER to this. Use the following command in SQL Plus after logging in as SYSDBA –

Create profile CUSTOM_PROFILE LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Then assign the user to this profile –

ALTER USER APEX_PUBLIC_USER PROFILE CUSTOM_PROFILE;

Here is the message you get when done –

create_custom_profile

Now you can also check in Enterprise manager by opening the URL https://localhost:1158/em then login as SYSDBA.

Once you logged in then click on Server then Users link under the security section.

apex_users

You can see the APEX_PUBLIC_USER is assigned to custom profile and it does not have any password expiry date.

Next and final thing I need to do is install the Oracle Application Express Listener to link the application with the database. I have downloaded the listener from Oracle website and unzipped the file. You can follow the Oracle documentation to install the Oracle Application Express Listener here.

Installing listener seems to be very straight forward through GlassFish server but it didn’t work well for me. Once I have installed the listener, according to the documentation I went to http://localhost:8080/apex/listnerConfigure url to configure the listener. Every time I wanted to access this page, it redirects to http://localhost:8080/apex/not-yet-configured page. Stupid thing made me crazy looping through this page. In the page it says –

The Listener has not yet been configured. Please contact admin or follow documentation bla bla etc

To fix this issue, I have tried uninstall and re-install the application but it didn’t work, still same issue.

Finally I got around with this by using command prompt and configured the listener. To do this I opened the command prompt then changed the working directory to listener folder. Let find the available commands for apex.war file first. Type the following in the command prompt –

java -jar apex.war --help

This should display list of commands for the listener installer like below –

apex_war_help

I can see there is a setup command to configure the Oracle Application Express Listener. I have typed the following command and followed the prompt –

java -jar apex.war setup

The configuration screen would look like this –

listner_configuratioin

Hurray finally I got the APEX workspace page running when I typed – http://localhost:8080/apex/apex_admin

apex_admin

Now I have created workspace and a new schema here.

Hope this helps.

Leave a Reply

Your email address will not be published.