Moving to Production Mode
Tutorial 14: Packaging MedRec for Distribution
In previous tutorials you configured, compiled, and deployed MedRec in a split-directory development environment. This tutorial describes how to use an Ant script to package the compiled Physician application into a single portable EAR that you can hand off to a production team.
The tutorial includes the following sections:
|
Prerequisites
Before starting this tutorial:
c:\bea\user_projects\domains\medrecdomain\setenv.cmd
and then moving to the c:\medrec_tutorial\src\physicianEar subdirectory and executing the ant command:
ant -f build.xml
|
Procedure
Step 1: Package the Physician application as an EAR.
The following procedures create and run a script that packages the contents of the Physician application from the directories used in the split-directory development environment—src and build—into a single deployable, distributable EAR file in a distribution directory, dist.
c:\bea\user_projects\domains\medrecdomain\setenv.cmd
notepad package.xml
Note: If you do not want to create the package.xml file manually in this tutorial, copy the file named wlpackage_tutorial.xml to the new name, package.xml, and skip to step 9.
<project name="tutorial" default="package">
<target name="package">
<wlpackage srcdir="c:/medrec_tutorial/src/physicianEar" destdir="c:/medrec_tutorial/build/physicianEar"
toFile="c:/medrec_tutorial/dist/wlpackage_tutorial.ear" />
</target>
</project>
<project name="tutorial" default="package">
<target name="package">
<wlpackage srcdir="c:/medrec_tutorial/src/physicianEar" destdir="c:/medrec_tutorial/build/physicianEar"
toFile="c:/medrec_tutorial/dist/wlpackage_tutorial.ear" />
</target>
</project>
ant -f package.xml
You should receive the following output from the package task:
Buildfile: package.xml
package:
[jar] Building jar: C:\medrec_tutorial\dist\wlpackage_tutorial.ear
BUILD SUCCESSFUL
Total time: 4 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 package.xml file. If this occurs, wait until the server has finished starting up, and try to package using the installed tutorial file:
ant -f wlpackage_tutoria1.xml
cd C:\medrec_tutorial\dist
and then run ls or dir.
dir wlpackage_tutorial.ear
C:\medrec_tutorial\dist>jar tf wlpackage_tutorial.ear
You should see the following list of files and subdirectories:
META-INF/
META-INF/MANIFEST.MF
APP-INF/
APP-INF/classes/
APP-INF/lib/
physicianWebApp/
physicianWebApp/WEB-INF/
physicianWebApp/WEB-INF/classes/
physicianWebApp/WEB-INF/classes/com/
physicianWebApp/WEB-INF/classes/com/bea/
physicianWebApp/WEB-INF/classes/com/bea/medrec/
physicianWebApp/WEB-INF/classes/com/bea/medrec/utils/
physicianWebApp/WEB-INF/src/
physicianWebApp/WEB-INF/src/com/
physicianWebApp/WEB-INF/src/com/bea/
physicianWebApp/WEB-INF/src/com/bea/medrec/
physicianWebApp/WEB-INF/src/com/bea/medrec/actions/
physicianWebApp/WEB-INF/src/com/bea/medrec/utils/
physSessionEjbs/
physSessionEjbs/com/
physSessionEjbs/com/bea/
physSessionEjbs/com/bea/medrec/
physSessionEjbs/com/bea/medrec/controller/
META-INF/application.xml
physicianWebApp/Confirmation.jsp
physicianWebApp/CreateRx.jsp
physicianWebApp/CreateVisit.jsp
physicianWebApp/Error.jsp
physicianWebApp/Login.jsp
physicianWebApp/PatientHeader.jsp
physicianWebApp/PhysicianHeader.jsp
physicianWebApp/Search.jsp
physicianWebApp/SearchResults.jsp
physicianWebApp/stylesheet.css
physicianWebApp/ViewProfile.jsp
physicianWebApp/ViewRecord.jsp
physicianWebApp/ViewRecords.jsp
physicianWebApp/WEB-INF/app.tld
physicianWebApp/WEB-INF/classes/com/bea/medrec/utils/Applicatio nResources.properties
physicianWebApp/WEB-INF/classes/com/bea/medrec/utils/Applicatio nResources_ja.properties
physicianWebApp/WEB-INF/struts-bean.tld
physicianWebApp/WEB-INF/struts-config.xml
physicianWebApp/WEB-INF/struts-html.tld
physicianWebApp/WEB-INF/struts-logic.tld
physicianWebApp/WEB-INF/struts-nested.tld
physicianWebApp/WEB-INF/struts-template.tld
physicianWebApp/WEB-INF/web.xml
physicianWebApp/WEB-INF/weblogic.xml
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionEJB.e jb
webservices_tutorial.xml
wlcompile_tutorial.xml
package.xml
physicianWebApp/WEB-INF/lib/
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/
physicianWebApp/WEB-INF/classes/jsp_servlet/
physSessionEjbs/META-INF/
APP-INF/lib/exceptions.jar
APP-INF/lib/log4j-1.2.4.jar
APP-INF/lib/utils.jar
APP-INF/lib/value.jar
APP-INF/lib/webServicesEjb_client.jar
physicianWebApp/WEB-INF/lib/commons-beanutils.jar
physicianWebApp/WEB-INF/lib/commons-collections.jar
physicianWebApp/WEB-INF/lib/commons-dbcp.jar
physicianWebApp/WEB-INF/lib/commons-digester.jar
physicianWebApp/WEB-INF/lib/commons-logging.jar
physicianWebApp/WEB-INF/lib/commons-pool.jar
physicianWebApp/WEB-INF/lib/commons-services.jar
physicianWebApp/WEB-INF/lib/commons-validator.jar
physicianWebApp/WEB-INF/lib/commonWeb.jar
physicianWebApp/WEB-INF/lib/log4j-1.2.4.jar
physicianWebApp/WEB-INF/lib/struts.jar
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/CreateRx Action.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/PhysBase LookupDispatchAction.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/CreateVi sitAction.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/PhysBase Action.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/PhysLog4 jInit.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/PhysLogi nAction.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/PhysLogo utAction.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/PhysView ProfileAction.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/PhysView RecordAction.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/PhysView RecordsSummaryAction.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/SearchAc tion.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/actions/SearchRe sultsAction.class
physicianWebApp/WEB-INF/classes/com/bea/medrec/utils/PhysConsta nts.class
physicianWebApp/WEB-INF/classes/jsp_servlet/__physicianheader.c lass
physicianWebApp/WEB-INF/classes/jsp_servlet/__confirmation.clas s
physicianWebApp/WEB-INF/classes/jsp_servlet/__createrx.class
physicianWebApp/WEB-INF/classes/jsp_servlet/__createvisit.class
physicianWebApp/WEB-INF/classes/jsp_servlet/__error.class
physicianWebApp/WEB-INF/classes/jsp_servlet/__login.class
physicianWebApp/WEB-INF/classes/jsp_servlet/__patientheader.cla ss
physicianWebApp/WEB-INF/classes/jsp_servlet/__search.class
physicianWebApp/WEB-INF/classes/jsp_servlet/__searchresults.cla ss
physicianWebApp/WEB-INF/classes/jsp_servlet/__viewprofile.class
physicianWebApp/WEB-INF/classes/jsp_servlet/__viewrecord.class
physicianWebApp/WEB-INF/classes/jsp_servlet/__viewrecords.class
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionEJB.c lass
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionHome. class
physSessionEjbs/com/bea/medrec/controller/PhysicianSession.clas s
physSessionEjbs/com/bea/medrec/controller/PhysicianClientUtils. class
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionEJB_n 7enxc_Intf.class
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionEJB_n 7enxc_Impl.class
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionEJB_n 7enxc_EOImpl.class
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionEJB_n 7enxc_HomeImpl.class
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionEJB_n 7enxc_HomeImplRTD.xml
physSessionEjbs/com/bea/medrec/controller/PhysicianSessionEJB_n 7enxc_EOImplRTD.xml
physSessionEjbs/ejbgen-build.xml
physSessionEjbs/META-INF/weblogic-ejb-jar.xml
physSessionEjbs/META-INF/ejb-jar.xml
physSessionEjbs/_WL_GENERATED
The EAR file you have created contains the Physician application bundled into a deployable archive.
Step 2: Test the package.
To confirm that the archive is deployable, use the Administration Console Deployment Assistant to deploy it to MedRecServer.
|
Best Practices
For actual deployment for production, package your application in exploded, unarchived format. Doing so allows you to access and update files, for example deployment descriptor files, without having to unarchive and then rearchive the entire application. See Tutorial 14: Deploying the MedRec Package for Production for instructions on deploying MedRec in exploded format.
|
The Big Picture
In this tutorial, you packaged the Physician application into a single portable EAR file suitable for handing off to a production team. The split directory structure for development presents no obstacle to switching to a manageable single directory structure for production.
|
Related Reading