Glassfish Share Libraries, just copy your .jar libraries in one of the following directories and reinicia Glassfish
.
- Glassfish-3.1.2 \ glassfish \ domains \ domain1 \ lib: that
will share libraries among all applications deployed in
domain1
- Glassfish-3.1.2 \ glassfish \ lib: which will share the libraries
among all applications deployed in all domains.
According to the Glass Fish documentation:
Application-Specific Class Loading
[...] You can specify module- or application-specific library classes
[...] Use the asadmin deploy command with the --libraries option and
specify comma-separated paths [...]
Circumventing Class Loader Isolation
Since each application or individually deployed module class loader
universe is isolated, an application or module can not load classes
from another application or module. This prevents two similarly named
classes in different applications or modules from interfering with
each other.
To circumvent this limitation for libraries, utility classes, or
Individually deployed modules accessed by more than one application,
you can include the relevant path to the required classes in one of
these ways:
Translation
Since each application or universe of module class loader
individually displayed is isolated, an application or module does not
You can load classes from another application or module. This prevents two
classes with similar names in different applications or modules
interfere with each other.
To avoid this limitation for bookstores, the classes of
utility or individually deployed modules that access more than
an application, you can include the relevant route to the classes
required in one of these ways
- Using Common Class Loader
- Sharing Libraries through Cluster
- Packaging the Client JAR for an Application in another Application
Using the Common Class Loader
To use the Common class loader, copy the JAR files into the
domain-dir / lib or as-install / lib directory or copy the .class files
(and other needed files, such as .properties files) into the
domain-dir / lib / classes directory, then restart the server.
Using the Common class loader makes an application or module
accessible to all applications or modules deployed on servers that
share the same configuration. However, this accessibility does not
extend to application clients. For more information, see Using
Libraries with Application Clients. [...]
Translation
To use the Common class Loader, copy the JAR files to the
domain-dir / lib directory or in the as-install / lib directory or copy
.class files (and other necessary files, such as files)
.properties) in the domain-dir / lib / classes, then restart the
server.
Using the Commom class Loader makes an application or module to be
accessible for all applications or modules implemented in
servers that share the same configuration. However, this
Accessibility does not extend to the clients of the application. For
For more information, see Using libraries with clients from
applications.