Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Duffymo's directive on not putting jars in <strong><em>endorsed</em></strong> is ignored at your peril.</p> <p>In some additional detail:</p> <p>Placing libraries in your <strong>WEB-INF/lib</strong> is a best practice for portability and consistency as it adheres to a standard provision for creating self-sufficient and distributable web archives, but you need to pay close attention to the <strong>class-loading</strong> declaration you're putting in your <strong>jboss-web.xml</strong>.</p> <p>Assume a simple scenario <em>without</em> the <strong>class-loading</strong> declaration and a fictional <strong>example.jar</strong>:</p> <ul> <li>If you place <strong>example.jar</strong> in <strong>WEB-INF/lib</strong> <em>and</em> it does <strong><em>not</em></strong> also exist in <strong>jboss//lib</strong>, then <strong>example.jar</strong> will only be visible to that specific WAR.</li> <li>If you place <strong>example.jar</strong> in <strong>WEB-INF/lib</strong> <em>and</em> it <strong><em>does</em></strong> also exist in <strong>jboss//lib</strong>, the instance in <strong>WEB-INF/lib</strong> will essentially be ignored and the WAR will use the JBoss server instance's unified class loader to load the <strong>example</strong> classes from <strong>jboss//lib/example.jar</strong>. (The same would apply to any other WARs or EARs in the same server instance, assuming no <strong>class-loading</strong> overrides.)</li> </ul> <p>The <strong>class-loading</strong> declaration is necessary in cases (such as) where you have two different versions of <strong>example.jar</strong>: - jboss//lib: example1.0.jar - WEB-INF/lib: example2.0.jar</p> <p>In this case, JBoss will create a unique and isolated classloader for your WAR which will avoid <strong>jboss//lib/example1.0.jar</strong> in favour of <strong>WEB-INF/lib/example2.0.jar</strong> in the context of your WAR.</p> <p>In summary, if you're only running one WAR in the jboss server instance and/or you have no conflicting JAR issues, ditch the <strong>class-loading</strong> declaration and put your JARs in <strong>jboss//lib</strong>. It makes the WAR file more lightweight, overall deployment <em>may</em> be simpler and you will not consume additional memory with extra class versions during hot-deploys.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload