users@glassfish.java.net

Re: Deploying JAR library to glassfish

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Tue, 31 Oct 2006 21:43:16 +0530

Kenneth Clark wrote:
> Hi guys
>
> Is there a way to deploy a JAR library through the admin console on
> Glassfish or do I have to copy it directly to the file system?
There is no mechanism to "deploy" a jar library through the admin console.
>
> I have a set of domain objects that I need multiple web services to
> reference and I don't want to package the library with every webservice
On the other hand, you could leverage the "libraries" [1] feature
detailed at [2] for this usecase. The common library jar [say foo.jar]
could be copied to domains/domain1/lib/applibs and each webservice could
then be deployed with its libraries attribute pointing to "foo.jar". The
utility foo.jar would then be "shared" [ie one copy, shared state etc]
across all the webservices deployed with libraries attribute as "foo.jar"

If you do not want to mark each application as shown above and merely
want to share this jar across all applications in your domain, you could
- copy foo.jar to domains/domain1/lib
- restart domain
- deploy your application(s).

Thanks
--Siva.
[1] https://glassfish.dev.java.net/nonav/javaee5/docs/DG/beade.html#gatej
[2] Refer to the FAQ on application scoping at
http://blogs.sun.com/sivakumart/entry/classloaders_in_glassfish_an_attempt

>
> I tried the Application Client Modules deployment link but it returns an
> error saying it can't establish what type of module the JAR is.
>
> Like I said, it is only a library, do I still need to add deployment
> descriptors and if yes, which ones?
>
> Thanks
> Kenneth
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>