jersey
  1. jersey
  2. JERSEY-2012

Add support for binding BV error messages to MVC views

    Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.3
    • Component/s: extensions
    • Labels:
      None

      Description

      • add support for convenient binding of BV errors to Viewables.
      • new ExceptionMapper<ConstraintViolationException> has to be created at the moment to achieve this

        Activity

        Hide
        paulkmoore added a comment -

        Hi Michal,

        I'm getting a binding error since this change has been integrated (see below).

        Investigating a little, AbstractErrorTemplateMapper expects an @Provider to be available to inject an instance of javax.inject.Provider<ExtendedUriInfo>, which appears not to be available in my environment. I trawled through the rest of the commit and could find no such provider.

        Is there something (external) I need to configure, or is this a bug?

        For context, the initiating error is a WebApplicationException.

        Thanks

        Paul

        [2013-09-26T11:51:10.402+0100] [glassfish 4.0] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=27 _ThreadName=http-listener-1(1)] [timeMillis: 1380192670402] [levelValue: 900] [[
          StandardWrapperValve[com.example.MyApplication]: Servlet.service() for servlet com.example.MyApplication threw exception
        org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308 Unable to resolve any beans for Types: [interface org.glassfish.jersey.server.ExtendedUriInfo]; Bindings: [QualifierInstance{annotationClass=interface javax.enterprise.inject.Default, values={}, hashCode=1619353435}]
        	at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:820)
        	at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:78)
        	at org.glassfish.jersey.server.mvc.spi.AbstractErrorTemplateMapper.getErrorTemplate(AbstractErrorTemplateMapper.java:85)
        	at org.glassfish.jersey.server.mvc.spi.AbstractErrorTemplateMapper.isMappable(AbstractErrorTemplateMapper.java:76)
        	at org.glassfish.jersey.internal.ExceptionMapperFactory.find(ExceptionMapperFactory.java:134)
        	at org.glassfish.jersey.internal.ExceptionMapperFactory.findMapping(ExceptionMapperFactory.java:106)
        	at org.glassfish.jersey.server.ServerRuntime$Responder.mapException(ServerRuntime.java:438)
        	at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:371)
        	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:261)
        	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        
        Show
        paulkmoore added a comment - Hi Michal, I'm getting a binding error since this change has been integrated (see below). Investigating a little, AbstractErrorTemplateMapper expects an @Provider to be available to inject an instance of javax.inject.Provider<ExtendedUriInfo>, which appears not to be available in my environment. I trawled through the rest of the commit and could find no such provider. Is there something (external) I need to configure, or is this a bug? For context, the initiating error is a WebApplicationException. Thanks Paul [2013-09-26T11:51:10.402+0100] [glassfish 4.0] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=27 _ThreadName=http-listener-1(1)] [timeMillis: 1380192670402] [levelValue: 900] [[ StandardWrapperValve[com.example.MyApplication]: Servlet.service() for servlet com.example.MyApplication threw exception org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308 Unable to resolve any beans for Types: [ interface org.glassfish.jersey.server.ExtendedUriInfo]; Bindings: [QualifierInstance{annotationClass= interface javax.enterprise.inject.Default, values={}, hashCode=1619353435}] at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:820) at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:78) at org.glassfish.jersey.server.mvc.spi.AbstractErrorTemplateMapper.getErrorTemplate(AbstractErrorTemplateMapper.java:85) at org.glassfish.jersey.server.mvc.spi.AbstractErrorTemplateMapper.isMappable(AbstractErrorTemplateMapper.java:76) at org.glassfish.jersey.internal.ExceptionMapperFactory.find(ExceptionMapperFactory.java:134) at org.glassfish.jersey.internal.ExceptionMapperFactory.findMapping(ExceptionMapperFactory.java:106) at org.glassfish.jersey.server.ServerRuntime$Responder.mapException(ServerRuntime.java:438) at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:371) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:261) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267)

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 day, 6 hours
              1d 6h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 18 hours, 1 minute Time Not Required
              18h 1m