Code example for InvocationTargetException

            if (t instanceof IOException)
                throw (IOException) t;
            if (t instanceof WebApplicationException)
                throw (WebApplicationException) t;
            throw new InvocationTargetException(t);
     * Write a type to an HTTP response. The response header map is mutable but 
     * any changes must be made before writing to the output stream since the 
     * headers will be flushed prior to writing the response body. 
     * @param genericType 
     *            The generic {@link Type} to convert to. 
     * @param annotations 
     *            the annotations of the artifact to convert to 
     * @param mediaType 
     *            the media type of the HTTP entity.