Stop wildfly war from initializing mojarra
Asked Answered
C

2

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?

Cay answered 27/1, 2017 at 20:40 Comment(4)
Do you have faces-config.xml file in your WEB-INF/ folder? This might have been an implicit dependency.Brookner
I did at one point, but removing it had no effectCay
Are you by chance including any JSF dependencies in your deployment?Fiddlehead
None that I can seeCay
F
4

You can remove

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

from your profile. It should stop Mojarra initialization.

Falkirk answered 2/2, 2017 at 11:8 Comment(2)
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)Coulson
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 waitFalkirk
C
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>
Cay answered 6/2, 2017 at 14:57 Comment(2)
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.Keddah
The correct XML should have the namespace declaration: xmlns="urn:jboss:deployment-structure:1.3"Parsley
F
4

You can remove

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

from your profile. It should stop Mojarra initialization.

Falkirk answered 2/2, 2017 at 11:8 Comment(2)
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)Coulson
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 waitFalkirk

© 2022 - 2024 — McMap. All rights reserved.