This script opens a new, small, floating window and puts TOC<name>.html and IX<name>.html files in it and sets a generic popup window code to enable the display of some viewlets in the WebLogic Platform Tour.
Previous Next

 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:

  1. First start the MedRecServer if it is not already running:

    1. Open a new command shell:
      start cmd
      

    2. Start the MedRec server by running its start script:
      c:\bea\user_projects\domains\medrecdomain\startweblogic.cmd
      

  2. Open a command shell and start PointBase, if it is not already running:
    cd c:\bea\weblogic81\common\eval\pointbase\tools
    
    startPointBase.cmd
    

  3. Open another command shell and set your environment:
    c:\bea\user_projects\domains\medrecdomain\setenv.cmd
    

  4. Move to the physicianEar subdirectory if you are not already there:
    cd c:\medrec_tutorial\src\physicianEar
    

  5. Use a text editor to create a new file, deploy.xml:
    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.

  6. Start the deploy.xml file by defining a project named physiciandeploy:
    <project name="tutorial" default="deploy">
    

  7. Define the main target for deploying the application:
      <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>

  8. Complete the deploy.xml file by closing the project element:
    </project>
    

  9. Your file contents should now resemble the following:
    <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>

    Save the file and exit your text editor.

  10. In the same command shell, enter the commands to execute the build script:
    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
    

  11. To verify that the application deployed, open a new browser window and enter the URL, http://127.0.0.1:7101/physician. You should receive the Physician Application's login page. You cannot do much more than look at the page right now, because the rest of the MedRec application suite is not available.

  12. The wldeploy task works using the same options as those available with the weblogic.Deployer command line utility. Before moving on to the next tutorial, undeploy the Physician application using weblogic.Deployer. In the same command-line window, enter the command:
    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

 

 Back to Top Previous Next