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

Document Information

Preface

Part I Development Tasks and Tools

1.  Setting Up a Development Environment

2.  Class Loaders

The Class Loader Hierarchy

Delegation

Using the Java Optional Package Mechanism

Using the Endorsed Standards Override Mechanism

Class Loader Universes

Application-Specific Class Loading

Circumventing Class Loader Isolation

Using the Common Class Loader

Sharing Libraries Across a Cluster

Packaging the Client JAR for One Application in Another Application

To Package the Client JAR for One Application in Another Application

3.  Debugging Applications

Part II Developing Applications and Application Components

4.  Securing Applications

5.  Developing Web Services

6.  Using the Java Persistence API

7.  Developing Web Applications

8.  Using Enterprise JavaBeans Technology

9.  Using Container-Managed Persistence

10.  Developing Java Clients

11.  Developing Connectors

12.  Developing Lifecycle Listeners

13.  Developing OSGi-enabled Java EE Applications

Part III Using Services and APIs

14.  Using the JDBC API for Database Access

15.  Using the Transaction Service

16.  Using the Java Naming and Directory Interface

17.  Using the Java Message Service

18.  Using the JavaMail API

Index

Application-Specific Class Loading

You can specify module- or application-specific library classes during deployment in one of the following ways:


Note - The Libraries field in the Administration Console's deployment page and the ----libraries option of the asadmin deploy command do not apply to application clients. For more information, see Using Libraries with Application Clients.


You can only specify module- or application-specific library classes during deployment. You can update a library JAR file using dynamic reloading or by restarting (disabling and re-enabling) a module or application. To add or remove library JAR files, you must redeploy the module or application.

Application libraries are included in the Applib class loader. Paths to libraries can be relative or absolute. A relative path is relative to domain-dir/lib/applibs. If the path is absolute, the path must be accessible to the domain administration server (DAS). The GlassFish Server automatically synchronizes these libraries to all remote cluster instances when the cluster is restarted. However, libraries specified by absolute paths are not guaranteed to be synchronized.


Tip - You can use application-specific class loading to specify a different XML parser than the default GlassFish Server XML parser.

You can also use application-specific class loading to access different versions of a library from different applications.


If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared. This can reduce the memory footprint and allow sharing of static information. However, applications or modules using application-specific libraries are not portable. Other ways to make libraries available are described in Circumventing Class Loader Isolation.

One library cannot reference classes from another library.

For general information about deployment, including dynamic reloading, see the Oracle GlassFish Server 3.1 Application Deployment Guide.


Note - If you see an access control error message when you try to use a library, you may need to grant permission to the library in the server.policy file. For more information, see Changing Permissions for an Application.