web server - Borland Technical Publications

web server - Borland Technical Publications web server - Borland Technical Publications

techpubs.borland.com
from techpubs.borland.com More from this publisher
12.11.2014 Views

Creating and Deploying a DAR You deploy the DAR containing the descriptor file just as you would any other J2EE module using either the Console or command-line utilities, or as part of an EAR. You can deploy any number of distinctly named DARs in the same Partition or to a BES cluster. Should two or more deployed DARs have resource object definitions with identical JNDI names, the last deployed module overwrites any existing object binding on the same node. Once deployed, resource objects defined in the DAR can be examined in the Naming Service namespace using the JNDI Browser. See Chapter 9, “Using the JNDI Browser” for details on using the browser. Migrating to DARs from previous versions of Borland Enterprise Server Previous product versions, including IAS 4.1 and BAS 4.5, did not have a DAR module to contain the jndi-definitions.xml descriptor. If you have a customized jndidefinitions.xml file that needs to be transferred to Borland Enterprise Server, follow these migration steps: 1 If you want the entire contents of the default resources overridden, make a temporary directory called META-INF and place your existing jndi-definitions.xml file within it. 2 Open a command window and use the following jar command: prompt>jar uvMf default-resources.dar META-INF/jndi-definitions.xml 3 Now deploy this module following the usual procedures. If you have performed only a few customizations on your old jndi-definitions.xml file then it may be easier to simply move the appropriate XML stanzas from the old file into the one contained within the pre-deployed DAR. Creating and Deploying a DAR The DDEditor walks you through creating a new JNDI Definitions Module. Open the DDEditor and select “File|New...” The Object Gallery appears. Figure 21.1 Object Gallery Select the JNDI Definitions tab and select JNDI Definitions Archive to create a new DAR. Click OK. You may now add JDBC datasources or add JMS resources. Or, you may do this later. When you are finished save the module by choosing “File|Save...”. Chapter 21: Connecting to Resources with BES: using the Definitions Archive (DAR) 193

Disabling and Enabling a Deployed DAR After saving the archive, use the J2EE Deployment Wizard to deploy the module. The wizard reads resource definitions from the DAR and binds them to the Naming Service of the target partition(s). To start the wizard, open the Console and select “Wizards| Deployment Wizard.” Follow the on-screen instructions. Disabling and Enabling a Deployed DAR Once a DAR module is deployed to a partition, it is enabled. This means that its resource object definitions are bound to the Naming Service of the partition for as long as the Naming Service remains active. Enabling a DAR module rebinds its resource object definitions to the Naming Service and in the process overwrites any pre-existing content for JNDI names specified. Disabling a DAR module has no immediate impact on the contents of an active Naming Service. Upon a subsequent restart of the partition, disabled DARs are not deployed to the partition, that is, resource object definitions are not bound to the Naming Service. By default, the Naming Service stores object bindings in memory. Each time the host partition is restarted, resource object bindings from previously deployed DARs are destroyed. If the Naming Service is configured with a JDBC backing store, resource object bindings for all DARs are retained, even those that were once deployed but now marked disabled. Use the JNDI Browser to locate and permanently remove these bindings. To manipulate a deployed DAR module, use the Console to select it from the set of Deployed Modules for a partition, right-click and choose the appropriate action. Packaging DAR Modules in an Application EAR Note Sometimes it is useful to package all archives that make up a complete application into a single deployable unit. The common scenario is that you have some EJBs in an EJB Archive, some servlets and JSPs in a Web Archive and they both depend on some datasources or JMS administrative objects defined in a DAR. Using the Archive Tools in the Console it is easy to package a set of individual archives into a single EAR Module. Because DARs are not a part of the J2EE specification, you must include at least one other valid J2EE module along with your DAR within the EAR. An EAR containing only a DAR file is not a valid J2EE archive. 194 BES Developer’s Guide

Disabling and Enabling a Deployed DAR<br />

After saving the archive, use the J2EE Deployment Wizard to deploy the module. The<br />

wizard reads resource definitions from the DAR and binds them to the Naming Service<br />

of the target partition(s). To start the wizard, open the Console and select “Wizards|<br />

Deployment Wizard.” Follow the on-screen instructions.<br />

Disabling and Enabling a Deployed DAR<br />

Once a DAR module is deployed to a partition, it is enabled. This means that its<br />

resource object definitions are bound to the Naming Service of the partition for as long<br />

as the Naming Service remains active. Enabling a DAR module rebinds its resource<br />

object definitions to the Naming Service and in the process overwrites any pre-existing<br />

content for JNDI names specified. Disabling a DAR module has no immediate impact<br />

on the contents of an active Naming Service. Upon a subsequent restart of the<br />

partition, disabled DARs are not deployed to the partition, that is, resource object<br />

definitions are not bound to the Naming Service. By default, the Naming Service stores<br />

object bindings in memory. Each time the host partition is restarted, resource object<br />

bindings from previously deployed DARs are destroyed. If the Naming Service is<br />

configured with a JDBC backing store, resource object bindings for all DARs are<br />

retained, even those that were once deployed but now marked disabled. Use the JNDI<br />

Browser to locate and permanently remove these bindings.<br />

To manipulate a deployed DAR module, use the Console to select it from the set of<br />

Deployed Modules for a partition, right-click and choose the appropriate action.<br />

Packaging DAR Modules in an Application EAR<br />

Note<br />

Sometimes it is useful to package all archives that make up a complete application into<br />

a single deployable unit. The common scenario is that you have some EJBs in an EJB<br />

Archive, some servlets and JSPs in a Web Archive and they both depend on some<br />

datasources or JMS administrative objects defined in a DAR. Using the Archive Tools<br />

in the Console it is easy to package a set of individual archives into a single EAR<br />

Module.<br />

Because DARs are not a part of the J2EE specification, you must include at least one<br />

other valid J2EE module along with your DAR within the EAR. An EAR containing only<br />

a DAR file is not a valid J2EE archive.<br />

194 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!