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

How to use
printStackTrace
method
in
org.dom4j.DocumentException

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

origin: Tencent/tinker

  throw new TinkerPatchException("Parse android manifest error!");
} catch (DocumentException e) {
  e.printStackTrace();
  throw new TinkerPatchException("Parse android manifest by dom4j error!");
} catch (IOException e) {
origin: spotbugs/spotbugs

e2.initCause(e);
if (verbose) {
  e2.printStackTrace();
origin: com.github.becausetesting/commons

public DOM4JUtils(InputStream inputStream) {
  try {
    // document = reader.read(new
    // ByteArrayInputStream(xml.getBytes("UTF-8")));
    document = new SAXReader().read(inputStream);
  } catch (DocumentException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}
origin: com.github.becausetesting/commons

public DOM4JUtils(URL url) {
  try {
    document = new SAXReader().read(url);
  } catch (DocumentException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}
origin: com.github.becauseQA/becauseQA-utils

/**
 * @param url
 *            The URL object
 */
public static void read(File file) {
  // TODO Auto-generated constructor stub
  try {
    xmlFile = file;
    document = new SAXReader().read(file);
  } catch (DocumentException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}
origin: com.github.becauseQA/becauseQA-utils

/**
 * @param inputSource
 *            the xml object 1. if it's a xml file : new
 *            ByteArrayInputStream(xmlfile.getBytes("UTF-8")) 2. if it's
 *            inputstream: just past it;
 * @return
 */
public static void read(InputSource inputSource) {
  try {
    document = new SAXReader().read(inputSource);
  } catch (DocumentException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}
origin: com.github.becausetesting/commons

public DOM4JUtils(String xmlfile) {
  try {
    // document = reader.read(new
    // ByteArrayInputStream(xml.getBytes("UTF-8")));
    document = new SAXReader().read(new ByteArrayInputStream(xmlfile.getBytes("UTF-8")));
  } catch (DocumentException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  } catch (UnsupportedEncodingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}
origin: rememberber/WeSync

/**
 * 读取xml,加载到dom
 */
public void reloadDom() {
  SAXReader reader = new SAXReader();
  try {
    document = reader.read(new File(ConstantsTools.PATH_CONFIG));
  } catch (DocumentException e) {
    e.printStackTrace();
    logger.error("Read config xml error:" + e.toString());
  }
}
origin: qiuqiu3/pptv

public static Video getVideo(File file) {
  try {
    SAXReader reader = new SAXReader();
    Document doc = reader.read(file);;            
    return parseXml(doc);
  } catch (DocumentException e) {
    e.printStackTrace();
  }
  return null;
}

origin: jenkins-infra/update-center2

private Document readPOM() throws IOException {
  try {
    return xmlReader.read(latest.resolvePOM());
  } catch (DocumentException e) {
    System.err.println("** Can't parse POM for "+artifactId);
    e.printStackTrace();
    return null;
  }
}
origin: qiuqiu3/pptv

public static Video getVideo(String url) {
  try {
    SAXReader reader = new SAXReader();
    Document doc = reader.read(url);
    return parseXml(doc);
  } catch (DocumentException e) {
    e.printStackTrace();
  }
  return null;
}

origin: bioinformatics-ua/dicoogle

public String getType()
{
  SAXReader saxReader = new SAXReader();
  ByteArrayInputStream input = new ByteArrayInputStream(Message.getBytes());
  Document document = null;
  try
  {
    document = saxReader.read(input);
  } catch (DocumentException ex)
  {
    ex.printStackTrace(System.out);
  }
  Element root = document.getRootElement();
  Element tmp = root.element(MessageFields.MESSAGE_TYPE);
  return tmp.getText();
}
origin: xiaour/SpringBootDemo

@RequestMapping("callback/{appid}")
@PostMapping(produces = "application/xml; charset=UTF-8")
public String callbackMsg(@RequestBody String requestBody, @PathVariable String appid){
  System.out.println(appid);
  System.out.println(requestBody);
  try {
    JsonObject jsonData= Xml2JsonUtil.xml2Json(requestBody);
    System.out.println(jsonData);
  } catch (DocumentException e) {
    e.printStackTrace();
  }
  return "success";
}
origin: com.bladejava/blade-kit

public XmlKit(String filePath) {
  String xmlPath = XmlKit.class.getResource(filePath).toString();
  if (xmlPath.substring(5).indexOf(":") > 0) {
    // 路径中含有:分隔符,windows系统
    xmlPath = xmlPath.substring(6);
  } else {
    xmlPath = xmlPath.substring(5);
  }
  SAXReader reader = new SAXReader();
  try {
    reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    this.document = reader.read(new File(xmlPath));
  } catch (SAXException e) {
    e.printStackTrace();
  } catch (DocumentException e) {
    e.printStackTrace();
  }
}
 
origin: stackoverflow.com

 protected List<String> getSecurityRoles() {
  List<String> roles = new ArrayList<String>();
  ServletContext sc = this.getServletContext();
  InputStream is = sc.getResourceAsStream("/WEB-INF/web.xml");

  try {
    SAXReader reader = new SAXReader();
    Document doc = reader.read(is);

    Element webApp = doc.getRootElement();

    // Type safety warning:  dom4j doesn't use generics
    List<Element> roleElements = webApp.elements("security-role");
    for (Element roleEl : roleElements) {
      roles.add(roleEl.element("role-name").getText());
    }
  } catch (DocumentException e) {
    e.printStackTrace();
  }

  return roles;
}
origin: stackoverflow.com

 public static void main(String[] args) throws SAXException {
  String xml = "<root><item><errorCode>1</errorCode><errorDescription></errorDescription></item>"+"<item><errorCode>2</errorCode><errorDescription></errorDescription></item></root>";
  SAXReader reader = new SAXReader();
  Document doc = null;
  try {
    doc = reader.read(new ByteArrayInputStream(xml.getBytes()));
    @SuppressWarnings("unchecked")
    List<Element> list = doc.selectNodes("/root/item");
    for(Element el : list){
      Element errorCode = (Element) el.selectNodes("errorCode").get(0);
      Element errorDescription = (Element) el.selectNodes("errorDescription").get(0);
      System.out.println(errorCode.getText() + " : " + errorDescription.getText());
    }
  }catch (DocumentException e) {
    e.printStackTrace();
  }
}
origin: itisaid/Doris

public static void main(String[] args) {
  XMLDataServerConfigureLoader loader = new XMLDataServerConfigureLoader("dataserver.xml");
  try {
    loader.load();
  } catch (DocumentException e) {
    e.printStackTrace();
  }
}
origin: huangfangyi/YiChat

  @Override
  public void onResponse(Call call, Response response) throws IOException {
    Document doc = null;
    try {
      doc = DocumentHelper.parseText(response.body().string());
    } catch (DocumentException e) {
      e.printStackTrace();
    }
    Element root = doc.getRootElement();
    String recCode = root.elementText("code");
    String recMsg = root.elementText("msg");
    listener.onSuccess(recCode, recMsg, String.valueOf(smsCode));
    Log.d(TAG,"-----验证码:"+smsCode);
  }
});
origin: zhangdaiscott/h5huodong

/**
 * 获取授权的Appid
 * @param xml
 * @return
 */
String getAuthorizerAppidFromXml(String xml) {
  Document doc;
  try {
    doc = DocumentHelper.parseText(xml);
    Element rootElt = doc.getRootElement();
    String toUserName = rootElt.elementText("ToUserName");
    return toUserName;
  } catch (DocumentException e) {
    e.printStackTrace();
  }
  return null;
}
origin: net.gltd.gtms/gtmsutil

public static String formatXml(String xml) {
  StringUtil.validateString(xml);
  String result = xml;
  Document doc;
  try {
    doc = DocumentHelper.parseText(xml);
    result = XmlUtil.dumpToString(doc, true);
  } catch (DocumentException e) {
    e.printStackTrace();
  }
  return result;
}
org.dom4jDocumentExceptionprintStackTrace

Popular methods of DocumentException

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

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • 14 Best Plugins for Eclipse
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