A Client Application Deployment Descriptor Elements

The following sections describe deployment descriptors for Java EE client applications on WebLogic Server:

Overview of Client Application Deployment Descriptor Elements

When it comes to Java EE applications, often users are only concerned with the server-side modules (Web applications, EJBs, and connectors). You configure these server-side modules using the application.xml deployment descriptor, discussed in "Enterprise Application Deployment Descriptor Elements" in Oracle Fusion Middleware Developing Applications for Oracle WebLogic Server.

However, it is also possible to include a client module (a JAR file) in an EAR file. This JAR file is only used on the client side; you configure this client module using the application-client.xml deployment descriptor. This scheme makes it possible to package both client and server side modules together. The server looks only at the parts it is interested in (based on the application.xml file) and the client looks only at the parts it is interested in (based on the application-client.xml file).

For client-side modules, two deployment descriptors are required: a Java EE standard deployment descriptor, application-client.xml, and a WebLogic-specific runtime deployment descriptor with a name derived from the client application JAR file.

application-client.xml Deployment Descriptor Elements

The application-client.xml file is the deployment descriptor for Java EE client applications. It must begin with the following DOCTYPE declaration:

<!DOCTYPE application-client PUBLIC "-//Sun Microsystems, 
Inc.//DTD Java EE Application Client 1.2//EN" 
"http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">

The following sections describe each of the elements that can appear in the file.

application-client

application-client is the root element of the application client deployment descriptor. The application client deployment descriptor describes the EJB modules and other resources used by the client application.

The following table describes the elements you can define within an application-client element.

Table A-1 application-client Elements

Element Description

<icon>

Locations of small and large images that represent the application in a GUI tool. This element is not currently used by WebLogic Server.

This element is optional.

<display-name>

Application display name, a short name that is intended to be displayed by GUI tools.

<description>

Description of the client application.

This element is optional.

<env-entry>

Contains the declaration of a client application's environment entries.

Elements that can be defined within the env-entry element are:

  • descriptiondescription element contains a description of the particular environment entry.

  • env-entry-nameenv-entry-name element contains the name of a client application's environment entry.

  • env-entry-typeenv-entry-typejava.lang.Booleanjava.lang.Stringjava.lang.Integerjava.lang.Doublejava.lang.Byte, java.lang.Shortjava.lang.Longjava.lang.Float.

  • env-entry-valueenv-entry-valueenv-entry-type.

<ejb-ref>

Used for the declaration of a reference to an EJB referenced in the client application.

Elements that can be defined within the ejb-ref element are:

  • descriptiondescription element provides a description of the referenced EJB.

  • ejb-ref-nameejb/ejb/Deposit.

  • ejb-ref-typeSessionEntity.

  • home—Contains the fully-qualified name of the referenced EJB's home interface.

  • remote—Contains the fully-qualified name of the referenced EJB's remote interface.

  • ejb-linkejb-linkejb-name of an EJB in the same Java EE application.

<resource-ref>

Contains a declaration of the client application's reference to an external resource.

Elements that can be defined within the resource-ref element are:

  • description—Optional. The description element contains a description of the referenced external resource.

  • res-ref-name—Specifies the name of the resource factory reference name. The resource factory reference name is the name of the client application's environment entry whose value contains the JNDI name of the data source.

  • res-type—Specifies the type of the data source. The type is specified by the Java interface or class expected to be implemented by the data source.

  • res-auth—SApplicationContainer.


weblogic-appclient.xml Descriptor Elements

This XML-formatted deployment descriptor is not stored inside of the client application JAR file like other deployment descriptors, but must be in the same directory as the client application JAR file.

The file name for the deployment descriptor is the base name of the JAR file, with the extension .runtime.xml. For example, if the client application is packaged in a file named c:/applications/ClientMain.jar, the run-time deployment descriptor is in the file named c:/applications/ClientMain.runtime.xml.

application-client

The application-client element is the root element of a WebLogic-specific run-time client deployment descriptor. The following table describes the elements you can define within an application-client element.

Table A-2 application-client Elements

Element Description

<env-entry>

Specifies values for environment entries declared in the deployment descriptor.

Elements that can be defined within the env-entry element are:

  • —Name of an application client's environment entry. Example: <env-entry-name>EmployeeAppDB</env-entry-name>

  • env-entry-value—Value of an application client's environment entry. The value must be a valid string for the constructor of the specified type, which takes a single string parameter.

<ejb-ref>

Specifies the JNDI name for a declared EJB reference in the deployment descriptor.

Elements that can be defined within the ejb-ref element are:

  • ejb-ref-name—Nejb/Example: <ejb-ref-name>ejb/Payroll</ejb-ref-name>.

  • jndi-name—JNDI name for the EJB.

<resource-ref>

Declares an application client's reference to an external resource. It contains the resource factory reference name, an indication of the resource factory type expected by the application client's code, and the type of authentication (bean or container).

Example:

<resource-ref>

<res-ref-name>EmployeeAppDB</res-ref-name>

<jndi-name>enterprise/databases/HR1984</jndi-name>

</resource-ref>

Elements that can be defined within the element are:

  • res-ref-name—Name of the resource factory reference name. The resource factory reference name is the name of the application client's environment entry whose value contains the JNDI name of the data source.

  • jndi-name—JNDI name for the resource.