/** * Get the location of this exception. * * @return the location of this exception */ public XMLLocation getLocation() { return XMLLocation.toXMLLocation(super.getLocation()); }
private void parse() throws SAXException { try { parseInternal(); } catch (XMLStreamException ex) { Locator locator = null; if (ex.getLocation() != null) { locator = new StaxLocator(ex.getLocation()); } SAXParseException saxException = new SAXParseException(ex.getMessage(), locator, ex); if (getErrorHandler() != null) { getErrorHandler().fatalError(saxException); } else { throw saxException; } } }
private void parse() throws SAXException { try { parseInternal(); } catch (XMLStreamException ex) { Locator locator = null; if (ex.getLocation() != null) { locator = new StaxLocator(ex.getLocation()); } SAXParseException saxException = new SAXParseException(ex.getMessage(), locator, ex); if (getErrorHandler() != null) { getErrorHandler().fatalError(saxException); } else { throw saxException; } } }
static ConfigXMLParseException from(final XMLStreamException exception) { if (exception instanceof ConfigXMLParseException) return (ConfigXMLParseException) exception; final StackTraceElement[] stackTrace = exception.getStackTrace(); final Throwable cause = exception.getCause(); final ConfigXMLParseException parseException; if (cause != null) { parseException = new ConfigXMLParseException(clean(exception.getMessage()), exception.getLocation(), cause); } else { parseException = new ConfigXMLParseException(clean(exception.getMessage()), exception.getLocation()); } parseException.setStackTrace(stackTrace); return parseException; }
static ConfigXMLParseException from(final XMLStreamException exception, final URI uri) { if (exception instanceof ConfigXMLParseException) return (ConfigXMLParseException) exception; final StackTraceElement[] stackTrace = exception.getStackTrace(); final Throwable cause = exception.getCause(); final ConfigXMLParseException parseException; if (cause != null) { parseException = new ConfigXMLParseException(clean(exception.getMessage()), XMLLocation.toXMLLocation(uri, exception.getLocation()), cause); } else { parseException = new ConfigXMLParseException(clean(exception.getMessage()), XMLLocation.toXMLLocation(uri, exception.getLocation())); } parseException.setStackTrace(stackTrace); return parseException; }
static ConfigXMLParseException from(final XMLStreamException exception, final URI uri, final XMLLocation includedFrom) { if (exception instanceof ConfigXMLParseException) return (ConfigXMLParseException) exception; final StackTraceElement[] stackTrace = exception.getStackTrace(); final Throwable cause = exception.getCause(); final ConfigXMLParseException parseException; if (cause != null) { parseException = new ConfigXMLParseException(clean(exception.getMessage()), XMLLocation.toXMLLocation(includedFrom, uri, exception.getLocation()), cause); } else { parseException = new ConfigXMLParseException(clean(exception.getMessage()), XMLLocation.toXMLLocation(includedFrom, uri, exception.getLocation())); } parseException.setStackTrace(stackTrace); return parseException; }
private TldMetaData parseTLD(Resource tld) throws DeploymentUnitProcessingException { if (IMPLICIT_TLD.equals(tld.getName())) { // Implicit TLDs are different from regular TLDs return new TldMetaData(); } InputStream is = null; try { is = tld.openStream(); final XMLInputFactory inputFactory = XMLInputFactory.newInstance(); inputFactory.setXMLResolver(NoopXMLResolver.create()); XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is); return TldMetaDataParser.parse(xmlReader); } catch (XMLStreamException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(tld.getName(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()), e); } catch (IOException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(tld.getName()), e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { // Ignore } } }
private TldMetaData parseTLD(VirtualFile tld) throws DeploymentUnitProcessingException { if (IMPLICIT_TLD.equals(tld.getName())) { // Implicit TLDs are different from regular TLDs return new TldMetaData(); } InputStream is = null; try { is = tld.openStream(); final XMLInputFactory inputFactory = XMLInputFactory.newInstance(); inputFactory.setXMLResolver(NoopXMLResolver.create()); XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is); return TldMetaDataParser.parse(xmlReader); } catch (XMLStreamException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(tld.toString(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()), e); } catch (IOException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(tld.toString()), e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { // Ignore } } }
UndertowLogger.ROOT_LOGGER.distributableDisabledInFragmentXml(deploymentUnit.getName(),resourceRoot.getRootName()); } catch (XMLStreamException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(webFragment.toString(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber())); } catch (IOException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(webFragment.toString()), e);
Integer lineNumber = null; Integer columnNumber = null; if (e.getLocation() != null) { lineNumber = e.getLocation().getLineNumber(); columnNumber = e.getLocation().getColumnNumber();
throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(jbossWebXml.toString(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()), e); } catch (IOException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(jbossWebXml.toString()), e);
private void parse() throws SAXException { try { parseInternal(); } catch (XMLStreamException ex) { Locator locator = null; if (ex.getLocation() != null) { locator = new StaxLocator(ex.getLocation()); } SAXParseException saxException = new SAXParseException(ex.getMessage(), locator, ex); if (getErrorHandler() != null) { getErrorHandler().fatalError(saxException); } else { throw saxException; } } }
final Location loc = xse.getLocation(); XmlError e = XmlError.forLocation(xse.getMessage(), path, loc.getLineNumber(),
public ParsingException( XMLStreamException xmle ) { super( xmle ); location = xmle.getLocation(); }
public StaxNavException(XMLStreamException cause) { super(cause); // this.location = cause.getLocation(); }
public ParsingException( XMLStreamException xmle ) { super( xmle ); location = xmle.getLocation(); }
/** * Get the location of this exception. * * @return the location of this exception */ public XMLLocation getLocation() { return XMLLocation.toXMLLocation(super.getLocation()); }
/** * Get the location of this exception. * * @return the location of this exception */ public XMLLocation getLocation() { return XMLLocation.toXMLLocation(super.getLocation()); }
protected void handleXmlException(String message, XMLStreamException e) throws ParseException { message += ": " + e.getMessage(); handleException(message , e.getLocation()); }
public static Document read(InputStream inputStream, URL resourceBase) { try { return new StaxReader(resourceBase, getInputFactory().createXMLStreamReader(inputStream)).doParse(); } catch (XMLStreamException e) { throw new MalformedXMLException(e.getMessage(), e.getLocation().getLineNumber()); } }