![]() |
![]() |
Building the MedRec Applications
Tutorial 9: Deploying MedRec from the Development Environment
This tutorial describes how to deploy an application from a WebLogic split development directory using the wldeploy ant task and weblogic.Deployer utilities. You can use these techniques to deploy an application quickly to a development environment without having to package the application or otherwise modify your build environment.
The tutorial includes the following sections:
|
Prerequisites
Before starting this tutorial, complete tutorials 5 through 8 to create the project directory and perform the intermediate build steps for the Physician Application. If you completed tutorial 5 but skipped one or more of the subsequent tutorials, you can catch up by moving to the c:\medrec_tutorial\src\physicianEar subdirectory, setting the environment, and executing the Ant command:
ant -f build.xml
|
Procedure
By now you have seen how the split development directory structure helps you easily build Enterprise Applications with WebLogic Server. But deploying Enterprise Applications sometimes seems like as much work as building them—you usually need to combine the compiled Java classes with modifiable deployment descriptors to create an exploded EAR directory or a compressed EAR file, which you then deploy. This process generally involves copying files from one place to another and changing their directory structures before deploying (not to mention repeating this process each time you rebuild the application or change a deployment descriptor).
With the split development directory, compiled files in the build directory are neatly separated from modifiable source files and descriptors in the source directory. WebLogic Server can deploy applications directly from a split development directory—you only need to target the build directory to deploy your work. In this procedure you use the split development directory to deploy physicianEar, which has now been built to the point where it is deployable:
start cmd
c:\bea\user_projects\domains\medrecdomain\startweblogic.cmd
cd c:\bea\weblogic81\common\eval\pointbase\tools
startPointBase.cmd
c:\bea\user_projects\domains\medrecdomain\setenv.cmd
cd c:\medrec_tutorial\src\physicianEar
notepad deploy.xml
Note: If you do not want to create the deploy.xml file manually in this tutorial, copy the file named wldeploy_tutorial.xml to a new file named deploy.xml and follow along.
<project name="tutorial" default="deploy">
<target name="deploy">
<wldeploy user="weblogic" password="weblogic" adminurl="t3://127.0.0.1:7101" action="deploy" name="tutorial_deployment" source="c:\medrec_tutorial\build\physicianEar"/>
</target>
</project>
<project name="tutorial" default="deploy">
<target name="deploy">
<wldeploy user="weblogic" password="weblogic" adminurl="t3://127.0.0.1:7101" action="deploy" name="tutorial_deployment" source="c:\medrec_tutorial\build\physicianEar" />
</target>
</project>
ant -f deploy.xml
You should receive the following output from the wldeploy task:
Buildfile: deploy.xml
deploy:
[wldeploy] weblogic.Deployer -noexit -name tutorial_deployment -source C:\medrec_tutorial\build\physicianEar -adminurl t3://127.0.0.1:7101 -user weblogic -password weblogic -deploy
[wldeploy] Initiated Task: [0] [Deployer:149026]Deploy application tutorial_deployment on MedRecServer.
[wldeploy] Task 0 completed: [Deployer:149026]Deploy application tutorial_deployment on MedRecServer.
[wldeploy] Deployment completed on Server MedRecServer
[wldeploy]
BUILD SUCCESSFUL
Total time: 12 seconds
If you do not receive the above output, MedRecServer may not have finished starting up, or you may have made a typo in creating the deploy.xml file. If this occurs, wait until the server has finished starting up, and try to deploy using the installed tutorial file:
ant -f wldeploy_tutorial.xml
java weblogic.Deployer -adminurl t3://127.0.0.1:7101 -user weblogic -password weblogic -undeploy -name tutorial_deployment
The utility displays the following output messages:
Initiated Task: [1] [Deployer:149026]Remove application tutorial_deployment on MedRecServer.
Task 1 completed: [Deployer:149026]Remove application tutorial_deployment on MedRecServer.
Deployment completed on Server MedRecServer
|
Best Practices
|
The Big Picture
How does wldeploy work with the split directory? The contents of c:\medrec_tutorial\build\physicianEar look similar to an exploded EAR directory, but there are no deployment descriptors. WebLogic Server finds the correct deployment descriptors to use by examining the c:\medrec_tutorial\build\physicianEar\.beabuild.txt file, which references the application's source directory, c:\medrec_tutorial\src\physicianEar. The source directory contains the component deployment descriptors needed to deploy the application.
|
Related Reading
![]() |
![]() |
![]() |