jersey
  1. jersey
  2. JERSEY-1742

Bean Validation doesn't work when Inflector<DATA, RESULT> is used for handling requests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-m12
    • Fix Version/s: 2.0-m13, 2.0
    • Component/s: extensions
    • Labels:
      None

      Description

      Reason is that Invocable#APPLY_INFLECTOR_METHOD does not honor generic type arguments of inflector set by ResourceMethod.Builder#handledBy(Inflector) (and probably others as well).

      The following exception is thrown by Hibernate Validator:

      java.lang.IllegalArgumentException: HV000116: A method is required to create a method return value path.
      	at org.hibernate.validator.internal.util.Contracts.assertNotNull(Contracts.java:51)
      	at org.hibernate.validator.internal.engine.path.PathImpl.createPathForExecutable(PathImpl.java:98)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.getExecutableValueContext(ValidatorImpl.java:1012)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateParametersForGroup(ValidatorImpl.java:968)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateParametersInContext(ValidatorImpl.java:895)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateParameters(ValidatorImpl.java:261)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateParameters(ValidatorImpl.java:215)
      	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.validateInput(AbstractJavaResourceMethodDispatcher.java:173)
      	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:123)
      	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ObjectOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:167)
      	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:350)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:345)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
      	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:207)
      	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
      	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:183)
      	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:850)
      	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:321)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
      	at org.glassfish.grizzly.http.server.HttpHandlerChain.service(HttpHandlerChain.java:196)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:273)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:820)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      	at java.lang.Thread.run(Thread.java:722)
      

      As a part of this task enhance logging of errors thrown from Bean Validation implementation.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            Michal Gajdos
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 12 hours
              12h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 6 hours Time Not Required
              6h