ZuzEL
ZuzEL

Reputation: 13655

How do I disable app server embedded library(jar) for a particular WAR or EAR?

Sometimes you may have a third party libraries in your project which can cause conflicts with you server-embedded jars. Removing embedded jars from your application server lib folder can break other deployed apps.

Is there a way to disable server-embedded jars for only one project in TomEE, JBoss, GlassFish?

enter image description here

Upvotes: 2

Views: 2697

Answers (1)

codethulhu
codethulhu

Reputation: 3996

In JBoss, you can disable container managed libraries with a jboss-deployment-structure.xml descriptor in your WEB-INF directory.

<jboss-deployment-structure>
  <deployment>
    <!-- Exclusions allow you to prevent the server from automatically adding
      some dependencies -->
    <exclusions>
      <!-- This will cause the JBoss container to not provide your deployed 
         application's log4j dependencies. This way you can use an implementation 
         deployed with your artifact. -->
      <module name="org.apache.log4j" />
    </exclusions>
  </deployment>
</jboss-deployment-structure>

The documentation for class loading in JBoss AS 7 can be found here.

Upvotes: 6

Related Questions