Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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