Skip to content

Instantly share code, notes, and snippets.

@abstractj
Forked from sebastienblanc/gist:5134244
Created March 11, 2013 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abstractj/5134295 to your computer and use it in GitHub Desktop.
Save abstractj/5134295 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(param("id");

This the method of my endpoint :

 public Response findById(String id)
   {
      Customer entity = em.find(Customer.class, Long.parseLong(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