Package org.apache.cxf.service.factory

Examples of org.apache.cxf.service.factory.ServiceConstructionException


            URIResolver resolver = new URIResolver(null, s, getClass());

            if (resolver.isResolved()) {
                return resolver.getURI().toURL();
            } else {
                throw new ServiceConstructionException(new Message("COULD_NOT_RESOLVE_URL", LOG, s));
            }
        } catch (IOException e) {
            throw new ServiceConstructionException(new Message("COULD_NOT_RESOLVE_URL", LOG, s), e);
        }
    }
View Full Code Here


        CachedContextAndSchemas cachedContextAndSchemas = null;
        JAXBContext ctx = null;
        try {
            cachedContextAndSchemas = createJAXBContextAndSchemas(contextClasses, tns);
        } catch (JAXBException e1) {
            throw new ServiceConstructionException(e1);
        }
        ctx = cachedContextAndSchemas.getContext();
        if (LOG.isLoggable(Level.FINE)) {
            LOG.log(Level.FINE, "CREATED_JAXB_CONTEXT", new Object[] {ctx, contextClasses});
        }
        setContext(ctx);

        for (ServiceInfo serviceInfo : service.getServiceInfos()) {
            SchemaCollection col = serviceInfo.getXmlSchemaCollection();

            if (col.getXmlSchemas().length > 1) {
                // someone has already filled in the types
                justCheckForJAXBAnnotations(serviceInfo);
                continue;
            }

            boolean schemasFromCache = false;
            Collection<DOMSource> schemas = getSchemas();
            if (schemas == null || schemas.size() == 0) {
                schemas = cachedContextAndSchemas.getSchemas();
                if (schemas != null) {
                    schemasFromCache = true;
                }
            } else {
                schemasFromCache = true;
            }
            Set<DOMSource> bi = new LinkedHashSet<DOMSource>();
            if (schemas == null) {
                schemas = new LinkedHashSet<DOMSource>();
                try {
                    for (DOMResult r : generateJaxbSchemas()) {
                        DOMSource src = new DOMSource(r.getNode(), r.getSystemId());
                        if (BUILT_IN_SCHEMAS.containsValue(r)) {
                            bi.add(src);
                        } else {
                            schemas.add(src);
                        }
                    }
                    //put any builtins at the end.   Anything that DOES import them
                    //will cause it to load automatically and we'll skip them later
                    schemas.addAll(bi);
                } catch (IOException e) {
                    throw new ServiceConstructionException("SCHEMA_GEN_EXC", LOG, e);
                }
            }
            Set<String> ids = new HashSet<String>();
            for (DOMSource r : schemas) {
                ids.add(r.getSystemId());
View Full Code Here

                serviceFactory.sendEvent(FactoryBeanListener.Event.BINDING_OPERATION_CREATED, inf, boi, m);
            }
            serviceFactory.sendEvent(FactoryBeanListener.Event.BINDING_CREATED, inf);
            return inf;
        } catch (BusException ex) {
            throw new ServiceConstructionException(
                   new Message("COULD.NOT.RESOLVE.BINDING", LOG, bindingId), ex);
        }
    }
View Full Code Here

            URIResolver resolver = new URIResolver(null, s, getClass());

            if (resolver.isResolved()) {
                return resolver.getURI().toURL();
            } else {
                throw new ServiceConstructionException(new Message("COULD_NOT_RESOLVE_URL", LOG, s));
            }
        } catch (IOException e) {
            throw new ServiceConstructionException(new Message("COULD_NOT_RESOLVE_URL", LOG, s), e);
        }
    }
View Full Code Here

                        ep.getService().setInvoker(invoker);
                    }
                }
   
            } catch (EndpointException e) {
                throw new ServiceConstructionException(e);
            } catch (BusException e) {
                throw new ServiceConstructionException(e);
            } catch (IOException e) {
                throw new ServiceConstructionException(e);
            }
           
            if (serviceBean != null) {
                Class<?> cls = ClassHelper.getRealClass(getServiceBean());
                if (getServiceClass() == null || cls.equals(getServiceClass())) {
View Full Code Here

            ep = createEndpoint();
            applyProperties(ep);
            client = createClient(ep);
            initializeAnnotationInterceptors(ep, getServiceClass());
        } catch (EndpointException e) {
            throw new ServiceConstructionException(e);
        } catch (BusException e) {
            throw new ServiceConstructionException(e);
        }
        applyFeatures(client);
        this.getServiceFactory().sendEvent(FactoryBeanListener.Event.CLIENT_CREATED, client, ep);
        return client;
    }
View Full Code Here

           
            if (start) {
                server.start();
            }
        } catch (EndpointException e) {
            throw new ServiceConstructionException(e);
        } catch (BusException e) {
            throw new ServiceConstructionException(e);
        } catch (IOException e) {
            throw new ServiceConstructionException(e);
        }

        applyFeatures();
        return server;
    }
View Full Code Here

            for (BindingOperationInfo boi : inf.getOperations()) {
                serviceFactory.updateBindingOperation(boi);
            }
            return inf;
        } catch (BusException ex) {
            throw new ServiceConstructionException(
                   new Message("COULD.NOT.RESOLVE.BINDING", LOG, bindingId), ex);
        }
    }
View Full Code Here

    private Method getDeclaredMethod(Class<?> endpointClass, Method method) {
        if (!method.getDeclaringClass().equals(endpointClass)) {
            try {
                method = endpointClass.getMethod(method.getName(), (Class[])method.getParameterTypes());
            } catch (SecurityException e) {
                throw new ServiceConstructionException(e);
            } catch (NoSuchMethodException e) {
                return isWebMethod(method) ? method : null;
            }
        }
        return method;
View Full Code Here

    @Override
    public void setServiceClass(Class<?> serviceClass) {
        if (serviceClass == null) {
            Message message = new Message("SERVICECLASS_MUST_BE_SET", LOG);
            throw new ServiceConstructionException(message);
        }
        setJaxWsImplementorInfo(new JaxWsImplementorInfo(serviceClass));
        super.setServiceClass(getJaxWsImplementorInfo().getEndpointClass());
        super.setServiceType(getJaxWsImplementorInfo().getSEIType());
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.service.factory.ServiceConstructionException

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.