2

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

ZuzEL
  • 12,768
  • 8
  • 47
  • 68

1 Answers1

6

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.

codethulhu
  • 3,976
  • 2
  • 21
  • 15