Sunday, December 4, 2011

APEX Listener with Glassfish (v3.1)

APEX listener deployed on Glassfish

In this post I will go through the APEX listener deployed on glassfish  3.1. This is done on a linux x86-64 platform.

Steps:

1- Download and install JDK6. The minimum version that is required is JDK6 update 22. I downloaded the latest JDK6 update 29. There is KDK7 but glassfish as of now for version 3.1 do not support JDK 7. You can download JDK here - http://www.oracle.com/technetwork/java/javase/downloads/index.html

2-  Please download the glassfish here - http://glassfish.java.net/downloads/3.1-final.html

3- Install the glassfish. The install guide is here - http://glassfish.java.net/docs/3.1/installation-guide.pdf
The installation is simple - I downloaded the zip format file and unzipped it into the /home/oracle. It created /home/oracle/glassfish3 directory for me. I will have this path in all this document as glassfish home.

4- now make some changes
  
  A- 
 cd  /home/oracle/glassfish3/glassfish/domains/domain1/docroot 
edit teh index.html and change the localhost to the real host name so that one can access the admin console from here as well like :

host</b> with the <b>default administration port</b>, <a href="http://amghost4.cup.com:4848">go to the Administration Console</a>.</p> <h2>Get Oracle GlassFish Server

 B- Please untar the images for APEX - refer th creating the tar file here  at install & upgrade section here - (step 4)  http://apexdplsepg.blogspot.com/2011/12/install-upgrade.html

  cd  /home/oracle/glassfish3/glassfish/domains/domain1/docroot 
  - it will have a directory "i" after you untar the images here.
  

5- Copy ojdbc6.jar file to  /home/oracle/glassfish3/glassfish/domains/domain1/lib/

6- Start the glassfish and prepare it for the deployment. Start the glassfish as

     cd /home/oracle/glassfish3/bin
     ./asadmin start-domain

   you can stop by ./asadmin stop-domain  and list  domain as ./asadmin list-domains
   

7- Login to the glassfish for the first time and change the admin password by:
   
domain --> Administration password. Here is the admin console.


and the password screen:


8- Now add the JVM property as:

-Doracle.jdbc.J2EE13Compliant=true   in default and server properties. Configuration -->Default-config-->JVM Settings --> Then on right pane click JVM Options ..

Here is the screenshot:


   

9- Now create users those are required by APEX. So will go to security realm and will create one as:

 A-
Configuration --> Server-config-->security-->Realms-->New
Name: apex-realm
Class Name: com.sun.enterprise.security.auth.relam.file.fileRealm
JAAS Context: fileRealm
Key File: ${com.sun.aas.instanceRoot}/config/keyfile

Now click OK

B-
Now select apex-realm and click manage user -->New

userid: adminlsn
Groups: Admin
Password: Admin

and other New user

userid: mnglsn
Groups: Manager
Password: Manager

  C-
  Now Enable the Default role mapping by  clicking the Principal to Role Mapping after selecting the security itself. Please see the screen shot below.

10- Now we will fix the host IP address as:

 Configuration -->server-config-->Network Config -->Network Listeners 

select http-listener-1 and -2 and change the IP address in the first page to your Ip address.

11- Now we are ready to deploy the APEX listener. Please make the apex.war file available on the server after downloading from http://www.oracle.com/technetwork/developer-tools/apex-listener/downloads/index.html.

Now navigate as:

Application -- >Deployment   then select the apex.war file (Select the option "local packaged file or directory that is accessible from glassfish server)

Everything is sleected as default. You may want to put the description. Here is the snapshot:


12- now go to the server and remove "xmlparserv2-11.2.0.jar" from "/home/oracle/glassfish3/glassfish/domains/domain1/applications/apex/WEB-INF/lib
" directory - this is to avoid the XML parser errors.

13- Now restart the Glassfish server.

14- Login to APEX and enjoy. First listenerConfigure and then check listenerAdmin URL

 Please note that the admin console for gassfish runs on 4848 port but to access the apex you can either use 8080 or 8181. The 8181 is https port. Please see the following screen shots.






Hope it Helps...




No comments:

Post a Comment