LazyInitializationException while running a custom LiveReport

Which IIQ version are you inquiring about?

Version 8.4p1

Please share any images or screenshots, if relevant.


Please share any other relevant files that may be required (for example, logs).

BMC-LCM-Report.xml (11.8 KB)
log4j logs.txt (4.5 KB)

Share all details about your problem, including any error messages you may have received.

I am running a custom liveReport which was executing successfully until Dec 2024. After we upgraded IIQ to 8.4p1, we started facing LazyInitializationException for few reports, I have attached one report here. (I am not sure if the exception is because of the upgrade, but there has been no code changes to these reports since Dec 2024 and started failing all of a sudden)

So in this report, if I remove the manager ReportColumnConfig, the report executes successfully.
So I figured the issue is in this specific column where we are trying to fetch the manager of the identity.

The print statements where it is printing networkLoginId 2 and Manager Status is getting printed successfully (only for Debug purpose), but the third print statement highlighted is not being printed or returning anything.

This is probably because only a reference to the manager is saved rather than the entire object when you cache the original identity. You could do something like this:

<ReportColumnConfig field="manager" header="Manager" property="target" width="110">
   <RenderScript>
   	<Source>
   		<![CDATA[
   			import java.util.Iterator;

   			import sailpoint.object.Filter;
   			import sailpoint.object.Identity;
   			import sailpoint.object.QueryOptions;

   			String idName = value; // get value of AuditEvent.target

   			// projection query: target's manager's name
   			QueryOptions qo = new QueryOptions();
   			Filter f = Filter.eq("name", idName);
   			qo.add(f);
   			Iterator itery = context.search(Identity.class, qo, "manager.name");
   			Object[] objectInfo = itery.next();
   			String managerName = objectInfo[0];

   			return managerName;
   		]]>
   	</Source>
   </RenderScript>
</ReportColumnConfig>

Try putting a primitive in your renderCache (string) instead of an object.

Try to start small with just your first two columns with this code and see if that works.

<ReportColumnConfig field="target" header="Employee No." property="target" sortable="true" width="110">
  <RenderScript>
    <Source>
      import sailpoint.object.Identity;
      
      if (null != value) {
        String user = value.replaceAll("Identity:", "").replaceAll("Identity :", "");
        Identity id = context.getObjectByName(Identity.class, user);
      
        if (id != null) {
          renderCache.put("identityName", user);
          return user;
        }
      }
    </Source>
  </RenderScript>
</ReportColumnConfig>
<ReportColumnConfig field="created" header="created" property="created" sortable="true" width="110">
  <RenderScript>
    <Source>
      import sailpoint.object.Identity;

      Identity id = (Identity) context.getObjectByName(Identity.class, renderCache.get("identityName"));
      
      return (null != id) ? id.getCreated() : null;
    </Source>
  </RenderScript>
</ReportColumnConfig>

@Priyanka_BMC
It looks like you’ve saved the complete identity object in the renderCache under the key “id.” Instead, save just the name or ID. You can retrieve the identity later using that name or ID.

I tried this code and received the below error.

Exception encountered while executing Report. Exception: sailpoint.tools.GeneralException: The application script threw an exception: java.util.NoSuchElementException: No more results BSF info: script at line: 0 column: columnNo

There’s probably someone without a manager. Try checking if itery.hasNext() before calling next(); you can return null otherwise.

Yes, I have tried this, with just 2 columns, 3 columns, infact with all columns except manager, the report executes successfully.

Can you provide the current version of your RenderScript for the manager column?

I added a null check and it returned ‘No manager found’ for all identities. I have tried this in Production and all of our identities are provisioned only if they have a manager. So the way your code is fetching manager details does not seem correct.

Did you set property="target"?