Null AttributeData In AssetData Returned From mgr.readAttributes() Method (Doc ID 1513775.1)

Last updated on JANUARY 01, 2016

Applies to:

Oracle WebCenter Sites - Version 7.6.2 and later
Information in this document applies to any platform.

Symptoms

After upgrade from 7.5.4 to 7.6 patch 2, a custom element querying Page data via assetapi that was working fine before, now suddenly throws a NullPointerException.

The custom element have similar code as below where one of the AttributeData in AssetData returned from the mgr.readAttributes() method is actually a null.  Calling the getAttributeName() method off the null AttributeData would result in a NullPointerException.

AssetData data = mgr.readAttributes(id,attrNames);
for( AttributeData assetdata : data.getAttributeData() ) {
// one of the assetdata is null which will trigger a NullPointerException here
    String keystring = assetdata.getAttributeName();
}

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms