congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DocumentException.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
org.dom4j.DocumentException

Best Java code snippets using org.dom4j.DocumentException.getMessage (Showing top 20 results out of 360)

origin: igniterealtime/Openfire

public void configure(String pluginName) {
  try {
    SAXReader saxReader = new SAXReader();
    saxReader.setEncoding("UTF-8");
    Document cacheXml = saxReader.read(configDataStream);
    List<Node> mappings = cacheXml.selectNodes("/cache-config/cache-mapping");
    for (Node mapping: mappings) {
      registerCache(pluginName, mapping);
    }
  }
  catch (DocumentException e) {
    Log.error(e.getMessage(), e);
  }
}
origin: webx/citrus

private void parse() {
  if (!parsed) {
    parsed = true;
    try {
      document = readDocument(getOriginalInputStream(), getName(), true);
    } catch (DocumentException e) {
      log.warn("Not a valid XML doc: {}, source={},\n{}", new Object[] { getName(), originalSource, e.getMessage() });
      document = null;
    }
  }
}
origin: webx/citrus

private void parse() {
  if (!parsed) {
    parsed = true;
    try {
      document = readDocument(getOriginalInputStream(), getName(), true);
    } catch (DocumentException e) {
      log.warn("Not a valid XML doc: {}, source={},\n{}", new Object[] { getName(), originalSource, e.getMessage() });
      document = null;
    }
  }
}
origin: webx/citrus

private void parse() {
  if (!parsed) {
    parsed = true;
    try {
      document = readDocument(getOriginalInputStream(), getName(), true);
    } catch (DocumentException e) {
      log.warn("Not a valid XML doc: {}, source={},\n{}", new Object[] { getName(), originalSource, e.getMessage() });
      document = null;
    }
  }
}
origin: com.github.fosin/cdp-utils

/** {@inheritDoc} */
@Override
public Document convert(String source) {
  try {
    return DocumentHelper.parseText(source);
  } 
  catch (DocumentException e) {
    throw new IllegalArgumentException("Failed to parse xml " + source + ", cause: " + e.getMessage(), e);
  }
}
origin: com.github.fosin/cdp-utils

/** {@inheritDoc} */
@Override
public Element convert(String source) {
  try {
    return DocumentHelper.parseText(source).getRootElement();
  } 
  catch (DocumentException e) {
    throw new IllegalArgumentException("Failed to parse xml " + source + ", cause: " + e.getMessage(), e);
  }
}
origin: micromata/projectforge

public static Element fromString(final String str)
{
 if (StringUtils.isBlank(str) == true) {
  return null;
 }
 try {
  final Document document = DocumentHelper.parseText(str);
  return document.getRootElement();
 } catch (final DocumentException ex) {
  log.error("Exception encountered " + ex.getMessage());
 }
 return null;
}
origin: com.centit.support/centit-utils

  public static Document string2xml(String xmlStr) {

//        SAXReader saxReader = new SAXReader();
    Document xmlDoc = null;
    try {

//            InputStream in = new ByteArrayInputStream(xmlStr.getBytes());
//            InputStreamReader isReader = new InputStreamReader(in, "GBK");
//            xmlDoc = saxReader.read(isReader);
      xmlDoc = DocumentHelper.parseText(xmlStr);
    } catch (DocumentException e) {
      logger.error(e.getMessage(),e);
    }
//        } catch (UnsupportedEncodingException e) {
//            logger.error(e.getMessage(),e.getCause());
//        }

    return xmlDoc;
  }

origin: com.gitee.rslai.base.tool/servertest

private Element loadXml(String fileName) {
  Element element = (Element) INCLUDED.get(fileName);
  if (element != null) return element;
  String content = read(fileName);
  SAXReader reader = new SAXReader();
  StringReader stream = new StringReader(content);
  try {
    Element root = reader.read(stream).getRootElement();
    INCLUDED.put(fileName, root);
    return root;
  } catch (DocumentException e) {
    logger.error("读取include指令指定的文件失败", e);
    throw new RuntimeException(e.getMessage(), e);
  }
}
origin: org.nuxeo.ecm.platform/nuxeo-platform-audit-io

private static Document loadXML(InputStream in) throws IOException {
  try {
    // the SAXReader is closing the stream so that we need to copy the
    // content somewhere
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    IOUtils.copy(in, baos);
    return new SAXReader().read(new ByteArrayInputStream(baos.toByteArray()));
  } catch (DocumentException e) {
    IOException ioe = new IOException("Failed to read log entry " + ": " + e.getMessage());
    ioe.setStackTrace(e.getStackTrace());
    throw ioe;
  }
}
origin: ucarGroup/DataLink

@POST
@Path("/toEditLogback/{workerId}")
public Map<String, String> toEditLogback(@PathParam("workerId") String workerId) throws Throwable {
  logger.info("Receive a request to edit logback.xml, with workerId " + workerId);
  String path = System.getProperty("logback.configurationFile");
  SAXReader reader = new SAXReader();
  Map<String, String> result = new HashMap<>();
  try {
    Document document = reader.read(new File(path));
    result.put("content", document.asXML());
    return result;
  } catch (DocumentException e) {
    logger.info("reading logback.xml error:", e);
    result.put("content", e.getMessage());
  }
  return result;
}
origin: org.nuxeo.ecm.core/nuxeo-core-io

private static Document loadXML(File file) throws IOException {
  BufferedInputStream in = null;
  try {
    in = new BufferedInputStream(new FileInputStream(file));
    return new SAXReader().read(in);
  } catch (DocumentException e) {
    IOException ioe = new IOException("Failed to read file document " + file + ": " + e.getMessage());
    ioe.setStackTrace(e.getStackTrace());
    throw ioe;
  } finally {
    if (in != null) {
      in.close();
    }
  }
}
origin: com.centit.support/centit-utils

  public static Object xmlStringToObject(String xmlString){
    try {
      Document doc = DocumentHelper.parseText(xmlString);
      return elementToObject(doc.getRootElement());
    } catch (DocumentException e) {
      logger.error(e.getMessage(),e);//e.printStackTrace();
      return null;
    }
  }
}
origin: com.centit.support/centit-utils

public static Map<String, Object> xmlStringToJSONObject(String xmlString){
  try {
    Document doc = DocumentHelper.parseText(xmlString);
    return elementToJSONObject(doc.getRootElement());
  } catch (DocumentException e) {
    logger.error(e.getMessage(),e);//e.printStackTrace();
    return null;
  }
}

origin: org.fornax.cartridges/fornax-cartridges-sculptor-framework-test

@SuppressWarnings("unchecked")
void parse(String xml) {
  try {
    Document document = DocumentHelper.parseText(xml);
    Element rootElement = document.getRootElement();
    Iterator<Element> elementIterator = rootElement.elementIterator("persistence-unit");
    while (elementIterator.hasNext()) {
      parsePersistentUnit(elementIterator.next());
    }
  } catch (DocumentException e) {
    throw new RuntimeException(e.getMessage());
  }
}
origin: org.igniterealtime.openfire/xmppserver

public void configure(String pluginName) {
  try {
    SAXReader saxReader = new SAXReader();
    saxReader.setEncoding("UTF-8");
    Document cacheXml = saxReader.read(configDataStream);
    List<Node> mappings = cacheXml.selectNodes("/cache-config/cache-mapping");
    for (Node mapping: mappings) {
      registerCache(pluginName, mapping);
    }
  }
  catch (DocumentException e) {
    Log.error(e.getMessage(), e);
  }
}
origin: com.atlassian.config/atlassian-config

public Object load(InputStream istream) throws ConfigurationException
{
  try
  {
    return loadDocument(istream);
  }
  catch (DocumentException e)
  {
    throw new ConfigurationException("Failed to load Xml doc: " + e.getMessage(), e);
  }
}
origin: com.atlassian.config/atlassian-config

public Object load(InputStream is) throws ConfigurationException
{
  try
  {
    loadDocument(is);
  }
  catch (DocumentException e)
  {
    throw new ConfigurationException("Failed to parse config file: " + e.getMessage(), e);
  }
  return null;
}
origin: com.alibaba.citrus/citrus-webx-all

private void parse() {
  if (!parsed) {
    parsed = true;
    try {
      document = readDocument(getOriginalInputStream(), getName(), true);
    } catch (DocumentException e) {
      log.warn("Not a valid XML doc: {}, source={},\n{}", new Object[] { getName(), originalSource, e.getMessage() });
      document = null;
    }
  }
}
origin: fcrepo3/fcrepo

@Override
protected void installServerXML() throws InstallationFailedException {
  try {
    File distServerXML = new File(getConf(), "server.xml");
    TomcatServerXML serverXML =
        new TomcatServerXML(distServerXML, getOptions());
    serverXML.update();
    serverXML.write(distServerXML.getAbsolutePath());
  } catch (IOException e) {
    throw new InstallationFailedException(e.getMessage(), e);
  } catch (DocumentException e) {
    throw new InstallationFailedException(e.getMessage(), e);
  }
}
org.dom4jDocumentExceptiongetMessage

Popular methods of DocumentException

  • printStackTrace
  • <init>
  • getNestedException
  • getStackTrace
  • initCause
  • getCause
  • toString

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now