Jersey/Jackson Exception problem with ExceptionMapper

前端 未结 5 1247
野趣味
野趣味 2021-02-04 05:07

I\'m using Jersey to provide a java REST service to the outside world. I offer some functions that take JSON and I use the Jackson framework in combination with jersey to conver

5条回答
  •  -上瘾入骨i
    2021-02-04 05:49

    I had the same problem and solve overriding the ExceptionMapper. Perfect! One extra thing that I needed to do and were not understanding 100% was how to override the JacksonProvider for my application (I don't know if it was related to Jersey's version that I was using - 2.19). Here's my web.xml part that overrides it:

    
    jersey.config.server.provider.classnames
        
            com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
        
    

提交回复
热议问题