Jdeveloper Version You Will Use To Develop Adf Application Is - Download Adf-Essentials - Zip File From Oracle Site

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 14

How to deploy ADF application in Glassfish server

Before we begin make sure of:

- JDeveloper version you will use to develop ADF application is


11.1.2.3.0 or 11.1.2.4.0.
- Download adf-essentials.zip file from oracle site
(http://www.oracle.com/technetwork/developer-
tools/adf/downloads/index.html).
----------------------------------------------------------------------------------------
1- Install Glassfish (for example install it in C:\ glassfish3).
2- Installation automatically will create domain with name “domain1”. If
you want to create new domain use this command “asadmin create-
domain --adminport <port> <domainName>”
asadmin you can find it in “C:\glassfish3\bin\asadmin”
3- Unzip adf-essentials.zip in domain1 as:
i. Goto domain1 lib path like
(C:\glassfish3\glassfish\domains\domain1\lib) and copy adf-
essentials.zip file in this path.
ii. To unzip adf libraries(adf-essentials.zip) use this command:
unzip -j adf_essentials.zip
you may find unzip command in
C:\Oracle\Middleware\wlserver_10.3\server\adr

4- To start the Glassfish Server, command prompt and execute the


following:
C:\glassfish3\bin\asadmin start-domain
Because of you did not mention domain name glassfish server will
automatically run domain1.

If you want to run a specific domain you can write this command:
C:\glassfish3\bin\asadmin start-domain yourDomainName

If you want to see the logs of the server write this command:
C:\glassfish3\bin\asadmin start-domain –verbose

5- Domain1 contain admin server with default port 4848 so, after you run
domain1 it means the admin server now is running.
6- You can open Glassfish console using this URL:
http://localhost:4848/
Default username=admin – default password=admin
And the home page of the Glassfish will be like

7- In any target you will deploy your ADF application make this
configuration:
- Assume I will deploy my application in server (Name of the
Admin Server) so in Configurations section press on server-config
then press on JVM Settings.
- Goto Java Options and add two JVM Option:
-Doracle.mds.cache=simple
-Duser.timezone=Etc/GMT-3 (write your timezone).

You can increase Java memory by adjusting


-XX:PermSize=256m
-XX:MaxPermSize=512m
8- adjust asenv.bat (You will find it in C:\glassfish3\glassfish\config) add:
set AS_JAVA=C:\Oracle\Middleware\jdk160_24
9- adjust asenv.conf (You will find it in C:\glassfish3\glassfish\config) add:
AS_JAVA="C:\Oracle\Middleware\jdk160_24"

10- stop the server using this command:


C:\glassfish3\bin\asadmin stop-domain domain1

And then start it again to apply the changes.


11- In you JDeveloper (11.1.2.3.0) you can start and stop your
glassfish server using external tool you can get it if you update your
jdeveloper with glassfish external tool and you will see the glassfish
icons appear in your JDeveloper

You should adjust commands which start and stop glassfish


From Tools Preferences  Glassfish Preferences
12- In your ADF application generate War file and make sure that
you select platform to Glassfish 3.1

13- In your ADF application generate Ear file and make sure that you
select platform to Glassfish 3.1
14- Open Glassfish console and define data source for connecting to
database. (assume in my AppModule I define datasource with name
hrDS )
To define datasource in glassfish follow this steps:
- Open glassfish console and from resources select JDBC  JDBC
Connection Pools

- Make new Connection Pool and enter the pool information

Then press Next

In Additional properties enter database information


Then press Finish

- To be sure the connection which you enter is correct select your


Connection Pool (HR) and press Ping button you will see Ping
Succeeded Message
- Make new JDBC resource point to your connection pool the
name of the new JDBC resource should be (hrDS) [the name of
the datasource which you define in AppModule]

15- From your jdeveloper generate ear file then from glassfish
console goto Applications then press Deploy button

Select your ear file then press Ok


After deployment you can access your application from this URL
http://localhost:8080/context-root/faces/yourPage.jspx

If you do not know the URL of your application select your application
from the glassfish console then press Launch and you will see your
application links.
Notes:
- If you use jasper report be sure you add
commons-digester-1.7.jar library in the domain lib folder

- If you use JSTL in your application be sure you add


javax.servlet.jsp.jstl.jar library in your application under WEB-
INF\lib folder

You might also like