GetAttributeData() Method Returns Null In One Environment But Works In Another Environment (Doc ID 1676527.1)

Last updated on JANUARY 05, 2016

Applies to:

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

Symptoms

The MutableAssetData getAttributeData method returns null on Stage but works on Dev.

Below is the scenario:

Have a utility designed to update a page attribute with existing data from a page.

When running this utility on the dev server, it works properly as designed.

When running this utility on the stage server, see the following issue ...

First, a code snippet that demonstrates the issue:

Session ses = SessionFactory.getSession();
AssetDataManager adm = (AssetDataManager) ses.getManager( AssetDataManager.class.getName() );
AssetId id = new AssetIdImpl("Page", 1356722345466L);

for (MutableAssetData assetdata : adm.readForUpdate(Arrays.asList(id))) {

AttributeData testattrData = assetdata.getAttributeData("testattr");

if (testattrData == null) {
ics.StreamText("testattr is null
");
}
else {
ics.StreamText("testattr is not null
");
}
}

"testattr" is the page attribute that was published from dev to stage.

The output of this test program is as follows ...

On dev: testattrData Data is not null

On stage: testattrData Data is null

The servers are set up the same. The example page (asset id = 1356722345466) was also published from dev to stage.

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