javaeetutorial
  1. javaeetutorial
  2. JAVAEETUTORIAL-238

NullPoint error in chapter 8.5 Composite Components example code.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 7.0.1
    • Fix Version/s: None
    • Component/s: examples
    • Labels:
      None
    • Environment:

      Java EE 7
      GlasshFish 4.0

      Description

      I am reading The Java EE 7 Tutorial from http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets005.htm#GIQZR

      After I typed the example code in the chapter 8.5 Composite Components in my IDE and run the example on GlassFish4.0, I got an error.

      java.lang.NullPointerException
      at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1078)
      at com.sun.faces.util.Cache.get(Cache.java:116)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.getComponentMetadata(FaceletViewHandlingStrategy.java:237)
      at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:951)
      at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:648)

      Then I check the older version of this tutorial, I found a difference in email.xhtml code. The namespace has been changed from Java EE 7. After I changed the namespace back to JavaEE 6 version, it works.

      Java EE 7

      xmlns:composite="http://xmlns.jcp.org/jsf/composite"

      Java EE 6

      xmlns:composite="http://java.sun.com/jsf/composite"

        Issue Links

          Activity

          Hide
          Kim Haase added a comment -

          I believe this is essentially a duplicate of https://java.net/jira/browse/JAVASERVERFACES-2868 (of which https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1213 is also a duplicate, I believe). Several components do not work correctly with the new xmlns.jcp.org namespace at the first release of JSF 2.2. The fix for this problem will be in the next released version of JSF 2.2.x.

          We document the namespaces the way they are supposed to work, rather than document the incorrect behavior. The facelets pages for the tutorial examples that use composite components (and a few other components) use the java.sun.com namespace so that the examples will run.

          Show
          Kim Haase added a comment - I believe this is essentially a duplicate of https://java.net/jira/browse/JAVASERVERFACES-2868 (of which https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1213 is also a duplicate, I believe). Several components do not work correctly with the new xmlns.jcp.org namespace at the first release of JSF 2.2. The fix for this problem will be in the next released version of JSF 2.2.x. We document the namespaces the way they are supposed to work, rather than document the incorrect behavior. The facelets pages for the tutorial examples that use composite components (and a few other components) use the java.sun.com namespace so that the examples will run.
          Hide
          Ian Evans added a comment -
          Show
          Ian Evans added a comment - Duplicate of JAVASERVERFACES_SPEC_PUBLIC-1213 .

            People

            • Assignee:
              Kim Haase
              Reporter:
              evil850209
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: