Package com.sun.jersey.api.container

Examples of com.sun.jersey.api.container.ContainerException


                            param.getAnnotations(),
                            mediaType,
                            context.getRequest().getRequestHeaders(),
                            in);
                } catch (IOException e) {
                    throw new ContainerException(e);
                }
            } else if (extractor != null) {
                MultivaluedMap<String, String> map = new MultivaluedMapImpl();
                if (fdbp != null) {
                    try {
                        for (FormDataBodyPart p : fdbps) {
                            mediaType = p.getMediaType();

                            reader = mbws.getMessageBodyReader(
                                    String.class,
                                    String.class,
                                    param.getAnnotations(),
                                    mediaType);

                            String value = (String) reader.readFrom(
                                    String.class,
                                    String.class,
                                    param.getAnnotations(),
                                    mediaType,
                                    context.getRequest().getRequestHeaders(),
                                    ((BodyPartEntity) p.getEntity()).getInputStream());

                            map.add(param.getSourceName(), value);
                        }
                    } catch (IOException e) {
                        throw new ContainerException(e);
                    }
                }
                return extractor.extract(map);
            } else {
                return null;
View Full Code Here


                    request.setEntityInputStream(new ByteArrayInputStream(requestEntity));
                }
                return request;
            } catch (IOException ex) {
                throw new ContainerException(ex);
            } finally {
                logger.info(b.toString());
            }
        }
    }
View Full Code Here

        for (WebApplicationProvider wap : ServiceFinder.find(WebApplicationProvider.class)) {
            // Use the first provider found
            return wap.createWebApplication();
        }
               
        throw new ContainerException("No WebApplication provider is present");
    }
View Full Code Here

        public void destroy(Object o) {
            try {
                rcd.destroy(o);
            } catch (IllegalAccessException ex) {
                throw new ContainerException("Unable to destroy resource", ex);
            } catch (InvocationTargetException ex) {
                throw new ContainerException("Unable to destroy resource", ex);
            } catch (RuntimeException ex) {
                throw new ContainerException("Unable to destroy resource", ex);
            }
        }
View Full Code Here

        protected Object _getInstance(HttpContext hc) {
            try {
                return rcc.construct(hc);
            } catch (InstantiationException ex) {
                throw new ContainerException("Unable to create resource " + rcc.getResourceClass(), ex);
            } catch (IllegalAccessException ex) {
                throw new ContainerException("Unable to create resource " + rcc.getResourceClass(), ex);
            } catch (InvocationTargetException ex) {
                // Propagate the target exception so it may be mapped to a response
                throw new MappableContainerException(ex.getTargetException());
            } catch (WebApplicationException ex) {
                throw ex;
            } catch (RuntimeException ex) {
                throw new ContainerException("Unable to create resource " + rcc.getResourceClass(), ex);
            }
        }
View Full Code Here

        public Object _getInstance(HttpContext hc) {
            try {
                return ipcp.proxy(rcc.construct(hc));
            } catch (InstantiationException ex) {
                throw new ContainerException("Unable to create resource", ex);
            } catch (IllegalAccessException ex) {
                throw new ContainerException("Unable to create resource", ex);
            } catch (InvocationTargetException ex) {
                // Propagate the target exception so it may be mapped to a response
                throw new MappableContainerException(ex.getTargetException());
            } catch (WebApplicationException ex) {
                throw ex;
            } catch (RuntimeException ex) {
                throw new ContainerException("Unable to create resource", ex);
            }
        }
View Full Code Here

                    abstractResource);

            try {
                this.resource = rcc.construct(null);
            } catch (InvocationTargetException ex) {
                throw new ContainerException("Unable to create resource", ex);
            } catch (InstantiationException ex) {
                throw new ContainerException("Unable to create resource", ex);
            } catch (IllegalAccessException ex) {
                throw new ContainerException("Unable to create resource", ex);
            }
        }
View Full Code Here

            try {
                Object o = rcc.construct(null);
                resource = ipcp.proxy(o);
            } catch (InvocationTargetException ex) {
                throw new ContainerException("Unable to create resource", ex);
            } catch (InstantiationException ex) {
                throw new ContainerException("Unable to create resource", ex);
            } catch (IllegalAccessException ex) {
                throw new ContainerException("Unable to create resource", ex);
            }
        }
View Full Code Here

            request.getRequestHeaders().remove(HttpHeaders.CONTENT_ENCODING);
            try {
                request.setEntityInputStream(
                        new GZIPInputStream(request.getEntityInputStream()));
            } catch (IOException ex) {
                throw new ContainerException(ex);
            }
        }

        // Check for entity tag header 'If-None-Match' in case of accept-encoding = gzip
        String acceptEncoding = request.getRequestHeaders().getFirst(HttpHeaders.ACCEPT_ENCODING);
View Full Code Here

        final String encodedBasePath = UriComponent.encode(decodedBasePath,
                UriComponent.Type.PATH);

        if (!decodedBasePath.equals(encodedBasePath)) {
            throw new ContainerException("The servlet context path and/or the " +
                    "servlet path contain characters that are percent encoded");
        }

        final URI baseUri = absoluteUriBuilder.replacePath(encodedBasePath).
                build();
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.container.ContainerException

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.