Showing posts with label Deploying. Show all posts
Showing posts with label Deploying. Show all posts

Sunday, January 17, 2010

FAQ #10 - How to configure ojdeploy as an Ant target in JDeveloper 11g

Introduction

ojdeploy is a utility program that is installed along with JDeveloper 11g for the aid of building and deploying applications directly from the command line, without the need to actually start JDeveloper. In this FAQ we will see, how to invoke ojdeploy from within JDeveloper as an Ant target.

Main Theme

For a single workspace application, ojdeploy is configured and used automatically when creating a project buildfile. You can create a project buildfile by right-clicking on your project in the Application Navigator, selecting New.... and Buildfile from Project from the Ant category of the New Gallery dialog.


In the Create Buildfile from Project dialog, ensure that the Include Packaging Tasks (uses ojdeploy) option is selected. This option will invoke ojdeploy during the deployment of the application. Click OK to proceed with the creation of the buildfile.


Now take a look at the contents of the buildfile generated by JDeveloper - its name defaults to build.xml. An Ant target called deploy has been created that utilizes ojdeploy for the deployment of the application.


You invoke the deployment process by right-clicking on the buildfile and selecting the deploy target.


Now, for large applications where multiple application workspaces and projects are involved, ojdeploy is utilized in a different way, usually from a script file, where each individual application workspace deployment is invoked separately. For a couple of examples of utilizing ojdeploy in such cases, take a look at these blog entries:
In these cases, the deployment process runs outside JDeveloper by actually running a deployment script from the command line. The deployment script invokes ojdeploy with the -buildfile argument in order to specify an ojbuild file. Within the ojbuild file, each individual application project that is included in the deployment process is listed.

If you still want to invoke the deployment process - even in these cases - from within JDeveloper, simply select Empty Buildfile from the New Gallery dialog - under the Ant category - and add an Ant target to invoke your deployment script.


For example, the target ojdeploy shown below invokes the ${deployment.script} deployment script, which is defined in the build.properties Ant properties file.


Conclusion

For large-scale enterprise applications consisting of multiple workspace projects, the utilization of ojdeploy for automating the build and deployment processes becomes necessary. Although in these cases the deployment process runs from the command-line as a deployment script, you can configure an Ant target to run it from within the JDeveloper programming environment.

Until the next time, keep on JDeveloping!


References

Deploying ADF Applications
Building and Integrating Oracle ADF 11g Applications with OjDeploy Utility
ADF 11: Create Application EAR for test and production deployment respectively








Sunday, December 20, 2009

FAQ #3 - How to deploy an ADF application on a standalone WebLogic server directly from JDeveloper

Introduction
Once we have installed and configured the standalone WebLogic server it becomes easy to deploy our ADF applications directly through JDeveloper.


Main Theme

Deployment of ADF applications into the standalone WebLogic server could be done in a number of ways. In this FAQ we will explore how to deploy directly from JDeveloper.

To demonstrate deployment directly from JDeveloper, let's create a sample Fusion Web Application (Web) based on the HR schema. Let's create an Employee entity from the EMPLOYEES table and an Employees view based on the Employee entity. Finally, let's bundle the Employees view in the HrAppModule application module.

For the ViewController let’s create a View Activity called Employees directly in the unbounded adfc-config task flow and an Employees.jspx JSF page for the Employees View Activity. Finally, let’s drag the Employees view from the HrAppModuleDataControl in the Data Controls and drop it onto the Employees.jspx JSF page as an ADF Form.

In order to deploy our application, we first need to create an Application Server Connection to the standalone WebLogic server. First let’s start WebLogic if not yet started. Then, in the Resource Palette (View

Resource Palette) let’s create a new Application Server connection.
 

In the Create Application Server Connection wizard Name and Type page specify the Connection Name, ensure that the Connection Type is set to WebLogic 10.3 and click Next.
 


In the Authentication page specify the WebLogic server Username and Password.
 


In the Configuration page specify the WebLogic Hostname – localhost for our development machine, the server Port – defaults to 7001 - and the Weblogic Domain name that we will be deploying on.
 

 
In the Test page click on the Test Connection button to test the connection and verify that all tests are successful.
 

 
Click Finish to save the connection which will appear in the IDE Connections in the Resource Palette.
 
Now we are ready to deploy our application. From the Application Menu – at the top left next to the application selection – select Deploy… and then the name of the deployment.
 


The first time around a Deployment wizard will be displayed. In the Deployment Action page select Deploy to Application Server and click Next.



In the Select Server page select the application server connection we created earlier from the listed Application Servers. Uncheck the Deploy to all server instances in the domain option if you want to deploy on a specific server instance. Leave the Deploy as a standalone Application option selected and press Next.



If you unchecked the Deploy to all server instances in the domain option in the previous page, a Server Instances page will be displayed. Select the Server instance that you will be deploying – ensure that the status of the server instance is RUNNING – and click Next.



In the Summary page verify the Deployment Summary details and click Finish to start the deployment process. The status of the deployment process is displayed in the Deployment – Log window. The deployment process first creates the Web Application Module (war), then the Enterprise Application Module (ear) and finally deploys the application onto the server instance(s). If all goes well the message Application Deployed Successfully is shown in the log window.



That’s it. Our application has been deployed into the standalone WebLogic server. To verify that this is the case, log in into the WebLogic administrator console – http://localhost:7001/console - and click Deployments in the Domain Structure tree. In the Summary of Deployments you should see the application we’ve just deployed.



We can access our deployed application by entering the application URL – http://127.0.0.1:7001/JDeveloperFAQNo3/faces/Employees - on the browser. At this point the application won't initialize and the Employees page won’t load until we enable security in our application. We will see how to do that some other time.

Conclusion

Once we install and configure the standalone WebLogic server in our development machine, deploying an ADF application directly onto it directly from JDeveloper is a piece of cake. Just make a connection to the server in JDeveloper and deploy!

Until the next time, keep on JDeveloping!

Code

http://jdeveloperfaq.googlecode.com/files/JDeveloperFAQNo3.rar









Related Posts Plugin for WordPress, Blogger...