Java Code Examples for org.xml.sax.SAXParseException#printStackTrace()

The following examples show how to use org.xml.sax.SAXParseException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractWSDLToProcessor.java    From cxf with Apache License 2.0 5 votes vote down vote up
public void fatalError(SAXParseException exception) {
    if (this.env.isVerbose()) {
        exception.printStackTrace();
    } else {
        System.err.println("Parsing schema fatal error: \n" + exception.toString());
    }
}
 
Example 2
Source File: ConsoleErrorReporter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void error(SAXParseException e) {
    if(debug)
        e.printStackTrace();
    hasError = true;
    if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) {
        print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e);
    } else {
        print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e);
    }
}
 
Example 3
Source File: RestTestClientTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Test for GET request
 */
@Test
public void testGetResponseFormat() {
    // show test UI for 'customers/{customerId}' resource
    tc.expand("customers"); //NOI18N
    tc.clickOn("customerId"); //NOI18N
    // GET and application/xml should be selected by default - let's check it
    // XXX - should the default mime be app/json? IZ #156896
    assertEquals("GET", tc.getSelectedRMethod()); //NOI18N
    assertEquals("application/xml", tc.getSelectedMIMEType()); //NOI18N
    //should have three options:
    // GET, PUT, DELETE
    assertEquals(3, tc.getAvailableRMethods().length);
    // set an ID of a customer
    tc.setTestArg("resourceId", "1"); //NOI18N
    tc.doTest();
    String s = tc.getContentFromView("raw"); //NOI18N
    try {
        Utils.readXml(s);
    } catch (SAXParseException se) {
        se.printStackTrace(System.err);
        fail("invalid xml response [" + s + "]"); //NOI18N
    }

    // check app/json response format
    tc.setSelectedMIMEType("application/json"); //NOI18N
    assertEquals("application/json", tc.getSelectedMIMEType()); //NOI18N
    tc.doTest();
    s = tc.getContentFromView("raw"); //NOI18N
    try {
        JSONObject json = new JSONObject(s);
    } catch (JSONException ex) {
        ex.printStackTrace(System.err);
        fail("invalid JSON string: [" + s + "]"); //NOI18N
    }
}
 
Example 4
Source File: ConsoleErrorReporter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void error(SAXParseException e) {
    if(debug)
        e.printStackTrace();
    hasError = true;
    if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) {
        print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e);
    } else {
        print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e);
    }
}
 
Example 5
Source File: AbstractLDMLHandler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings(value = "CallToThreadDumpStack")
@Override
public void error(SAXParseException e) throws SAXException {
    e.printStackTrace();
}
 
Example 6
Source File: AbstractLDMLHandler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings(value = "CallToThreadDumpStack")
@Override
public void fatalError(SAXParseException e) throws SAXException {
    e.printStackTrace();
    super.fatalError(e);
}
 
Example 7
Source File: XmlDecoder.java    From energy2d with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void error(SAXParseException e) {
	e.printStackTrace();
}
 
Example 8
Source File: GenerateWithJaxbApi.java    From java-9-wtf with Apache License 2.0 4 votes vote down vote up
@Override
public void warning(SAXParseException exception) {
	System.out.println("WARN");
	exception.printStackTrace();
}
 
Example 9
Source File: SummaryGenerator.java    From openjdk-systemtest with Apache License 2.0 4 votes vote down vote up
public static void main (String[] args) {
	try { 
		DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
		DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
		Document doc = docBuilder.parse (new File(args[0]));
		doc.getDocumentElement ().normalize ();
		NodeList listOfTestResults = doc.getElementsByTagName("TestResult");
		String testPath = ""; 
		String message = ""; 
		StringBuffer resultSummary = new StringBuffer(); 

		for(int s=0; s<listOfTestResults.getLength() ; s++) {
			Node aResult = listOfTestResults.item(s);
			if(aResult.getNodeType() == Node.ELEMENT_NODE) {
				Element aResultElement = (Element) aResult; 
				testPath = aResultElement.getAttribute("url"); 
				NodeList ns = aResultElement.getElementsByTagName("ResultProperties"); 
				if ( ns != null) {
					Node resultPropertiesNode = ns.item(0);
					if (resultPropertiesNode != null) {
						if(resultPropertiesNode.getNodeType() == Node.ELEMENT_NODE) {
							Element aResultPropertiesElement = (Element) resultPropertiesNode; 
							NodeList properties = aResultPropertiesElement.getElementsByTagName("Property"); 
							for (int  i = 0 ; i < properties.getLength(); i++) {
								Node aProperty = properties.item(i); 
								if(aProperty.getNodeType() == Node.ELEMENT_NODE) {
									Element aPropertyElement = (Element) aProperty; 
									String name = aPropertyElement.getAttribute("name"); 
									if ( name != null && name.equals("execStatus")) {
										message = aPropertyElement.getAttribute("value"); 
										resultSummary.append(testPath + "   " + message + "\n");
										break; 
									}
								}
							}
						}
					}
				}
			}
		}
		FileWriter fw = new FileWriter(new File("summary.txt")); 
		fw.write(resultSummary.toString());
		fw.close();
		System.out.println(resultSummary.toString());
	} catch (SAXParseException err) {
		System.out.println ("Error processing XML JCK output report" + err.getMessage ());
		err.printStackTrace();
	}catch (SAXException e) {
		System.out.println ("Error processing XML JCK output report" + e.getMessage ());
		e.printStackTrace();
	}catch (Throwable t) {
		t.printStackTrace ();
	}
}
 
Example 10
Source File: ErrorReceiverImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void printDetail(SAXParseException e) {
    if(debug) {
        e.printStackTrace(System.out);
    }
}
 
Example 11
Source File: XmlDecoder.java    From energy2d with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void fatalError(SAXParseException e) {
	e.printStackTrace();
}
 
Example 12
Source File: AbstractLDMLHandler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings(value = "CallToThreadDumpStack")
@Override
public void fatalError(SAXParseException e) throws SAXException {
    e.printStackTrace();
    super.fatalError(e);
}
 
Example 13
Source File: ConsoleErrorReporter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void fatalError(SAXParseException e) {
    if(debug)
        e.printStackTrace();
    hasError = true;
    print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e);
}
 
Example 14
Source File: AbstractLDMLHandler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings(value = "CallToThreadDumpStack")
@Override
public void warning(SAXParseException e) throws SAXException {
    e.printStackTrace();
}
 
Example 15
Source File: TestErrorHandler.java    From commons-vfs with Apache License 2.0 4 votes vote down vote up
@Override
public void warning(final SAXParseException exception) throws SAXException {
    System.err.println(header);
    exception.printStackTrace(System.err);

}
 
Example 16
Source File: ConsoleErrorReporter.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void fatalError(SAXParseException e) {
    if(debug)
        e.printStackTrace();
    hasError = true;
    print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e);
}
 
Example 17
Source File: AbstractLDMLHandler.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings(value = "CallToThreadDumpStack")
@Override
public void warning(SAXParseException e) throws SAXException {
    e.printStackTrace();
}
 
Example 18
Source File: SpawnConfigParser.java    From EnderZoo with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
@Override
public void fatalError(SAXParseException e) throws SAXException {
  Log.error("Error parsing Spawn config file: " + e.getMessage());
  e.printStackTrace();
}
 
Example 19
Source File: XmlDecoder.java    From energy2d with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void warning(SAXParseException e) {
	e.printStackTrace();
}
 
Example 20
Source File: ConsoleErrorReporter.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void fatalError(SAXParseException e) {
    if(debug)
        e.printStackTrace();
    hasError = true;
    print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e);
}