Thursday, December 8, 2011

APEX listener as web interface


Well this blog is getting bigger and bigger. However, I thought that there are some tricks for APEX as itself as Web interface - so sharing it. Linux x86-64 is my platform.


1- I installed  xvfb so that when I start the apex listener - it will stay up. xvfb can be installed from open source here  - ftp://ftp.xfree86.org/pub/XFree86/4.2.0/binaries/Linux-ix86-glibc22/


(Please note that it needs some fonts those can be found in above download as well. You need 75,100 fonts at the minimum)


2- Install JDK 6. i installed JDK6 update 29 from here - http://www.oracle.com/technetwork/java/javase/downloads/index.html


3- amghost3:Oracle ->> java -jar apex.war --help
java [options] -jar apex.war [--help]
 Options:
 -Dapex.home=/path/to/apex      : Path to the folder used to store the
                                  web container runtime, defaults to:
                                  ${java.io.tmpdir}/apex
 -Dapex.port=nnnn               : HTTP listen port, default 8080
 -Dapex.ajp=nnnn                : AJP (mod_jk) listen port, default none
                                  If an AJP Port is specified then HTTP access is disabled
 -Dapex.images=/images/location : Path to the folder containing static
                                  resources required by APEX
 -Dapex.erase=true              : Erase the contents of ${apex.home}
                                  before launching
 --help                         : Print this usage message






4-  Unzip/untar the images file those were done during the install/upgarde of APEX. Refere here  at step 4 - http://apexdplsepg.blogspot.com/2011/12/install-upgrade.html






5- Install, configure and run


amghost3:Oracle ->>java -Dapex.home=/home/oracle/apex -Dapex.port=8888 -Dapex.images=/home/oracle/apex/images  -jar apex.war
INFO: Starting: /home/oracle/dwnld/apex/apex.war
 See: 'java -jar apex.war --help' for full range of configuration options
INFO: Extracting to: /home/oracle/apex
INFO: Using classpath: file:/home/oracle/apex/apex/____embedded/start.jar:file:/home/oracle/apex/apex/WEB-INF/lib/apex.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ojmisc.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ucp.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ojdbc6.jar:file:/home/oracle/apex/apex/WEB-INF/lib/xdb-11.2.0.jar:file:/home/oracle/apex/apex/WEB-INF/lib/poi-3.6-20091214.jar:file:/home/oracle/apex/apex/WEB-INF/lib/je-4.0.103.jar:file:/home/oracle/apex/apex/WEB-INF/lib/commons-fileupload-1.2.1.jar:file:/home/oracle/apex/apex/WEB-INF/lib/xmlparserv2-11.2.0.jar:
INFO: Starting Embedded Web Container in: /home/oracle/apex
Enter a username for the APEX Listener Administrator [adminlistener]: adminlsn
Enter a password for adminlsn:
Confirm password for adminlsn:
Enter a username for the APEX Listener Manager [managerlistener]: mnglsn
Enter a password for mnglsn:
Confirm password for mnglsn:
Dec 9, 2011 8:37:22 AM ____bootstrap.Deployer deploy
INFO: Will deploy application path=/home/oracle/apex/apex/WEB-INF/web.xml
Dec 9, 2011 8:37:22 AM ____bootstrap.Deployer deploy
INFO: deployed application path=/home/oracle/apex/apex/WEB-INF/web.xml
Using config file: /home/oracle/apex/apex-config.xml
APEX Listener version : 1.1.3.243.11.40
APEX Listener server info: Grizzly/1.9.18-o
Dec 9, 2011 8:37:23 AM com.sun.grizzly.Controller logVersion
INFO: Starting Grizzly Framework 1.9.18-o - Fri Dec 09 08:37:23 PST 2011
INFO: Please complete configuration at: http://localhost:8888/apex/listenerConfigure
/usr/lib64/firefox-3.0.5/run-mozilla.sh: line 131: 18517 Segmentation fault      "$prog" ${1
+"$@"}


The above error can be ignored as it is trying to start the mozilla. What it means that you shouls get the mozilla installed and the mozill.sh should be in the path at the Linux box where you have this apex listener launched. ALso do all this with VNC so that it does not go to XVFB port but to come live at the VNC port. I have done this. If need Please comment and I will post the steps then.













6- Now you can run http://amghost3.cup.com:8888/apex/listenerAdmin 
and test your adminlsn and password to get in.


At this same time on the windows where APEX listener is started - you will see


Database connection not yet configured
-- listing properties --
PropertyCheckInterval=60
ValidateConnection=true
MinLimit=1
MaxLimit=10
InitialLimit=3
AbandonedConnectionTimeout=900
MaxStatementsLimit=10
InactivityTimeout=1800
MaxConnectionReuseCount=1000


7- Now Stop and start again


To Stop - you need to ctrl+C out from where it was run.


To start - you have 2 options:


A-  Since java is in my path, I can simply do this:


amghost3:Oracle ->> java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)


amghost3:Oracle ->> java -Dapex.home=/home/oracle/apex -Dapex.port=8888 -Dapex.images=/home/oracle/apex/images -jar apex.war
INFO: Starting: /home/oracle/dwnld/apex/apex.war
 See: 'java -jar apex.war --help' for full range of configuration options
INFO: Extracting to: /home/oracle/apex
INFO: Using classpath: file:/home/oracle/apex/apex/____embedded/start.jar:file:/home/oracle/apex/apex/WEB-INF/lib/apex.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ojmisc.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ucp.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ojdbc6.jar:file:/home/oracle/apex/apex/WEB-INF/lib/xdb-11.2.0.jar:file:/home/oracle/apex/apex/WEB-INF/lib/poi-3.6-20091214.jar:file:/home/oracle/apex/apex/WEB-INF/lib/je-4.0.103.jar:file:/home/oracle/apex/apex/WEB-INF/lib/commons-fileupload-1.2.1.jar:file:/home/oracle/apex/apex/WEB-INF/lib/xmlparserv2-11.2.0.jar:
INFO: Starting Embedded Web Container in: /home/oracle/apex
Dec 9, 2011 8:59:10 AM ____bootstrap.Deployer deploy
INFO: Will deploy application path=/home/oracle/apex/apex/WEB-INF/web.xml
Dec 9, 2011 8:59:11 AM ____bootstrap.Deployer deploy
INFO: deployed application path=/home/oracle/apex/apex/WEB-INF/web.xm
Using config file: /home/oracle/apex/apex-config.xml
-- listing properties --
PropertyCheckInterval=60
ValidateConnection=true
MinLimit=1
MaxLimit=10
InitialLimit=3
AbandonedConnectionTimeout=900
MaxStatementsLimit=10
InactivityTimeout=1800
MaxConnectionReuseCount=1000
APEX Listener version : 1.1.3.243.11.40
APEX Listener server info: Grizzly/1.9.18-o
Dec 9, 2011 9:02:20 AM com.sun.grizzly.Controller logVersion
INFO: Starting Grizzly Framework 1.9.18-o - Fri Dec 09 09:02:20 PST 2011
INFO: http://localhost:8888/apex started.


-- and it starts as it is already installed and configured...It will take 3 to 5 minutes to start though - keep an eye on until you see the last line.


B- Directly as


./apex.war


Please note that when you do this - it is going to do all defaults. Like home will be /tmp/apex - images path  will be asked - port will be 8080 and will ask you to configure again as this is treated as a new install. So if you have done the new install like this then next time you can start teh APEX listener like this as well.


To avoid this and set the environment variables to where we already installed the APEX at the first place - we do as indicated below.


amghost3:Oracle ->>export _JAVA_OPTIONS="-Dapex.home=/home/oracle/apex -Dapex.port=8888 -Dapex.images=/home/oracle/apex/images"


and then type:


amghost3:Oracle ->> ./apex.war
Picked up _JAVA_OPTIONS: -Dapex.home=/home/oracle/apex -Dapex.port=8888 -Dapex.images=/home/oracle/apex/images
INFO: Starting: /home/oracle/dwnld/apex/apex.war
 See: 'java -jar apex.war --help' for full range of configuration options
INFO: Extracting to: /home/oracle/apex
INFO: Using classpath: file:/home/oracle/apex/apex/____embedded/start.jar:file:/home/oracle/apex/apex/WEB-INF/lib/apex.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ojmisc.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ucp.jar:file:/home/oracle/apex/apex/WEB-INF/lib/ojdbc6.jar:file:/home/oracle/apex/apex/WEB-INF/lib/xdb-11.2.0.jar:file:/home/oracle/apex/apex/WEB-INF/lib/poi-3.6-20091214.jar:file:/home/oracle/apex/apex/WEB-INF/lib/je-4.0.103.jar:file:/home/oracle/apex/apex/WEB-INF/lib/commons-fileupload-1.2.1.jar:file:/home/oracle/apex/apex/WEB-INF/lib/xmlparserv2-11.2.0.jar:
INFO: Starting Embedded Web Container in: /home/oracle/apex
Dec 9, 2011 9:21:03 AM ____bootstrap.Deployer deploy
INFO: Will deploy application path=/home/oracle/apex/apex/WEB-INF/web.xml
Dec 9, 2011 9:21:04 AM ____bootstrap.Deployer deploy
INFO: deployed application path=/home/oracle/apex/apex/WEB-INF/web.xml
Using config file: /home/oracle/apex/apex-config.xml
-- listing properties --
PropertyCheckInterval=60
ValidateConnection=true
MinLimit=1
MaxLimit=10
InitialLimit=3
AbandonedConnectionTimeout=900
MaxStatementsLimit=10
InactivityTimeout=1800
MaxConnectionReuseCount=1000
APEX Listener version : 1.1.3.243.11.40
APEX Listener server info: Grizzly/1.9.18-o
Dec 9, 2011 9:24:13 AM com.sun.grizzly.Controller logVersion
INFO: Starting Grizzly Framework 1.9.18-o - Fri Dec 09 09:24:13 PST 2011
INFO: http://localhost:8888/apex started.


-- WOW moments !!


I copied the apex.war to /home/oracle/apex - so that I can start it as and when needed with _JAVA_OPTIONS set in my .profile.


Hope it Helps ...

No comments:

Post a Comment