Examples of WebApplicationException


Examples of javax.ws.rs.WebApplicationException

         String[] availableTypes = ImageIO.getReaderMIMETypes();
         logger.warn("A reader for {0} was not found. This provider is currently configured"
                 + "to handle only {1}", mediaType, availableTypes);
         List<Variant> variants = ProviderHelper.getAvailableVariants(availableTypes);
         Response response = Response.notAcceptable(variants).status(Status.NOT_ACCEPTABLE).build();
         throw new WebApplicationException(response);
      }
      return reader;
   }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

      catch (InvocationTargetException e)
      {
         Throwable cause = e.getCause();
         if (cause instanceof WebApplicationException)
         {
            WebApplicationException wae = (WebApplicationException) cause;
            throw wae;
         }
         throw new ApplicationException(cause);
      }
      catch (IllegalArgumentException e)
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

         public DummyObject readFrom(Class<DummyObject> type, Type genericType, Annotation[] annotations,
                                     MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
                 throws IOException, WebApplicationException
         {
            throw new WebApplicationException(999); // deliberate crazy status
         }

      });

      HttpClient client = new HttpClient();
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

         public void writeTo(DummyObject t, Class<?> type, Type genericType, Annotation[] annotations,
                             MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
                 throws IOException, WebApplicationException
         {
            throw new WebApplicationException(999); // deliberate crazy status
         }

      });

      HttpClient client = new HttpClient();
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

      @GET
      @Produces("text/plain")
      @Path("/bad")
      public String response()
      {
         throw new WebApplicationException(Response.status(Status.CONFLICT).entity("conflicted").build());
      }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

   public static class MyTestResource implements MyTest
   {
      public void postIt(String msg)
      {
         System.out.println("HERE: " + msg);
         throw new WebApplicationException(401);
      }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

   {
      @Path("/exception")
      @GET
      public Response get() throws WebApplicationException
      {
         throw new WebApplicationException(Response.status(HttpResponseCodes.SC_UNAUTHORIZED).build());

      }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

      @Path("/exception/entity")
      @GET
      public Response getEntity() throws WebApplicationException
      {
         throw new WebApplicationException(Response.status(HttpResponseCodes.SC_UNAUTHORIZED).entity("error").build());

      }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

   {
      System.out.println("********* IN SECURE CLIENT");
      if (!ctx.isUserInRole("admin"))
      {
          System.out.println("NOT IN ROLE!!!!");
          throw new WebApplicationException(401);
      }
      return "Wild";
   }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

    {
      viewingPleasure.render(getContextData(HttpServletRequest.class), getContextData(HttpServletResponse.class));
    }
    catch (ServletException ex)
    {
      throw new WebApplicationException(ex);
    }
  }
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.