Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-592

NullPointerException in JcrNodeDefinition.ensureRequiredPrimaryTypesLoaded()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 0.7
    • 0.7
    • None
    • None
    • Workaround Exists
    • Hide

      See comments.

      Show
      See comments.

    Description

      Using the attached CND file, the repository set-up fails with an NPE when attempting to resolve node types. (ala config.repository(xxxxxx).addNodeTypes('test_cnd.cnd')

      java.lang.NullPointerException
      at org.jboss.dna.jcr.JcrNodeDefinition.ensureRequiredPrimaryTypesLoaded(JcrNodeDefinition.java:113)
      at org.jboss.dna.jcr.JcrNodeDefinition.getRequiredPrimaryTypes(JcrNodeDefinition.java:161)
      at org.jboss.dna.jcr.RepositoryNodeTypeManager.validate(RepositoryNodeTypeManager.java:1938)
      at org.jboss.dna.jcr.RepositoryNodeTypeManager.validate(RepositoryNodeTypeManager.java:1861)
      at org.jboss.dna.jcr.RepositoryNodeTypeManager.registerNodeTypes(RepositoryNodeTypeManager.java:1513)
      at org.jboss.dna.jcr.JcrEngine.doCreateJcrRepository(JcrEngine.java:246)
      at org.jboss.dna.jcr.JcrEngine.getRepository(JcrEngine.java:161)

      My original DDL seqencer cnd is much more complex, but by paring it down to the following, the error still occured.

      //------------------------------------------------------------------------------
      // N A M E S P A C E S
      //------------------------------------------------------------------------------
      <jcr='http://www.jcp.org/jcr/1.0'>
      <nt='http://www.jcp.org/jcr/nt/1.0'>
      <mix='http://www.jcp.org/jcr/mix/1.0'>
      <ddl='http://jboss.org/dna/ddl/1.0'>

      [ddl:statement] mixin abstract

      • ddl:expression (string) mandatory
        + * (ddl:ddlProblem) = ddl:ddlProblem multiple

      [ddl:schemaDefinition] > ddl:statement mixin

      • ddl:defaultCharacterSetName (STRING)
        + * (ddl:ddlStatement) = ddl:ddlStatement multiple

      [ddl:ddlProblem] mixin

      • ddl:problemLevel (LONG) mandatory
      • ddl:message (STRING) mandatory

      The [ddl:schemaDefinition] mixin is the ONLY mixin that both extends a mixin and allows children of the same mixin type (i.e. [ddl:statement]) however the NPE is occuring when attempting to find the primary node type for [ddl:ddlProblem]

      Note that the NPE does not occur when the [ddl:schemaDefinition] type is removed.

      Attachments

        1. DNA_591_Test.java
          5 kB
        2. DNA-591_clean.patch
          12 kB
        3. DNA-591.patch
          2 kB
        4. test_cnd.cnd
          2 kB

        Issue Links

          Activity

            People

              bcarothers_jira Brian Carothers (Inactive)
              blafond Barry LaFond
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: