Details
-
Bug
-
Resolution: Won't Do
-
Critical
-
3.0.7.Final
-
None
Description
I'm trying to validate the parameters of a method in a RESTful interface below:
@Path("
{id}")
@GET
@Produces(
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }
)
public Response getAsset(@Min(value=5,message="
") @Max(value=50,message="Cannot be greater than 50") @PathParam("id") long assetId);
Implementation of the method:
@Override
public Response getAsset(long assetId) {
if (logger.isDebugEnabled())
Asset asset = new Asset();
try
catch (ServiceException serviceException)
{ logger.error(" Exception occured " + serviceException.getMessage()); throw serviceException; } return Response.ok(asset).build();
}
As soon as I hit the URL http://localhost:8080/rest/services/assets/16 I see an internal server error HTTP Status 500.
I tried loading the validation through XML configuration and removing the interface and directly placing the annotations on the implementation method. In all the cases I saw the same exception. Just to make sure I debugged the issue, and noticed that it was failing on validator.forExecutables() with Method "forExecutables" with signature Ljavax/validation/executable/ExecutableValidator is not applicable on this object. h3.This occurs on line 155 in GeneralValidatorImpl.java inside resteasy-validator-provider-11.jar
Below is a trace of the exception:
java.lang.AbstractMethodError: org.hibernate.validator.internal.engine.ValidatorImpl.forExecutables()Ljavax/validation/executable/ExecutableValidator;
org.jboss.resteasy.plugins.validation.GeneralValidatorImpl.validateAllParameters(GeneralValidatorImpl.java:155)
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:116)
org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:288)
org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:242)
org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:229)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)