faces-config.xml errors with JEE 8 and JSF 2.3
Answered
When i updated my projects to JEE 8 and JSF 2.3, IDEA shows the faces config with red text saying the properties of the XML are wrong, see pic below.
is there any problem in the namespaces?
I take the namespaces from here: https://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html#8
Please sign in to leave a comment.
Hello,
Is it possible to share sample project for investigation?
Yes, if you clone this project: https://github.com/arthurgregorio/web-budget
Just open the faces-config.xml on IDEA 2018.2.4 (the version i use) and you will see all the red lines on the file.
Arthur,
Adding "jsf-impl" dependency should help:
Strange,
Using JEE 7 (and without JSF jar on my POM), this behavior doesn't happen
but now is ok, i'm declared jsf 2.3 impl and the faces-config is now recognized
That dependency is for JSF 2.2, for instance these give an error on XML faces-config versión declaration. I suggest to use Java EE 8 JSF Reference Implementation:
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.4.0</version>
</dependency>
That solve the problem, zero error !
why depend on it with no
?
I had approximately the same issue. Yaroslav Bedrov's suggestion to add "jsf-impl" dependency did worked and code compiled, but the web-app started with errors.
What really helped and solved the issue is Thewriteraddict's suggestion. I added this dependency:
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.4.0</version>
</dependency>
and all is perfect now!!! Big thanx to you Mr. Thewriteraddict !
Hi.
Hi. The right version to use is 2.3.x.
Accordingly to this post from BalusC https://balusc.omnifaces.org/2018/04/do-not-use-orgglassfish-mojarra-240.html
"...
No, JSF 2.4 is not there yet. Technically speaking, Mojarra 2.4.0 represents the latest state of the master branch as it was during the transfer from Oracle to Eclipse. That transfer took place when JSF 2.3 specification was already released and JSF 2.4 specification has still to be started yet. JSF 2.4 is far from being a beta, let alone a reasonable snapshot. And yet there is a Mojarra 2.4.0 in Maven instead of e.g. a Mojarra 2.4.0-M1. As per the agreement between Oracle and Eclipse, it was necessary to release the latest work on Mojarra under Oracle's umbrella into Maven Central before the transfer to Eclipse was completed, and this had to be done without making any code modifications, even pom.xml version changes are not allowed. And later Eclipse will do the same after the transfer is completed so that the integrity can be validated by the public. Using version "2.4.0" is indeed way too confusing for the public, because does actually not at all represent a real "2.4.0" version, but it is what it is.
In other words, you should not use it. A few days later, Mojarra 2.3.4 was also released. Use this instead.
..."