There was no opportunity before to develop an Oracle ADF (Application Development Framework) applications on any open source application server such as Tomcat, or Glassfish, while Glassfish is the Oracle reference implementation now for JEE specifications. The only way is to develop on Oracle Weblogic application server. Even using oracle enterprise pack (OEPE) for development on eclipse IDE.
Nowadays oracle releases the ADF essentials.With the new Oracle ADF Essentials which is offering you now the ability to deploy applications that leverage Oracle ADF on the open source Glassfish 3.1 server.
At Oracle ADF Essentials home page you can check what are supported in comparison with the full ADF library, and also there are a lot of tutorials for learning the framework.
Now will get an introduction on how to setup the development environment, then we will develop a small application using Jdeveloper 11g and deploy it on the Glassfish 3.1.2.2 application server.
Nowadays oracle releases the ADF essentials.With the new Oracle ADF Essentials which is offering you now the ability to deploy applications that leverage Oracle ADF on the open source Glassfish 3.1 server.
At Oracle ADF Essentials home page you can check what are supported in comparison with the full ADF library, and also there are a lot of tutorials for learning the framework.
Now will get an introduction on how to setup the development environment, then we will develop a small application using Jdeveloper 11g and deploy it on the Glassfish 3.1.2.2 application server.
- Setting up the environment:
- Download the following if you don’t have any of them:ADF essential library (11.1.2.3), JDeveloper 11g (11.1.2.3.0) and Glassfish 3.1.2.2.
- Install Jdeveloper 11g and Glassfish server and check that everything is up and running.
- Once ADF essential library downloaded, we need to unzip it inside the lib folder of Glassfish domain1 (or any domain you have created) this will get you an adf-essentials.zip file.
- To install ADF essentials:
- Copy the adf-essentials.zip file into the lib(on a default windows install this would be: "C:\glassfish3\glassfish\domains\domain1\lib\ext") folder of your glassfish domain.
- In lib folder open command window and issue a "unzip -j adf_essentials.zip"
- Note: you should use "-j" option with unzip (JDK program) command or you will ends up with folders not the jar files, try it and you will see.
- After successful extraction of the ADF libraries to the directory. Now you can start the Glassfish server (you can start your domain by the following command inside "bin" folder of your "domain" "asadmin start-domain domain1" from command line console, wait for domain to start then you should ends up with message "Command start-domain executed successfully.").
- We need to configure the glassfish to work with application of ADF type:
- Invoke the admin console of glassfish (http://localhost:4848) and log into your admin account.
- Go to Configurations->Server-config->JVM Settings and choose the JVM Options tab
- Add the following entries:
- -XX:MaxPermSize=512m (note this entry should already exist so just make sure it has a big enough value)
- -Doracle.mds.cache=simple
- There is a new extension ("Glassfish 1.3" as time of writing) that allows you to start and stop an external GlassFish instance, as well as start it in debug mode (which will allow JDeveloper to remotely debug your application as it runs on the server. Also a button that will invoke the web admin console of Glassfish.
- After installing Jdeveloper, open it, the extension is available from help->check for updates, or you can download it directly from here, and then use help->check for updates pointing to the local zip file (Thanks Shay Shmeltzer's who developed this extension).
- After the Jdeveloper finished download and the installation of the extension, you should find 4 glassfish buttons in the menu.
- Go to Tools -> Preferences -> Glassfish Preferences, here you can configure the glassfish paths and configurations you like.
- Developing and deploying the ADF application:
- Creating and configuring the application to work with Glassfish:
- In JDeveloper choose File -> new, the New Gallery window will pop up, from right hand menu choose General-> Applications, and then from left hand choose Fusion Web Application.
- After successful application creation.
- Go into the project properties of your viewController project, under the deployment section click to edit the deployment profile that is defined there.
- Go to Platform and choose Glassfish 3.1 from the drop down list. Click ok to go back to your project properties.
- Under Java EE Application section in project properties change the Java EE web application name and context to the same value "ADFGF" (for ease of access when deploy the application).
- Go to Application -> Application Properties-> Deployment
- Go to Platform and choose Glassfish 3.1 from the drop down list. Click ok to go back to your project.
- This step will make sure that JDeveloper will automatically add the necessary ADF libraries to the EAR file that is being generated for deployment on Glassfish.
- In JDeveloper choose File -> new, the New Gallery window will pop up, from right hand menu choose General-> Applications, and then from left hand choose Fusion Web Application.
- Developing and Deploying the application:
- Right click on viewController project and choose new.
- Under Web Tier -> JSF/Facelets -> Page -> Ok.
- File name: TestADFGF.jsf, under the managed bean tab name: testADFGF leave the others with default values. Click ok.
- The page will be opened in visual editor.
- Drag and drop any components you like as a command button, check box, choose date and choose color component.
- We need to create application server connection.
- Start the application server from glassfish start icon in the JDeveloper menu.
- From Application servers Navigator, right click on application servers -> new. From New Gallery windows choose General-> Connections -> Application Server Connection -> ok.
- In the new windows Connection name: Glassfish3122, type: Glassfish 3.1 next.
- Provide your application server username and password then next.
- Configure your ports and host name, next.
- In the final step with glassfish running hit test connection button and the four testing steps should succeed.
- Go to your Application->Deploy and deploy either to an EAR file or directly to a Glassfish server connection that you created.
- After successful deployment you should get the following message:
- Open you browser and type the following URL (http://localhost:9090/ADFGF/faces/TestADFGF.jsf), you should see the following result:
- Things should just work, but if they don't then look up the server.log in the log directory and check out what error is in there.
- Creating and configuring the application to work with Glassfish:
Hi Mohamed,
ReplyDeleteWhat if we want to deploy shared libraries to Glassfish?
I have a master application that uses shared libraries on Weblogic. Is it possible on Glassfish?
Thank you
Referring to point 4- "To install ADF essentials:", when you have put all libs in the GLASSFISH_HOME\domains\domain1\lib\ext folder, then this makes all of your libs shared for you next ADF applications.
DeleteThis is the shared folder, in glassfish