Sun GlassFish Enterprise Server v3 Application Deployment Guide

Deploying a Connector Module

Deploying a standalone connector module allows multiple deployed Java EE applications to share the connector module. A resource adapter configuration is automatically created for the connector module.

The following topics are addressed here:

ProcedureTo Deploy and Configure a Standalone Connector Module

  1. Ensure that the server is running.

    Remote commands require a running server.

  2. Deploy the connector module by using the deploy(1) subcommand.

  3. Configure connector connection pools for the deployed connector module.

    Use the create-connector-connection-pool subcommand. For procedures, see To Create a Connector Connection Pool in Sun GlassFish Enterprise Server v3 Administration Guide.

  4. Configure connector resources for the connector connection pools.

    Use the create-resource-adapter-config subcommand. For procedures, see To Create Configuration Information for a Resource Adapter in Sun GlassFish Enterprise Server v3 Administration Guide. If needed, you can override the default configuration properties of a resource adapter.

    This step associates a connector resource with a JNDI name.

  5. "Configure a resource-adapter.

    Use the create-resource-adapter-config subcommand. For procedures, see To Create Configuration Information for a Resource Adapter in Sun GlassFish Enterprise Server v3 Administration Guide. If needed, you can override the default configuration properties of a resource adapter.

  6. (Optional) If needed, create an administered object for an inbound resource adapter.

    Use the create-admin-object subcommand. For procedures, see To Create an Administered Object in Sun GlassFish Enterprise Server v3 Administration Guide.

Redeploying a Standalone Connector Module

Redeployment of a connector module maintains all connector connection pools, connector resources, and administered objects defined for the previously deployed connector module. You do not need to reconfigure any of these resources.

However, you should redeploy any dependent modules. A dependent module uses or refers to a connector resource of the redeployed connector module. Redeployment of a connector module results in the shared class loader reloading the new classes. Other modules that refer to the old resource adapter classes must be redeployed to gain access to the new classes. For more information about class loaders, see Chapter 2, Class Loaders, in Sun GlassFish Enterprise Server v3 Application Development Guide.

During connector module redeployment, the server log provides a warning indicating that all dependent applications should be redeployed. Client applications or application components using the connector module’s resources may throw class cast exceptions if dependent applications are not redeployed after connector module redeployment.

To disable automatic redeployment, set the --force option to false. In this case, if the connector module has already been deployed, Enterprise Server provides an error message.

Deploying and Configuring an Embedded Resource Adapter

A connector module can be deployed as a Java EE component in a Java EE application. Such connectors are only visible to components residing in the same Java EE application. Deploy this application as you would any other Java EE application.

You can create new connector connection pools and connector resources for a connector module embedded within a Java EE application by prefixing the connector name with app-name#. For example, if an application appX.ear has jdbcra.rar embedded within it, the connector connection pools and connector resources refer to the connector module as appX#jdbcra.

An embedded connector module cannot be undeployed using the name app-name#connector-name. To undeploy the connector module, you must undeploy the application in which it is embedded.

The association between the physical JNDI name for the connector module in Enterprise Server and the logical JNDI name used in the application component is specified in the Enterprise Server–specific XML descriptor sun-ejb-jar.xml.