diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java index dec3e23f9..ad88d036e 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java @@ -120,8 +120,9 @@ public class SQLErrorCodeReader { short nodeType = child.getNodeType(); if (nodeType == Node.ELEMENT_NODE) { String errorType = child.getNodeName(); - if (storeErrorTypes.containsKey(errorType)) { - String errorCodes = child.getTextContent(); + Node textNode = child.getFirstChild(); + if (storeErrorTypes.containsKey(errorType) && textNode != null){ + String errorCodes = textNode.getNodeValue(); if (!StringUtils.isEmpty(errorCodes)) { String[] codes = errorCodes.split(ERROR_CODE_DELIMITER); for (String code : codes) {