Friday, December 9, 2011

APEX Listener 1.2 with JBOSS7.0.2 (Jboss7)

APEX with JBOSS 7:

Well, I spent 3 days to get this going. It is not pretty but it works and I am sharing all the mess I had to go through to make it work.

1- Download JDK 7 from here -

2- Download JBOSS 7 from here
I downloaded 7.0.2 final 

3- unzip JDK 7 and asign th eunzipped directorya s JAVA_HOME and add to the path. For me:

export JAVA_HOME=/home/oracle/jdk1.7.0_01
export PATH=$JAVA_HOME/bin:$PATH

4- unzip the jboss and assign this as JBOSS_HOME. for me it is:


 (Please do not start the jboss yet)

5- Please copy the images for APEX as defined in step 4 here  -

6- Untar the images from step5 to $JBOSS_HOME/standalone/deployments. for me it is:


7- Download the APEX listener and extract the apex.war from here -

8- Please do this as indicated below - Very important steps below.

 cd $JBOSS_HOME/standalone/deployments

mkdir apex.war

cd apex.war

jar -xvf /homne/oracle/dwnld/apex/apex.war 

(Please note that I downloaded and unzipped the APEX listener at /home/oracle/dwnld/apex location)

mkdir /home/oracle/aptmp

cd /home/oracle/aptmp

jar -xvf $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF/lib/apex.jar 



delete the following line from it:


save and exit

now repackage this as:

cd ../ to go to /home/oracle/aptmp

jar -cvf /home/oracle/apex.jar *

(This will create apex.jar in the /home/oracle direvctory)

rm -f $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF/lib/apex.jar 

cp apex.jar $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF/lib/

cd $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF

vi adminTemplate.html  

Replace all scripts to /i/scripts. This is because for some reason when JBOSS deploys the apex.war there is no directory access inside the apex.war and I did not want to put a lot of time to find out as where this permission is set. I look arounf in the web.xml and others but could not find it. However i.war is accessible for other APEX images so I decided to do this way.

Mine looks like:

amghost3:Oracle ->> grep scripts adminTemplate.html

                <link rel="shortcut icon" type="image/" href="/i/scripts/images/oracle.ico" />
                <link rel="stylesheet" type="text/css" href="/i/scripts/css/styles.css" />
                <link rel="stylesheet" type="text/css" href="/i/scripts/css/jquery-ui-1.8.5.custom.css" />
                <script type="text/javascript" src="/i/scripts/js/jquery-1.4.2.min.js"></script>
                <script type="text/javascript" src="/i/scripts/js/jquery-ui-1.8.5.custom.min.js"></script>
        <img src="/i/scripts/images/oracle_logo.gif" width="133" height="18"alt="Oracle" class="banner" />

cd ../ (One step up to /home/oracle/jboss702/standalone/deployments/apex.war)

cp -R scripts ../i.war/

now cd $JBOSS_HOME/bin

edit the and change the last line as:

eval \"$JAVA\" $JAVA_OPTS -jar \"$JBOSS_HOME/jboss-modules.jar\" -logmodule "org.jboss.logmanager" -
mp \"$JBOSS_HOME/modules\" '--connect "$@"'

(Please note that I decided to run the web server on 8008 port and 9009 and 9008 for Admin. console)

vi standalone.conf  

change the JAVA_OPTS. Mine is:

if [ "x$JAVA_OPTS" = "x" ]; then
   JAVA_OPTS="-Xms64m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
   JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true -Dapex.home=/home/oracle/apex -Dapex.images=/home/oracle/jboss702/standalone/deployments/i.war"

(Please note that the reason I pu the apex variables here is because when we do the listenerConfigure - it will create the conf file in /tmp/apex - so to make it appropriate I did this)

now cd to $JBOSS_HOME/standalone/configuration and edit teh standalone.xml file. Please note the following changes. These changes are to have HTTP/1.1 in UTF-8 format and Admin and Manager Roles and users for APEX.

Just below </extension at the top of the file add following:

        <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
        <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>

then I changed the Admin console port and locked them to use the username as:

<native-interface interface="management" port="9009" security-realm="PropertiesMgmtSecurityRealm"/>
            <http-interface interface="management" port="9008" security-realm="PropertiesMgmtSecurityRealm"/>

Now look for the security-domain where other is mentioned change it as :

                <security-domain name="other" cache-type="default">
                        <login-module code="UsersRoles" flag="required"/>
                <security-domain name="form-auth" cache-type="default">
                        <login-module code="UsersRoles" flag="required">
                            <module-option name="usersProperties" value=""/>
                            <module-option name="rolesProperties" value=""/>

Now at the interfaces change the to the name like:

        <interface name="management">
            <inet-address value="${}"/>
        <interface name="public">
            <inet-address value="${}"/>

and the right beneath it the web port:

    <socket-binding name="http" port="8008"/>

Now create  followin 2 files "" and "" as:

amghost3:Oracle ->> more
#Format: username=password

amghost3:Oracle ->> more

Now edit the and uncomment the admin as:


Now remove the xmpparser from $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF/lib as:

rm -f $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF/lib/xmlparserv2-11.2.0.jar

Oh Well - Bear with me  - couple more steps ---

Now start the JBOSS as cd $JBOSS_HOME/bin


Now cd $JBOSS_HOME/standalone/deployments

touch i.war.dodeploy

wait until you see "i.war.deployed"

Now touch apex.war.dodeploy

Now wait until it says apex.war.deployed

Now the magic part :


and after inputs above you will end up at:

Now shutdown the JBOSS and do following:

amghost3:Oracle ->> cd /home/oracle/apex
amghost3:Oracle ->> ls
apex-config.xml  bdb

vi  apex-config.xml

and remove following line from the top of the fikle:

<!DOCTYPE properties SYSTEM "">

save and exit

Now copy and from $JBOSS_HOME/standalone/configuration  to $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF/classes 

(we will have to make this directory)

amghost3:Oracle ->> mkdir $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF/classes

amghost3:Oracle ->> pwd

amghost3:Oracle ->> cp $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF/

amghost3:Oracle ->> cp $JBOSS_HOME/standalone/deployments/apex.war/WEB-INF

amghost3:Oracle ->> pwd
amghost3:Oracle ->> ls
amghost3Oracle ->>

Now start the jboss agin and test the listenerAdmin tio verify the last puzle of user and roles:

cd $JBOSS_HOME/bin


and Voila !! it works ..

It should work on Jboss 7.1 as well but if it does not then please comment and I will try tp see what need to be fixed !!

Happy sharing !!

No comments:

Post a Comment