users@jersey.java.net

[Jersey] _at_FormParam exception on GET request

From: Trenton D. Adams <trenton.d.adams_at_gmail.com>
Date: Wed, 13 Apr 2016 20:36:29 -0600

​Good day,

I'm trying to setup a generic JAX-RS service, with field level variables
for the parameters. I'm annotating them with @FormParam, because only the
service request that uses post should be setting them. I'm getting an
error.

Now as far as I can tell, pg. 12 of he JAX-RS spec v2 says that "An
implementation SHOULD warn if resource classes with other lifecycles use
these annotations on resource class fields or bean properties."

I'm taking that to mean that I should NOT be receiving an error here, but
some sort of warning.

Here's the error...

A MultiException has 4 exceptions. They are:
1. java.lang.IllegalStateException: The "@FormParam" is utilized when the
request method is GET
2. java.lang.IllegalStateException: The "@FormParam" is utilized when the
request method is GET
3. java.lang.IllegalArgumentException: While attempting to resolve the
dependencies of com.github.trentonadams.eve.features.ApiKeys errors were
found
4. java.lang.IllegalStateException: Unable to perform operation: resolve on
com.github.trentonadams.eve.features.ApiKeys​

I'm getting the error during a get request to the main service. The only
post is this, which is not in use at the time of the call...

@POST
@Path("/post")
@Produces(MediaType.TEXT_HTML)
@Template(name = MainView.INDEX_JSP)
public Response postService() throws URISyntaxException
{
    final URI targetURIForRedirection = new URI(
        serviceUri.getBaseUri().toString() + "api-keys");
    return Response.seeOther(targetURIForRedirection).build();
}

"api-keys" is asctually the main service uri.