List of usage examples for javax.xml.xpath XPathFactoryConfigurationException getMessage
public String getMessage()
From source file:org.wso2.carbon.humantask.core.engine.runtime.xpath.XPathExpressionRuntime.java
private Object evaluate(String exp, EvaluationContext evalCtx, QName type) { try {// ww w. j av a 2 s . co m XPathFactory xpf = new XPathFactoryImpl(); JaxpFunctionResolver funcResolve = new JaxpFunctionResolver(evalCtx); xpf.setXPathFunctionResolver(funcResolve); XPathEvaluator xpe = (XPathEvaluator) xpf.newXPath(); xpe.setXPathFunctionResolver(funcResolve); xpe.setBackwardsCompatible(true); xpe.setNamespaceContext(evalCtx.getNameSpaceContextOfTask()); XPathExpression xpathExpression = xpe.compile(exp); Node contextNode = evalCtx.getRootNode() == null ? DOMUtils.newDocument() : evalCtx.getRootNode(); Object evalResult = xpathExpression.evaluate(contextNode, type); if (evalResult != null && log.isDebugEnabled()) { log.debug("Expression " + exp + " generate result " + evalResult + " - type=" + evalResult.getClass().getName()); if (evalCtx.getRootNode() != null) { log.debug("Was using context node " + DOMUtils.domToString(evalCtx.getRootNode())); } } return evalResult; } catch (XPathFactoryConfigurationException e) { log.error("Exception occurred while creating XPathFactory.", e); throw new XPathProcessingException("Exception occurred while creating XPathFactory.", e); } catch (XPathExpressionException e) { String msg = "Error evaluating XPath expression: " + exp; log.error(msg, e); throw new XPathProcessingException(msg, e); } catch (ParserConfigurationException e) { String msg = "XML Parsing error."; log.error(msg, e); throw new XPathProcessingException(msg, e); } catch (Exception e) { log.error(e.getMessage(), e); throw new XPathProcessingException(e.getMessage(), e); } }