users@glassfish.java.net

Re: Using Hibernate on Glassfish?

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Wed, 04 May 2011 23:51:29 +0530

On Wednesday 04 May 2011 11:45 PM, Laird Nelson wrote:
> On Wed, May 4, 2011 at 9:11 AM, Sahoo <sanjeeb.sahoo_at_oracle.com
> <mailto:sanjeeb.sahoo_at_oracle.com>> wrote:
>
> If you don't want every application to see every jar that
> Hobernate uses, there is a better solution which will allow you to
> install multiple versions of Hibernate in GlassFish and yet share
> it by different applications. Do the following:
>
> copy hobernate and its dependencies into a directory called
> domain1/lib/applib/hibernate-xxx/
> create an empty jar in domain1/lib/applib/hibernate-latest.jar
> with MANIFEST.MF having Class-Path entry set to all hibernate
> jars. e.g., it may look like this:
> Class-Path: hibernate-xxx/foo.jar hibernate-xxx/bar.jar ...
>
> From each that uses this version of hibernate, specify --library
> hibernate-xxx.jar while deploying.
>
>
> Last dumb question: is there an asadmin command to install a library
> under applib?
No. Just use cp or rm to manage them.
> (It just now dawned on me this is all section EE.8.2.2 of the Java EE
> specification...duh.)
No, it is not same as that spec section. The spec talks about extensions
which is similar but not same as --applib. We could have re-implemented
our extension library support on top of --applib mechanism, but we
didn't - don't ask me why.
> I looked at the output of asadmin list-commands but didn't see
> anything obvious.
>
> Is a restart required, or can I copy libraries into applib and then
> have the --library option to the deploy subcommand recognize them?
No need to restart.