users@jersey.java.net

[Jersey] Re: Jersey 2 Spring and ExceptionMapper workaround

From: Miles, Eric (CONT) <"Miles,>
Date: Wed, 12 Feb 2014 09:01:24 -0500

I don't think this is completely true. We are on Jersey 2.5.1 and have successfully integrated Spring Beans as exception mappers for both Spring 3.2.4.RELEASE and 4.0.1.RELEASE. However, we use no Spring annotations and only the JSR-330 and JARX-RS annotations:


@Provider

@Named

public class BusinessExceptionMapper extends AbstractExceptionMapper<BusinessException> {


    @Inject

    private LoggerManager logManager;


    @Context

    private HttpHeaders headers;


Eric Miles

From: <Doyle>, Brendan <brendan.doyle_at_ie.verizon.com<mailto:brendan.doyle_at_ie.verizon.com>>
Reply-To: Jersey Users <users_at_jersey.java.net<mailto:users_at_jersey.java.net>>
Date: Wednesday, February 12, 2014 7:25 AM
To: Jersey Users <users_at_jersey.java.net<mailto:users_at_jersey.java.net>>
Subject: [Jersey] Jersey 2 Spring and ExceptionMapper workaround

Hi

There is a known issue ( https://java.net/jira/browse/JERSEY-2063 ) with Jersey 2 that when you deploy with spring support your ExceptionMappers stop working. I ran into this when trying to migrate from Jersey 1 to 2.5.1. What I found is that you can have exception mappers or spring support but not both.

I tried earlier 2.x versions but they also have the same problem.

Has anyone figured out a way to workaround this?


Verizon Ireland Limited - registered in Ireland - registered number 224334 - registered office at Erne Street, Dublin 2, Ireland - VAT number 8224334A
________________________________________________________

The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.