[OPENDJ-1968] NPE in GoverningStructureRuleVirtualAttributeProvider if entry has no structural object classes Created: 27/Apr/15  Updated: 08/Nov/19  Resolved: 16/Jun/15

Status: Done
Project: OpenDJ
Component/s: core server
Affects Version/s: 2.6.0
Fix Version/s: 3.0.0, 2.8.0

Type: Bug Priority: Minor
Reporter: Chris Ridd Assignee: patrick diligent
Resolution: Fixed Votes: 0
Labels: release-notes

Support Ticket IDs:


Reading all operational attributes from the following entry causes a NPE inside the GoverningStructureRuleVirtualAttributeProvider:

dn: ou=dashboardService,ou=services,dc=amreplication,dc=org
objectClass: sunService
objectClass: top
ou: dashboardService
createTimestamp: 20150315093848Z
creatorsName: cn=Directory Manager,cn=Root DNs,cn=config
entryUUID: c5ec06b4-8cad-4bdb-a2d2-7c9ff8ae7ca3
$ bin/ldapsearch -D "cn=Directory manager" -w password -h localhost -p 1389 -b ou=dashboardservice,ou=services,dc=amreplication,dc=org -s base "(&)" +
SEARCH operation failed
Result Code:  80 (Other)
Additional Information:  An unexpected error was encountered while processing a search in one of the Directory Server backends:  NullPointerException()

The schema definition for 'sunService' is not present.

The NPE is thrown at the start of GoverningStructureRuleVirtualAttributeProvider.getDITStructureRule(), because getNameForm is being called with a null oc.

  private DITStructureRule getDITStructureRule(Entry entry)
    ObjectClass oc = entry.getStructuralObjectClass();
    List<NameForm> listForms = DirectoryServer.getNameForm(oc);

Comment by Chris Ridd [ 15/Jun/15 ]

Verified - no NPE is thrown and no structuralObjectClass attribute is returned for the broken entry.

Comment by Mark Craig [ 16/Jun/15 ]

Reopening to add release-notes label

Generated at Fri Oct 23 09:08:37 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.