We are using SailPoint IdentityIQ with a Web Services connector and an After Rule that parses an XML response returned by the target system.
This logic was working correctly when IdentityIQ was running on Java 11, but after upgrading the runtime to Java 17, aggregation now fails with an exception related to DocumentBuilderFactory.
Exception during aggregation of Object Type Group on Application iBusiness-API.
Reason: java.lang.RuntimeException: sailpoint.connector.ConnectorException:
Error: BeanShell script error:
bsh.EvalError: Typed variable declaration :
Error in method invocation:
Cannot access method newDocumentBuilder() in
class com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
java.lang.IllegalAccessException:
class bsh.Reflect cannot access
class com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
(in module java.xml) because module java.xml does not export
com.sun.org.apache.xerces.internal.jaxp to unnamed module
and the script is
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Log log = LogFactory.getLog(“xyz.ParseUserTemplates.AfterRule”);
Map updatedMapInfo = new HashMap();
if (rawResponseObject != null) {
String cleanedResponse = rawResponseObject
.replace("", "a")
.replace("&", "a")
.replace("
", "a");
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(
new ByteArrayInputStream(
cleanedResponse.getBytes(StandardCharsets.UTF_8)
)
);
NodeList userTemplateNodes = document.getElementsByTagName("UserTemplate");
List<Map> schemaDataList = new ArrayList();
for (int i = 0; i < userTemplateNodes.getLength(); i++) {
Node userTemplateNode = userTemplateNodes.item(i);
NodeList childNodes = userTemplateNode.getChildNodes();
String id = null;
String name = null;
for (int j = 0; j < childNodes.getLength(); j++) {
Node child = childNodes.item(j);
if (child.getNodeType() == Node.ELEMENT_NODE) {
String nodeName = child.getLocalName();
if ("ID".equals(nodeName)) {
id = child.getTextContent();
} else if ("Name".equals(nodeName)) {
name = child.getTextContent();
}
}
}
if (id != null && name != null) {
Map entry = new HashMap();
entry.put("ID", id);
entry.put("Name", name);
schemaDataList.add(entry);
}
}
updatedMapInfo.put("data", schemaDataList);
return updatedMapInfo;
} catch (Exception e) {
log.error("Error parsing XML document", e);
}
} else {
log.warn(“Raw response object is null”);
}
return updatedMapInfo;