Package org.apache.tuscany.core.config

Examples of org.apache.tuscany.core.config.InvalidRootElementException


            try {
                reader = xmlFactory.createXMLStreamReader(is);
                try {
                    reader.nextTag();
                    if (!AssemblyConstants.COMPONENT_TYPE.equals(reader.getName())) {
                        InvalidRootElementException e = new InvalidRootElementException(AssemblyConstants.COMPONENT_TYPE, reader.getName());
                        e.setResourceURI(sidefile.toString());
                        throw e;
                    }
                    return (ComponentType) registry.load(reader, loaderContext);
                } finally {
                    try {
                        reader.close();
                    } catch (XMLStreamException e) {
                        // ignore
                    }
                }
            } finally {
                try {
                    is.close();
                } catch (IOException e) {
                    // ignore
                }
            }
        } catch (IOException e) {
            SidefileLoadException sfe = new SidefileLoadException(e.getMessage());
            sfe.setResourceURI(sidefile.toString());
            throw sfe;
        } catch (XMLStreamException e) {
            SidefileLoadException sfe = new SidefileLoadException(e.getMessage());
            sfe.setResourceURI(sidefile.toString());
            throw sfe;
        } catch (ConfigurationLoadException e) {
            SidefileLoadException sfe = new SidefileLoadException(e.getMessage());
            sfe.setResourceURI(sidefile.toString());
            throw sfe;
        }
    }
View Full Code Here


            try {
                reader = xmlFactory.createXMLStreamReader(is);
                try {
                    reader.nextTag();
                    if (!AssemblyConstants.COMPONENT_TYPE.equals(reader.getName())) {
                        InvalidRootElementException e = new InvalidRootElementException(AssemblyConstants.COMPONENT_TYPE, reader.getName());
                        e.setResourceURI(componentTypeFile.toString());
                        throw e;
                    }
                    return (ComponentType) registry.load(reader, loaderContext);
                } finally {
                    try {
                        reader.close();
                    } catch (XMLStreamException e) {
                        // ignore
                    }
                }
            } finally {
                try {
                    is.close();
                } catch (IOException e) {
                    // ignore
                }
            }
        } catch (IOException e) {
            SidefileLoadException sfe = new SidefileLoadException(e.getMessage());
            sfe.setResourceURI(componentTypeFile.toString());
            throw sfe;
        } catch (XMLStreamException e) {
            SidefileLoadException sfe = new SidefileLoadException(e.getMessage());
            sfe.setResourceURI(componentTypeFile.toString());
            throw sfe;
        } catch (ConfigurationLoadException e) {
            SidefileLoadException sfe = new SidefileLoadException(e.getMessage());
            sfe.setResourceURI(componentTypeFile.toString());
            throw sfe;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.config.InvalidRootElementException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.