Java 8 TransformerConfigurationException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 TransformerConfigurationException class.

This code example shows how to use the following methods:getCause, getLocationAsString
						templates.put(key, t);
					} 
				} catch (IOException e1) {
					throw NSForwardException._runtimeExceptionForThrowable(e1);
				} catch (TransformerConfigurationException tce) {
					log.error("could not create template " + tce.getLocationAsString(), tce);
					log.error("  cause", tce.getCause());
					if (tce.getCause() != null && tce.getCause() instanceof org.xml.sax.SAXParseException) {
						org.xml.sax.SAXParseException e = (org.xml.sax.SAXParseException) tce.getCause();
						log.error("SAXParseException: line " + e.getLineNumber() + ", column " + e.getColumnNumber());
					} 
					log.error("this is the incorrect xsl:>>>" + s + "<<<");
					return null; 
				} 
			} 
 
			try { 
				return t.newTransformer();
			} catch (TransformerConfigurationException tce) {
				log.error("could not create template " + tce.getLocationAsString(), tce);
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getCause, getLocationAsString
						templates.put(key, t);
					} 
				} catch (IOException e1) {
					throw NSForwardException._runtimeExceptionForThrowable(e1);
				} catch (TransformerConfigurationException tce) {
					log.error("could not create template " + tce.getLocationAsString(), tce);
					log.error("  cause", tce.getCause());
					if (tce.getCause() != null && tce.getCause() instanceof org.xml.sax.SAXParseException) {
						org.xml.sax.SAXParseException e = (org.xml.sax.SAXParseException) tce.getCause();
						log.error("SAXParseException: line " + e.getLineNumber() + ", column " + e.getColumnNumber());
					} 
					log.error("this is the incorrect xsl:>>>" + s + "<<<");
					return null; 
				} 
			} 
 
			try { 
				return t.newTransformer();
			} catch (TransformerConfigurationException tce) {
				log.error("could not create template " + tce.getLocationAsString(), tce);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
        } 
 
        @Test(expected=XsltTransformationException.class)
        public void shouldThrowExceptionIfXslTransformerCanNotBeGenerated() throws Exception {
            when(templates.newTransformer())
                    .thenThrow(new TransformerConfigurationException());
 
            //TODO: review...is it possible that too much is being done during construction? 
            new SampleXslTransform(templates).getXslTransformerPool().borrowObject();
        } 
    } 
 
    static class SampleXslTransform extends AbstractXslTransform { 
        public SampleXslTransform(Templates _transformationTemplates) {
            super(_transformationTemplates);
        } 
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
            final Templates templates = fac.newTemplates(new StreamSource(xslt));
            cache.store(xslt, templates, expiry);
            return templates;
 
        } catch (TransformerConfigurationException e) {
            LOG.error(e.getMessage(), e);
            throw new TransformationException("Failed to compile the follwoing XSLT template" + xslt
                    + " Check it exists in the file server", e);
        } 
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
								"org/docx4j/convert/out/fo/renderers/AbstractFORenderer_POSTPROCESSING.xslt")); 
			xslt_POSTPROCESSING = XmlUtils.getTransformerTemplate(xsltSource);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (TransformerConfigurationException e) {
			e.printStackTrace();
		} 
		 
	}	 
	 
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
This code example shows how to use the following methods:getStackTrace
            transformer = this.transformerFactory.newTransformer();
        } catch (TransformerConfigurationException e) {
            this.logger.log(Level.WARNING, "Could not create Transformer", e);
            final IOException ioException = new IOException(
                    "Could not create javax.xml.transform.Transformer"); 
            ioException.setStackTrace(e.getStackTrace());
            throw ioException;
        } 
        try { 
            transformer.transform(source, streamResult);
        } catch (Exception e) {
            final IOException ioException = new IOException(
                    "Could not transform the javax.xml.transform.Source"); 
            ioException.setStackTrace(e.getStackTrace());
            throw ioException;
        } catch (TransformerFactoryConfigurationError e) {
            final IOException ioException = new IOException(
                    "Could not transform the javax.xml.transform.Source"); 
            ioException.setStackTrace(e.getStackTrace());
            throw ioException;
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
    final TransformerFactory tranFactory = TransformerFactory.newInstance();
    final Transformer transformer;
    try { 
      transformer = tranFactory.newTransformer();
    } catch (final TransformerConfigurationException ex) {
      log.error("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage(), ex);
      throw new InternalErrorException("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage());
    } 
    if (prettyFormat == true) {
      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
    } 
    final Source src = new DOMSource(document);
    final ByteArrayOutputStream bout = new ByteArrayOutputStream();
    final Result dest = new StreamResult(bout);
    try { 
      transformer.transform(src, dest);
    } catch (final TransformerException ex) {
      log.error("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage(), ex);
      throw new InternalErrorException("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage());
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
//		exporter.setPrintLabels(exporter.PRINT_VERTEX_LABELS); 
		try { 
			exporter1.export(w, net);
		} catch (TransformerConfigurationException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (SAXException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
	} 
 
	public SimpleGraph<String, TalkEdge> getNet() {
		return net;
	} 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace

Related Java 8 TransformerConfigurationException Questions & Answers:

See Code Examples for Java 8 TransformerConfigurationException Methods: