6

Whenever I deploy a war to wildfly 8 or 10 (in this case it's a jax-rs service), I see the following line

[javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 151) Initializing Mojarra 2.2.11-jbossorg-1 20150505-1501 for context

Since JSF is not used in the application, is there a way to stop mojarra from being initialized?

Chris Pike
  • 272
  • 2
  • 10

2 Answers2

7

Add a jboss-deployment-structure.xml file to your WEB-INF folder to stop deployment for a single war

<jboss-deployment-structure>
  <deployment>
    <exclude-subsystems>
      <subsystem name="jsf" />
    </exclude-subsystems>
  </deployment>
</jboss-deployment-structure>
Chris Pike
  • 272
  • 2
  • 10
  • I added it to the WEB-INF folder but it didn't have any effect. Do we have to add it to the WEB-INF folder or the META-INF folder ? I'm asking as the project I'm involved in, someone already has added a jboss-deployment-structure.xml file in META-INF folder. Don't know if that works though. – IshanAg24 Feb 14 '20 at 11:45
  • 1
    The correct XML should have the namespace declaration: xmlns="urn:jboss:deployment-structure:1.3" – Shine Developer Sep 18 '21 at 12:50
4

You can remove

<subsystem xmlns="urn:jboss:domain:jsf:1.0"/>

from your profile. It should stop Mojarra initialization.

jithin iyyani
  • 751
  • 1
  • 7
  • 19
  • afaik, JSF is only 'enabled' if required (lazy loaded). So if you disable it like the answer suggests, I think you get different errors (since it does seem to be required in one way or another) – Kukeltje Feb 02 '17 at 12:10
  • If its lazy loaded why is the class being initialized ? Have you tried this ? Server boots up fine. I think you get different errors (since it does seem to be required in one way or another) Kindly try and then reply back, I'll wait – jithin iyyani Feb 03 '17 at 06:41