2

I'm developping an entreprise application on jboss AS 7.1. I was reading answers to those question (Q1 and Q2) asking for the same problem then mine and the solution was to upgrade to the Mojarra 2.1.9. I'm using maven but i'm not referencing any Mojarra jar dependency as it's provided by jboss server and i don't know which version it uses itself and since those questions have been asked a long time ago then i don't know if the solution is just to add dependencies to my pom to override the version used by jboss(normally, jboss AS 7.1 has overcome this problem already, i don't understand why it still happen to me).. Which version should i add or what is the best solution at this moment ?

Cheers.

Community
  • 1
  • 1
Bardelman
  • 2,176
  • 7
  • 43
  • 70

1 Answers1

3

JBoss AS 7.1.0 ships with Mojarra 2.1.5, so you definitely need to upgrade. Specifically JBoss 7.1.0 has however unfortunately a bug which makes it impossible to upgrade Mojarra from webapp's /WEB-INF/lib on. This was fixed in 7.1.1. For 7.1.0 you need to upgrade Mojarra in JBoss' own modules.

Detailed upgrade instructions for JBoss AS 7.x and EAP 6.x can be found in this answer: Upgrade JSF / Mojarra in JBoss AS / EAP / WildFly.


Update: as per the comments it turns out that you didn't carefully specify the version in the question and you're actually using 7.1.1 which ships with Mojarra 2.1.7 which you also definitely need to upgrade. Just drop the javax.faces.jar file of the desired Mojarra version (currently, 2.1.26 is latest available 2.1.x) in webapp's /WEB-INF/lib and add the following context parameter to webapp's web.xml:

<context-param>
    <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
    <param-value>true</param-value>
</context-param> 
Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Sorry for being not careful.. but i also use jsf 2.2 (set on my project facet) so i was looking in https://javaserverfaces.java.net/download.html and found the javax.faces-api 2.2 and added it to my pom.. i hope it's suitable too – Bardelman Nov 27 '13 at 10:36
  • there is any jsf-impl-xxx.jar for the jsf 2.2, is the javax.faces-api.jar alone is enough ? – Bardelman Nov 27 '13 at 10:39
  • Supplying JSF 2.2 from webapp side is not supported in JBoss 7.1.x. It'll only run in JSF 2.1 modus and you won't be able to use the new JSF 2.2 specific features. You'd better stick to JSF 2.1. As to Maven, it really doesn't matter to me what it is doing and how you configure it, but it should ultimately put either the single `javax.faces.jar` file, **or** the two `jsf-api.jar`+`jsf-impl.jar` files in the `/WEB-INF/lib` of the built WAR. Do a build/export of WAR and verify yourself if Maven did it right. – BalusC Nov 27 '13 at 10:45
  • Steps for deploying jsf 2.2.1 in jboss AS 7.1.1 https://community.jboss.org/thread/203257 , it worked great for me ! – Bardelman Nov 27 '13 at 13:20