Installing ADF Essentials
In order to run ADF Essentials applications in GlassFish, you will need to install the ADF Share libraries in your GlassFish domain and you will need to configure the GlassFish Server JVM memory parameters.
Getting ADF Essentials
You can get the ADF Essentials package from the Oracle Technology Network—at the time of writing, the download URL is http://www.oracle.com/technetwork/developer-tools/adf/downloads. If this does not work, you can get to the Downloads for Oracle ADF 11g page by starting at the OTN homepage (http://otn.oracle.com), clicking Software downloads to the left, then scrolling down and clicking on JDeveloper and ADF, then selecting Application Development Framework to the left, and finally clicking on the Downloads tab.
The download page will look something like this:
Accept the license agreement (read it first!) and then scroll down to the Oracle ADF Essentials section shown in the following screenshot and download:
You may be asked to fill in a short survey before Oracle lets you have the software, and you'll probably be asked to accept the license agreement once more—just to be on the safe side.
The download you get is the adf-essentials.zip
file.
Installing the ADF Share libraries in GlassFish
To install the ADF Share libraries in GlassFish, first unpack your adf-essentials.zip
file in a temporary directory to a flat structure without the directories. You can use a command like unzip -j adf_essentials.zip
to achieve this.
Tip
A default unzip will unpack to the same directory structure as the ZIP file. This will not work. You must unpack everything into one directory, ignoring the directory paths in the ZIP file.
Copy all the files to the lib
directory of the GlassFish domain where you want to run ADF Essentials applications. If you performed the installation as described earlier in the chapter, the lib
directory will be c:\adfessentials\glassfish3\glassfish\domains\domain1\lib
.
Setting the GlassFish JVM parameters
Because ADF applications are a bit more memory-hungry than the average JEE application, you will need to change the GlassFish JVM settings.
In a web browser, go to the GlassFish Administration page (by default on port 4848 of the server where you installed GlassFish, for example, http://localhost:4848
). Log in with the admin user you created during installation and go to Configurations | server-config | JVM Settings. Open the JVM Options tab. Find the option -XX:MaxPermSize= and set it to -XX:MaxPermSize=512m in order to allow GlassFish to allocate more memory than default. Your screen should look like this:
Also, add the new value -Doracle.mds.cache=simple
.
Note
This value is read by the ADF framework and instructs it to not use MetaData Services. This feature is not part of ADF Essentials (only of full ADF)—if you forget to set this parameter, your ADF application will fail with an oracle.adf.share.ADFShareException: getMDSInstance
error.
Then, click on Save and restart your GlassFish server. You might notice a Restart Required message in the top-left of your server administration window, like this:
You can click on the message to see why a restart is necessary and then click on the Restart button, or you can use the commands on the Windows Start menu.
Does it work?
There is no easy way to immediately determine if you installed ADF Essentials correctly into your GlassFish server, so we'll get right on to the task of building simple ADF Essentials applications to prove that your ADF Essentials libraries are indeed correctly installed.