Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1292

Enabling NIS schema causes core-integ unit test to NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5.5
    • core-integ
    • None

    Description

      [From dev list between Norval Hope and Emmanuel Lecharny, 28/11/2008]

      I attempted to activate the nis.schema by commenting out nis in
      apacheds\bootstrap-partition\pom.xml as follows:

      <plugin>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-bootstrap-plugin</artifactId>
      <configuration>
      <disabledSchemas>
      <!-<disabledSchema>nis</disabledSchema>-> !!!!!!!!!!
      <disabledSchema>krb5kdc</disabledSchema>

      <snip/>

      however after doing that "mvn install" fails as follows:

      <snip/>

      Running org.apache.directory.server.core.suites.SchemaISuite
      javax.naming.NamingException [Root exception is java.lang.NullPointerException]
      at org.apache.directory.server.core.jndi.JndiUtils.wrap(JndiUtils.java:40)
      at org.apache.directory.server.core.jndi.ServerDirContext.modifyAttributes(ServerDirContext.java:260)
      at org.apache.directory.server.core.jndi.ServerDirContext.modifyAttributes(ServerDirContext.java:242)
      at org.apache.directory.server.core.schema.SchemaPersistenceIT.enableSchema(SchemaPersistenceIT.java:149)
      at org.apache.directory.server.core.schema.SchemaPersistenceIT.testAddAttributeTypePersistence(SchemaPersistenceIT.java:81)

      This is a side effect : when you remove the <disable nis> line in the apacheds-bootstrap pom.xml file, this schema is enabled. Now the tests start with :

      public void testAddAttributeTypePersistence() throws Exception
      {
      try
      {
      enableSchema( "nis" );

      which won't work, of course.

      But I must admit that this NPE is obviously a mistake. We should simply return from this method silently if the schema is already enabled.

      Attachments

        Activity

          People

            elecharny Emmanuel Lécharny
            nrhope Norval Hope
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified