Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Jersey-spring with Spring 4.0

According to you what are the risks of using Spring 4 with the jersey-spring3 integration module?

I have tried to use Spring 4.0 with the jersey spring example and the example still works but i'm unable to identify risks linked to this usage.

like image 842
guli Avatar asked Jan 29 '14 21:01

guli


People also ask

Why do we need Jersey in spring boot?

Jersey is an open source framework for developing RESTful Web Services. It serves as a reference implementation of JAX-RS. In this article, we'll explore the creation of a RESTful Web Service using Jersey 2. Also, we'll use Spring's Dependency Injection (DI) with Java configuration.

Does spring boot use Jersey?

Spring Boot provides the spring-boot-starter-jersey module that allows you to use the JAX-RS programming model for the REST endpoints instead of Spring MVC. It works quite well with Jersey 2. x. For a complete example of creating a web application with Jersey 2.


2 Answers

I have started using Jersey 2.7 and Spring 4.0.x recently in a project. I have setup a context hierarchy to inject beans, so far, I have discovered only one limitiation but that does not seem relate to Spring 4 but rather to the module itself or the HK2 Spring Bridge.

To give more insight about my use. I have a XJC/JAXB-backed which is consumed by a common service, repository and exposed through JAX-WS, and now hopefully through JAX-RS.

The multi-context stuff works now with @Autowiredwith 2.8-SNAPSHOT. I have applied my changes and the 2.8-SNAPSHOT to 2.7. Here is the diff.

Edit (Michael-O; 2014-10-17): Here is a modified Spring module based off 2.11 with multi-context support.

like image 146
Michael-O Avatar answered Sep 21 '22 21:09

Michael-O


Not an answer to original question, just related information

This may be a little premature, but the new Major 3.0 version of Jersey will be using Spring 4, in the new jersey-spring4 module. The new Major version will be built with Java 8. Though a new Major version will be released, the 2.x line will still be actively developed to keep support for Java 7

I'll update this post once 3.0 has been release.

For anyone interested, you can see this mailing list to see what the Jersey team has to say about the new 3.x line.

like image 23
Paul Samsotha Avatar answered Sep 23 '22 21:09

Paul Samsotha