Package javax.ws.rs

Examples of javax.ws.rs.ProcessingException


            @Override
            public URI apply(String value) {
                try {
                    return URI.create(value);
                } catch (IllegalArgumentException ex) {
                    throw new ProcessingException(ex);
                }
            }
        }, false);
    }
View Full Code Here


            shouldClose = shouldClose && !(t instanceof Closeable) && !(t instanceof Source);

            return t;
        } catch (IOException ex) {
            throw new ProcessingException(LocalizationMessages.ERROR_READING_ENTITY_FROM_INPUT_STREAM(), ex);
        } finally {
            if (shouldClose) {
                entityContent.close();
            }
        }
View Full Code Here

            entityContent.setContent(new ByteArrayInputStream(baos.toByteArray()), true);

            return true;
        } catch (IOException ex) {
            throw new ProcessingException(LocalizationMessages.MESSAGE_CONTENT_BUFFERING_FAILED(), ex);
        }
    }
View Full Code Here

                            asSubclass(WadlGeneratorConfig.class);
                } else if (wadlGeneratorConfigProperty instanceof String) {
                    configClazz = AccessController.doPrivileged(ReflectionHelper.classForNameWithExceptionPEA((String) wadlGeneratorConfigProperty)).
                            asSubclass(WadlGeneratorConfig.class);
                } else {
                    throw new ProcessingException(LocalizationMessages.ERROR_WADL_GENERATOR_CONFIG_LOADER_PROPERTY(
                            ServerProperties.WADL_GENERATOR_CONFIG,
                            wadlGeneratorConfigProperty.getClass().getName()));
                }
                return configClazz.newInstance();

            } catch (PrivilegedActionException pae) {
                throw new ProcessingException(LocalizationMessages.ERROR_WADL_GENERATOR_CONFIG_LOADER(
                        ServerProperties.WADL_GENERATOR_CONFIG), pae.getCause());
            } catch (Exception e) {
                throw new ProcessingException(LocalizationMessages.ERROR_WADL_GENERATOR_CONFIG_LOADER(
                        ServerProperties.WADL_GENERATOR_CONFIG), e);
            }
        }
    }
View Full Code Here

        } else if (Set.class == collectionType) {
            return new SetValueOf<T>(converter, parameterName, defaultValueString);
        } else if (SortedSet.class == collectionType) {
            return new SortedSetValueOf<T>(converter, parameterName, defaultValueString);
        } else {
            throw new ProcessingException(LocalizationMessages.COLLECTION_EXTRACTOR_TYPE_UNSUPPORTED());
        }
    }
View Full Code Here

        WadlGenerator wadlGenerator;
        List<WadlGeneratorDescription> wadlGeneratorDescriptions;
        try {
            wadlGeneratorDescriptions = configure();
        } catch (Exception e) {
            throw new ProcessingException(LocalizationMessages.ERROR_WADL_GENERATOR_CONFIGURE(), e);
        }
        for (WadlGeneratorDescription desc : wadlGeneratorDescriptions) {
            desc.setConfiguratorClass(this.getClass());
        }
        try {
            wadlGenerator = WadlGeneratorLoader.loadWadlGeneratorDescriptions(locator, wadlGeneratorDescriptions);
        } catch (Exception e) {
            throw new ProcessingException(LocalizationMessages.ERROR_WADL_GENERATOR_LOAD(), e);

        }
        return wadlGenerator;
    }
View Full Code Here

                        newForm.asMap().add(key, decode ? URLDecoder.decode(value, charsetName) : URLEncoder.encode(value,
                                charsetName));
                    }

                } catch (UnsupportedEncodingException uee) {
                    throw new ProcessingException(LocalizationMessages.ERROR_UNSUPPORTED_ENCODING(charsetName,
                            extractor.getName()), uee);
                }
            }
            return newForm;
        }
View Full Code Here

        JAXBContext jaxbContext = null;
        try {
            jaxbContext = JAXBContext.newInstance(resultClass);
        } catch (JAXBException ex) {
            throw new ProcessingException(LocalizationMessages.ERROR_WADL_JAXB_CONTEXT(), ex);
        }

        final SAXParser saxParser = saxParserFactory.newSAXParser();
        SAXSource source = new SAXSource(saxParser.getXMLReader(), new InputSource(inputStream));
        final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
View Full Code Here

                    });

            if (filtered.isEmpty()) {
                return EMPTY;
            } else if (filtered.size() > 1) {
                throw new ProcessingException("Too many client binding annotations.");
            } else {
                return new BindingModel(filtered.iterator().next());
            }
        }
View Full Code Here

            @Override
            public Date apply(String input) {
                try {
                    return HttpHeaderReader.readDate(input);
                } catch (ParseException e) {
                    throw new ProcessingException(e);
                }
            }
        }, false);
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.ProcessingException

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.