Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-13740

Richfaces 4.5 with MyFaces causes NPE on AJAX requests

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 4.5.0.Alpha3
    • Fix Version/s: 4.5.0.Beta1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Simpleapp archetype
      Firefox/Chrome
      Myfaces (I tried with several latest versions)
      Tomcat 7

    • Steps to Reproduce:
      Hide
      • Get 4.5.0.Alpha3 archetype of simpleapp-test with following command:

        mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes -DarchetypeArtifactId=richfaces-archetype-simpleapp -DarchetypeVersion=4.5.0.Alpha3 -DgroupId=org.richfaces.test -DartifactId=simpleapp-test -Denterprise=false -Dmobile-optimized=false

      • Change the pom.xml to use myfaces as JSF impl
        • remove javax-faces dependency
        • add following dependencies(set versions):

          <dependency>
                  <groupId>org.apache.myfaces.core</groupId>
                  <artifactId>myfaces-api</artifactId>
                  <version>chooseVersion</version>
              </dependency>
              <dependency>
                  <groupId>org.apache.myfaces.core</groupId>
                  <artifactId>myfaces-impl</artifactId>
                  <version>chooseVersion</version>
              </dependency>
          

      • Build archetype with mvn clean install
      • Start Tomcat 7 and deploy app
      • Go to app page
      • Try typing something
        • EXPECTED: The welcome message changes accordingly to what you type
        • ACTUAL: The welcome message stays the same all the time
      • Open browser console, you can see that any request (invoked by typing) has error in response
      Show
      Get 4.5.0.Alpha3 archetype of simpleapp-test with following command: mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes -DarchetypeArtifactId=richfaces-archetype-simpleapp -DarchetypeVersion=4.5.0.Alpha3 -DgroupId=org.richfaces.test -DartifactId=simpleapp-test -Denterprise=false -Dmobile-optimized=false Change the pom.xml to use myfaces as JSF impl remove javax-faces dependency add following dependencies(set versions): <dependency> <groupId>org.apache.myfaces.core</groupId> <artifactId>myfaces-api</artifactId> <version>chooseVersion</version> </dependency> <dependency> <groupId>org.apache.myfaces.core</groupId> <artifactId>myfaces-impl</artifactId> <version>chooseVersion</version> </dependency> Build archetype with mvn clean install Start Tomcat 7 and deploy app Go to app page Try typing something EXPECTED: The welcome message changes accordingly to what you type ACTUAL: The welcome message stays the same all the time Open browser console, you can see that any request (invoked by typing) has error in response

      Description

      When you deploy RichFaces 4.5 application with MyFaces as JSF implementation to Tomcat, any Ajax request will get NPE in a response. Therefore the whole application will not work.

      Easiest way to reproduce this is with archetypes - see steps to reproduce.
      But it can be also reproducer with Metamer (generate WAR file with myfaced and deploy to Tomcat 7)

      This is how the Ajax response looks like:

      <partial-response>
      <error>
      <error-name>java.lang.NullPointerException</error-name>
      <error-message></error-message>
      </error>
      <changes>
      <extension id="org.richfaces.extension">
      <render>output</render>
      </extension>
      </changes>
      </partial-response>
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                michpetrov Michal Petrov
                Reporter:
                manovotn Matej Novotny
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: