Wow, I broke my brains over this for the last three days.

I installed the apex listener as mentioned in the manual. It mentions you can use Java 6 Update 20 JDK or later.

However, what they mean is that you should use Java 6 JDK, and you can use update 20 or later.

What I did in my stupidity is to use Java 7. That’s later then Java 6 upd 20 right?

wrong!

If you use Java 7 your listener might work (which was the case in my situation) but connecting to it using SQL Developer is a “no go” 🙁

Be warned.

regards, Richard

In my ongoing quest for freeware in combination with Oracle Apex I gave Oracle Unbreakable linux another try when I heard that you _are_ able to update/upgrade it using yum, without a support identifier.

First we install Oracle Unbreakable Linux here

I opted for the 64 bit version and installed a minimal version in my VirtualBox environment.

  • 2048 Mb memory
  • 32 Gb Harddisk
  • 2 CPU’s
  • 2 Network cards
    • Adapter 1: “NAT”
    • Adapter 2: “Host Only”

When the installer asks for the computername you should make the networkcards connect automatically:

On the bottom left you can select “Configure Network”

Select each of the network cards (eth0 and eth1) and click “Edit”

The trick is in selecting the “Connect automatically” checkbox. check it for both cards.

Continue the rest of the installer normally. Choose the “Minumal” install

After the installation log in as root.

mount /dev/dvd /mnt
cd /mnt/Packages
rpm -ivh wget #(and press the tab-key)
rpm -ivh nano #(and press the tab-key)
cd /etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol6.repo
nano /etc/yum.conf

We now need to enable yum by adding an extra line to the configuration file:

enabled=1

That should do the trick. Test it out by issueing

yum update

Watching our visitors and how they arrive on warp11.com I cam across this page:

http://krisrice.blogspot.com/2010/12/listener-startupshutdown-script.html

definately worthwile caching… here we go:

Kris gives a script, which I altered a little bit.

#!/bin/sh
#
#
# chkconfig: 2345 80 05
# description: This is a program that is responsible for taking care of
# starting the apex-listener as a service. 
#
# processname: apxlistener
# Red Hat or SuSE config: /etc/sysconfig/apxlistener
# Debian or Ubuntu config: /etc/default/apxlistener
#
. /etc/rc.d/init.d/functions
NAME="Oracle Application Express Listener"
JAVA="/usr/java/jdk1.7.0_04/bin/java"
APEX_LISTENER_HOME="/u01/app/oracle/product/1.1.3/apex-listener"
APEX_IMAGES="/u01/app/oracle/product/4.1/apex/images/"
LOGFILE="$APEX_LISTENER_HOME/apex_listener.log"
PIDFILE="$APEX_LISTENER_HOME/apex_listener.pid"

start() {
        echo -n "Starting $NAME: "
        if [ -f $PIDFILE ]; then
                PID=`cat $PIDFILE`
                echo APEX Listener already running: $PID
                exit 2;
        else
            nohup $JAVA -Dapex.home="$APEX_LISTENER_HOME/tmp.apxlistener" -Dapex.images="$APEX_IMAGES" -Dapex.port=8080 -jar "$APEX_LISTENER_HOME/apex.war" 2>&1 > $LOGFILE  &
            RETVAL=$!
            echo Started PID: $RETVAL
            echo
            echo $RETVAL >>$PIDFILE
            return $RETVAL
        fi

}

status() {
        echo -n "Status $NAME: "
        if [ -f $PIDFILE ]; then
                PID=`cat $PIDFILE`
                echo APEX Listener already running: $PID
                ps -ef | grep $PID
        else
                echo APEX Listener not running
        fi
}

stop() {
        if [ -f $PIDFILE ]; then
                PID=`cat $PIDFILE`
                echo -n "Shutting down $NAME PID:$PID"
                echo
                kill $PID
                rm -f $PIDFILE
        else
                echo APEX Listener not running
        fi
        return 0
}

log() {
        tail -f $LOGFILE
}

info() {
    echo Before first use you must run the command below manually to initiate the service.
    echo 
    echo $JAVA -Dapex.home="$APEX_LISTENER_HOME/tmp.apxlistener" -Dapex.images="$APEX_IMAGES" -Dapex.port=8080 -jar "$APEX_LISTENER_HOME/apex.war"
    echo 
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        status
        ;;
    restart)
        stop
        start
        ;;
    log)
        log
        ;;
    info)
        info
        ;;
    *)
        echo
        echo "Usage:  {start|stop|status|restart|log|info}"
        echo
        info
        exit 1
        ;;
esac
exit $?

You should edit highlighted lines:
JAVA: the location of your JDK. be advised the minimum version your listener needs
APEX_LISTENER_HOME: the location the listener uses to store its config files
APEX_IMAGES: the location of the apex images directory

Create the file as /etc/init.d/apxlistener

Now set it as executable

chmod a+x /etc/init.d/apxlistener

add it to the startup-list:

chkcondig --add apxlistener
chkconfig apxlistener on

Now we’re allmost there. The listener needs a console to do the initial configuration. If you would start the service as is, it will not have a console.

I added an option “info” that echoes the commandline the service will use:

so.. execute:

/etc/init.d/apxlistener info

will give you something like this:

Before first use you must run the command below manually to initiate the service.

/usr/java/jdk1.7.0_04/bin/java -Dapex.home=/u01/app/oracle/product/1.1.3/apex-listener/tmp.apxlistener -Dapex.images=/u01/app/oracle/product/4.1/apex/images/ -Dapex.port=8080 -jar /u01/app/oracle/product/1.1.3/apex-listener/apex.war

execute that line in your console, it will ask for two usernames ( I used “admin” in both cases) and passwords.

Enter them as requested after which you can go to http://yourserver:8080/apex/listernerConfigure

Here you can enter your details as described in the apex listener.

after a reboot the listener should start automatically.