1

I need to use JSF 2.2.5 (instead of 2.2.0) since it solves some issues.

I use Java EE 7 with Netbeans IDE 7.3.1.

My best shot is from following the instructions here https://javaserverfaces.java.net/download.html.

My POM-file now looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.company.testbench.facelets</groupId>
  <artifactId>Facelets</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>

  <name>Facelets</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.faces</artifactId>
            <version>2.2.5</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <webXml>src\main\webapp\WEB-INF\web.xml</webXml>
                    <failOnMissingWebXml>true</failOnMissingWebXml>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

But my application still uses Mojarra 2.2.0 and not 2.2.5.

These are my indicators that my application indeed use Mojarra 2.2.0:

  1. FacesContext.getCurrentInstance().getClass().getPackage().getImplementationVersion() returns 2.2.0
  2. f:viewParam will not work if I use xmlns:f="http://xmlns.jcp.org/jsf/core" but only if I change to xmlns:f="http://java.sun.com/jsf/core" (bug that should be solved in 2.2.1)

Where do I go wrong? Thanks in advance.

AnnTea
  • 532
  • 7
  • 15
  • 1
    [How to update Mojarra version in GlassFish](http://stackoverflow.com/a/10784147) could help. – lefloh May 08 '14 at 17:38
  • Thanks lefloh, that showed me a new direction. I added the two entries to the glassfish-web.xml, and with that the Glassfish log now states "Initializing Mojarra 2.2.5" which seems to be a big step forward. However I now get errors and my CDI does not work, thus my Facelets do not get access to my backing beans. – AnnTea May 08 '14 at 19:56
  • Part of one of the errors: "org.glassfish.weld.jsf.WeldFacesConfigProvider cannot be cast to com.sun.faces.spi.ConfigurationResourceProvider". I am not sure what to look for next, maybe if it is at all possible to use those two dependencies in conjunction, or why the javax.faces artifact contains com.sun.faces.* packages. Well really I just want to use Mojarra 2.2.5. – AnnTea May 08 '14 at 19:58

0 Answers0