Using Jersey-spring with Spring 4.0

前端 未结 3 1014
失恋的感觉
失恋的感觉 2020-12-24 13:21

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 j

相关标签:
3条回答
  • 2020-12-24 13:50

    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.

    0 讨论(0)
  • 2020-12-24 14:04

    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.

    0 讨论(0)
  • 2020-12-24 14:09

    Not sure if you came across any issues but I currently face one. It is described in other thread.

    Simply, using jersey-spring3 2.12 and spring 4.1.0.RELEASE in one maven project leads to following class incompatibility:

    2014-09-14 01:15:44.175:WARN:oejuc.AbstractLifeCycle:main: FAILED org.eclipse.jetty.server.handler.HandlerCollection@696
    db620[org.eclipse.jetty.server.handler.ContextHandlerCollection@27abb6ca[o.e.j.m.p.JettyWebAppContext@737d100a{/,file:/C
    :/Users/Josef/Workspace/TransitCenter/src/main/webapp/,STARTING}{file:/C:/Users/Josef/Workspace/TransitCenter/src/main/w
    ebapp/}], org.eclipse.jetty.server.handler.DefaultHandler@6968c1d6, org.eclipse.jetty.server.handler.RequestLogHandler@7
    d986d83]: java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependenc
    yComparator()Ljava/util/Comparator;
    java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependencyComparato
    r()Ljava/util/Comparator;
            at org.springframework.context.annotation.AnnotationConfigUtils.registerAnnotationConfigProcessors(AnnotationCon
    figUtils.java:136)
    
    0 讨论(0)
提交回复
热议问题