Skip to content

Instantly share code, notes, and snippets.

@sebastienblanc
Last active December 14, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sebastienblanc/5134244 to your computer and use it in GitHub Desktop.
Save sebastienblanc/5134244 to your computer and use it in GitHub Desktop.

This is my route :

route().from("/customers/{id}")
.on(RequestMethod.GET)
.consumes(JSON).produces(JSON)
.to(CustomerEndpoint.class)
.findById(Long.parseLong(param("id"));

This the method of my endpoint :

 public Response findById(Long id)
   {
      Customer entity = em.find(Customer.class, id);
      if (entity == null)
      {
         return Response.status(Status.NOT_FOUND).build();
      }
      return Response.ok(entity).build();
   }

This is the stackTrace :

 'argument type mismatch': java.lang.IllegalArgumentException: argument type mismatch

I tried to overload in ag controller the static param method to also support a type and doing this :

param("id", Long.class)

But without any result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment