In this post I am going to show how to deploy Oracle ADF Applications into the Oracle Cloud using JDeveloper.
Prerequisites / Environment
You should have the following at your hands.
- JDeveloper (JDEVADF_220.127.116.11.0CLOUD_GENERIC_121118.1600.6229)
- Oracle Cloud Java Service (which includes the database cloud service as well)
- Oracle Database (HR Schema)
- Having deployed the DB Objects and Data (HR.EMPLOYEES and HR.DEPARTMENTS) as described in the previous post
Note: In its current stage Oracle Java Cloud Service runs WebLogic Server 10.3.6 with the appropriate Runtime ADF 18.104.22.168. Deployment of ADF 11gR2 Applications is currently not supported. Beside this limitation some ADF Features are not supported on the Oracle Cloud. According to the Oracle Cloud Documentation it is not supported to use the following ADF features
- ADF Desktop Integration
- ADF mBean
- ADF MDS (Seeded customizations or cross-session personalization)
- ADF Mobile
- ADF Active Data Services (=> No real-time ADF Web Apps in Oracles Cloud)
- ADF Business Components services interfaces (web services) or events
- ADF Data Controls for BI, Essbase, BAM, and JMX
Further there are some restrictions which are good to know I think
- No Java Mail API (=>Sending Mails is prohibited)
- No File system access by deployed applications (=>Writing files is prohibited)
- No Direct use of Oracle JDBC Driver APIs
- No Java Message Service (JMS)
- Max Size for deployment archive 95MB
I wonder what 'ADF Mobile' in that context actually means. Mobile Browser Apps? Or the restriction that ADF Mobile Client apps cannot make use of ADF BC SDOs? Maybe someone from Oracle could comment. That would be great. Thx!
Setup ADF Application
OK, let's do the actual work. In order to have shown the whole deployment procedure (database objects and ADF Application) we are going to create a basic ADF Application that is running against a non-cloud, on-premise database first using the well known DB schema HR - involving table EMPLOYEES and DEPARTMENTS. Remember that these table structure + data has been deployed to the Oracle Cloud Database before.
I have created Business Components for the desired tables and build a simple master-detail Page for Departments and Employees. To verify the app is functioning as expected run in on the integrated WebLogic Server prior to deploying to the Cloud:
Looks good so far.
Prepare ADF Application for Cloud Deployment
Since we want to make the ADF Application connect to the Oracle Cloud Database Service we need to make sure the applications does the right DataSource Lookup. Therefore we need the right JNDI-Name which is pretty easy to find out.
Open the Oracle Java Cloud Service Console : https://console.us1.cloud.oracle.com/em/faces/javaservice?serviceName=java&identityGroup=<identitydomain>
and take a look at the associated DataSource with your Java Cloud Service.
Now the remaining task is straight forward (at least for everyone who has configured ADF Applications in the past). Open the Application Module and adjust the default configuration accordingly. That means Connection Type = JDBC DataSource with the given name database.
Note: If you want to a single configuration for on-premise and cloud just make sure to create a datasource bound to JNDI Name 'database' in your integrated WebLogic Server.
Make the ADF Application publicly accessible
By default all ADF Application deployed to Oracle Cloud will be automatically secured! When users access the application they will be redirected to authenticate against the associated identity domain. The login screen will look like that
Since I want to make the ADF Application for everyone outside the identity domain accessible there is one simple configuration change in the web.xml descriptor needed.
Just add <login-config/> at the appropriate place and the app will be public.
That's easy. The application is now ready for the Cloud Deployment.
Deploy ADF Application to Oracle Cloud
Goto 'Application > Deploy > 'deployment profile name'
[Deployment Wizard opens]
Select: Deploy to Application Server
Enter Connection Name: <some_conn_name>
Select Connection Type: Oracle Cloud
Enter Username: <Your Cloud Identity user name>
Enter Password: <Your password>
Select Data Center: <Data Center>
Enter Identity Domain: <Your identity domain name>
Service Name: <Your service name, by default it is java>
Test the cloud java connection
The ADF Deployment to the Cloud starts. Follow the processing in the Log window.
After less than 2 Minutes the ADF Application is available in the cloud.
Check it out yourself: https://java-trialaao1.java.us1.oraclecloudapps.com/enpit.sample.cloudapp1
(If it is not available chances are high my trial oracle cloud account is expired ;) )
Some words on redeployment: On redeployment from the JDeveloper IDE the previously deployed app version is undeployed first. The the new app version is deployed as expected.
- Deploy DB Objects if needed to Oracle Cloud Database
- Configure Application Module to use Connection Type JDBC DataSource, Name: database
- Add <login-config /> to your web.xml to make the ADF Application public if needed
- Setup up Oracle Cloud Application Server Connection
- Deploy ADF Application via Cloud Server Connection
Everything worked as designed so far. No failure / exceptions occurred to me. Thanks Oracle! Great Work!
Related Posts / Documentation
- Deploying Database Objects to Oracle Cloud using JDeveloper (by enpit) (http://multikoop.blogspot.de/2012/12/deploying-database-objects-to-oracle.html)
- Oracle Cloud Java and Database Services in Action (by enpit) (http://multikoop.blogspot.de/2012/11/oracle-java-and-database-cloud-services.html)
- Oracle Cloud Documentation (Developing Applications for Oracle Java Cloud Service) http://docs.oracle.com/cloud/CSJSU/dev_app.htm#CSJSU7037
- Oracle Cloud Documentation (Unsupported Features and APIs) http://docs.oracle.com/cloud/CSJSU/feat_implement.htm#CSJSU7042
- JDeveloper Download: http://www.oracle.com/technetwork/developer-tools/jdev/downloads/jdeveloper11116-1377208.html