JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Application Deployment Guide
search filter icon
search icon

Document Information


1.  Overview of Oracle GlassFish Server 3.1 Application Deployment

2.  Deploying Applications

Deploying Applications and Modules

To Deploy an Application or Module

To Change Targets for a Deployed Application or Module

To List Deployed Applications or Modules

To Redeploy an Application or Module

To Disable an Application or Module

To Enable an Application or Module

To Undeploy an Application or Module

To Reload Changes to Applications or Modules Dynamically

To Deploy an Application or Module Automatically

To Deploy an Application or Module by Using a Deployment Plan

To Deploy an Application or Module in a Directory Format

Modifying the Configuration of a Web Application or Module

To Set a Web Context Parameter

To Unset a Web Context Parameter

To List Web Context Parameters

To Set a Web Environment Entry

To Unset a Web Environment Entry

To List Web Environment Entries

Web Module Deployment Guidelines

EJB Module Deployment Guidelines

Deploying a Connector Module

To Deploy and Configure a Stand-Alone Connector Module

Redeploying a Stand-Alone Connector Module

Deploying and Configuring an Embedded Resource Adapter

Assembling and Deploying an Application Client Module

To Assemble and Deploy an Application Client

To Prepare Another Machine for Running an Application Client

To Undeploy an Application Client

Lifecycle Module Deployment Guidelines

Web Service Deployment Guidelines

OSGi Bundle Deployment Guidelines

Transparent JDBC Connection Pool Reconfiguration

Application-Scoped Resources

A.  The asadmin Deployment Subcommands

B.  GlassFish Server Deployment Descriptor Files

C.  Elements of the GlassFish Server Deployment Descriptors


Application-Scoped Resources

You can define an application-scoped JDBC resource or other resource for an enterprise application, web module, EJB module, connector module, or application client module. This allows single-step deployment for resource-dependent modules and applications. An application-scoped resource has the following characteristics:

The following resource types can be application-scoped:

Deployment Descriptor. An application-scoped resource is defined in the glassfish-resources.xml deployment descriptor file. This file is placed in the META-INF directory of the module or application archive. For web applications or modules, this file is placed in the WEB-INF directory. If any submodule archives of an enterprise application archive have their own glassfish-resources.xml files, the resource definitions are scoped to those modules only. For more information about the glassfish-resources.xml file, see Appendix B, GlassFish Server Deployment Descriptor Files and Appendix C, Elements of the GlassFish Server Deployment Descriptors.

Naming. Application-scoped resource JNDI names begin with java:app or java:module. If one of these prefixes is not specified in the JNDI name, it is added. For example, application-scoped databases have JNDI names in the following format: java:app/jdbc/DataSourceName or java:module/jdbc/DataSourceName. This is in accordance with the naming scopes introduced in the Java EE 6 Specification.

Errors. Application-scoped resource definitions with same resource name, resource type, attributes, and properties are duplicates. These generate WARNING level log messages and deployment continues. Definitions with the same resource name and type but different attributes or properties are conflicts and cause deployment failure. When an application or module tries to look up a scoped resource that does not belong to it, a naming exception is thrown.

Redeployment. When an application or module is undeployed, its scoped resources are deleted. During redeployment, resources are destroyed and recreated based on changes in the glassfish-resources.xml file. To preserve old resource definitions during redeployment, use the preserveAppScopedResources property of the redeploy (or deploy --force=true) subcommand. For example:

asadmin> redeploy --property preserveAppScopedResources=true MyApp.ear
asadmin> deploy --force=true --property preserveAppScopedResources=true MyApp.ear

For more information, see redeploy(1) and deploy(1).

Listing. Use the --resources option of the list-applications subcommand to list application-scoped resources. Use the --subcomponents option in addition to list scoped resources for enterprise application modules or for module subcomponents. To list scoped resources for subcomponents only, use the --resources option of the list-subcomponents subcommand

For more information, see list-applications(1) and list-sub-components(1).

Restrictions. Use of application-scoped resources is subject to the following restrictions: