Examples of LoaderException


Examples of org.apache.tuscany.spi.loader.LoaderException

    private CompositeComponent composite;

    public void bootRuntime(URL systemScdl, ClassLoader systemClassLoader, MonitorFactory monitor)
        throws TuscanyException {
        if (systemScdl == null) {
            throw new LoaderException("Null system SCDL URL");
        }

        XMLInputFactory xmlFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory", systemClassLoader);
        Bootstrapper bootstrapper = new DefaultBootstrapper(monitor, xmlFactory);
        Deployer bootDeployer = bootstrapper.createDeployer();
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

                Thread.currentThread().setContextClassLoader(cl);
                Class<?> factoryClass = cl.loadClass(factoryName);
                // FIXME: We require the SDO to provide an API to register static types in a given TypeHelper
                SDOUtil.registerStaticTypes(factoryClass);
            } catch (ClassNotFoundException e) {
                throw new LoaderException(e.getMessage(), e);
            } finally {
                Thread.currentThread().setContextClassLoader(oldCL);
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

    @Deprecated
    public CompositeComponent bootApplication(String name, URL appScdl) throws TuscanyException {
        ClassLoader applicationLoader = getApplicationLoader();

        if (appScdl == null) {
            throw new LoaderException("No application scdl found");
        }

        // create a ComponentDefinition to represent the component we are going to deploy
        CompositeImplementation impl = new CompositeImplementation();
        impl.setScdlLocation(appScdl);
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

                if (uri.isAbsolute()) {
                    wsdlURL = uri.toURL();
                }
                wsdlURL = deploymentContext.getClassLoader().getResource(location);
                if (null == wsdlURL) {
                    LoaderException loaderException = new LoaderException("WSDL location error");
                    loaderException.setResourceURI(location);
                    throw loaderException;
                }
                InputStream xsdInputStream = wsdlURL.openStream();
                try {
                    XSDHelper xsdHelper = SDOUtil.createXSDHelper(typeHelper);
                    xsdHelper.define(xsdInputStream, wsdlURL.toExternalForm());
                } finally {
                    xsdInputStream.close();
                }
            } catch (IOException e) {
                LoaderException sfe = new LoaderException(e.getMessage());
                sfe.setResourceURI(location);
                throw sfe;
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

        RubyComponentType componentType;
        if (resource == null) {
            try {
                componentType = loadByIntrospection(parent, implementation, deploymentContext);
            } catch (InvalidServiceContractException e) {
                throw new LoaderException("Invalid service contract", e);
            }
        } else {
            componentType = loadFromSidefile(resource, deploymentContext);
        }
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

    public void load(CompositeComponent parent, SystemCompositeImplementation implementation,
                     DeploymentContext deploymentContext)
        throws LoaderException {
        URL scdlLocation = implementation.getScdlLocation();
        if (scdlLocation == null) {
            throw new LoaderException("SCDL location not found");
        }
        ClassLoader cl = implementation.getClassLoader();
        deploymentContext = new ChildDeploymentContext(deploymentContext, cl, scdlLocation);
        CompositeComponentType componentType = loadFromSidefile(parent, scdlLocation, deploymentContext);
        implementation.setComponentType(componentType);
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

        if (wsdlLocation != null) {
            try {
                wsdlRegistry.loadDefinition(wsdlLocation, deploymentContext.getClassLoader());
            } catch (IOException e) {
                LoaderException le = new LoaderException(e);
                le.setIdentifier(wsdlLocation);
                throw le;
            } catch (WSDLException e) {
                LoaderException le = new LoaderException(e);
                le.setIdentifier(wsdlLocation);
                throw le;
            }
        }

        PortType portType = getPortType(interfaceURI);
        if (portType == null) {
            throw new MissingResourceException(interfaceURI);
        }
        PortType callback = null;
        if (callbackURI != null) {
            callback = getPortType(callbackURI);
        }
        try {
            WSDLServiceContract contract = introspector.introspect(portType, callback);
            DataType<?> dataType = (DataType<?>) extensions.get(DataType.class);
            if (dataType != null) {
                contract.setDataBinding(dataType.getDataBinding());
            }
            contract.getExtensions().putAll(extensions);
            return contract;
        } catch (InvalidServiceContractException e) {
            LoaderException le = new LoaderException(e);
            le.setIdentifier(wsdlLocation);
            throw le;
        }
    }
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

                return (Document)transformer.transform(is, null);
            } finally {
                is.close();
            }
        } catch (Exception e) {
            throw new LoaderException(e);
        }
    }
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

                            new InvalidValueException("The 'source' has an invalid value");
                        ex.addContextName(source);
                        throw ex;
                    }
                } catch (Exception e) {
                    throw new LoaderException(e);
                }
            } else if (file != null) {
                node = loadFromFile(propValue.getFile(), deploymentContext);
                propValue.setValue(node);
                Property<?> prop =
View Full Code Here

Examples of org.apache.tuscany.spi.loader.LoaderException

        String text = value.getValue().getDocumentElement().getTextContent();
        try {
            Context context = new InitialContext();
            return new JNDIObjectFactory<T>(context, text);
        } catch (NamingException e) {
            throw new LoaderException(e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.