users@glassfish.java.net

Re: multiple jars and classpaths

From: <Jan.Luehe_at_Sun.COM>
Date: Thu, 23 Aug 2007 13:04:21 -0700

glassfish_at_javadesktop.org wrote:

>>>Is there no way to set a lib path from the admin console?
>>>
>>>
>During deployment, there is a text box for you to list out the extra jar paths, which is equalivant to --libraries option in asadmin deploy command.
>However, this is only available during deployment, if you want to change this, you need to undeploy and then deploy the app again, specifying the new value.
>
>I believe your intension is to NOT have to list out each individual jar files, but just specify the directory where these jars can be found. AFAIK, using this --libraries attribute, you still need to list out the jars one by one, as a classpath, you cannot just specify the directory.
>
>

An alternative to specifying the extra classpath during deployment would
be to specify it
in the webapp's sun-web.xml:

  <sun-web-app>
    <class-loader extra-class-path="WEB-INF/lib/extra/extra.jar"/>
  </sun-web-app>

but that also requires listing each of the extra JAR files (instead of
just the
directory containing them).


Jan


>If you don't mind that this libraries be shared by other applications, you can make use of the common class loader. Just copy the JAR files into the <domain-dir>/lib directory and then restart the server, then you don't even need to list these jars for the web app at all.
>There is a faq blog http://blogs.sun.com/sivakumart/entry/classloaders_in_glassfish_an_attempt
>that may be useful.
>[Message sent by forum member 'anilam' (anilam)]
>
>http://forums.java.net/jive/thread.jspa?messageID=232387
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>