Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.3, 2.9.0
    • Fix Version/s: 2.10.0
    • Component/s: None
    • Labels:
    • Estimated Complexity:
      Unknown

      Description

      We should consider to upgrade to Spring 3.1.0.RELEASE in Camel 2.10.0 or 3.0.0 depending on the backwards compatibility of Spring.

      See: http://static.springsource.org/spring/docs/3.1.0.RELEASE/changelog.txt

        Issue Links

          Activity

          Christian Müller created issue -
          Christian Müller made changes -
          Field Original Value New Value
          Summary Upgrade Sring to 3.1.0.RELEASE Upgrade Spring to 3.1.0.RELEASE
          Hide
          Jean-Baptiste Onofré added a comment -

          This update require in update in Karaf (as Camel uses the Spring Karaf features).

          Show
          Jean-Baptiste Onofré added a comment - This update require in update in Karaf (as Camel uses the Spring Karaf features).
          Jean-Baptiste Onofré made changes -
          Link This issue is blocked by KARAF-1120 [ KARAF-1120 ]
          Hide
          Babak Vahdat added a comment -

          To avoid the usage of any deprecated API in 3.1.x IMHO this would also require a huge refactoring in camel-jpa and also some other corners as well, as since the 3.1 RC1 release the JpaTemplate/JpaInterceptor/JpaDaoSupport and JdoTemplate/JdoInterceptor/JdoDaoSupport are all deprecated!

          There're a bunch of places on the Web like [1] which explain this change since the 3.1.x branch.

          But maybe we want to postpone the cleanup of the deprecated API usage to later and not necessarily do it in the context of this ticket.

          [1] http://www.javaworld.com/community/node/8245

          Show
          Babak Vahdat added a comment - To avoid the usage of any deprecated API in 3.1.x IMHO this would also require a huge refactoring in camel-jpa and also some other corners as well, as since the 3.1 RC1 release the JpaTemplate/JpaInterceptor/JpaDaoSupport and JdoTemplate/JdoInterceptor/JdoDaoSupport are all deprecated! There're a bunch of places on the Web like [1] which explain this change since the 3.1.x branch. But maybe we want to postpone the cleanup of the deprecated API usage to later and not necessarily do it in the context of this ticket. [1] http://www.javaworld.com/community/node/8245
          Jean-Baptiste Onofré made changes -
          Assignee Jean-Baptiste Onofré [ jbonofre ]
          Hide
          Jean-Baptiste Onofré added a comment -

          I tested to update to Spring 3.1.0.RELEASE and it works without problem.

          Karaf 3.0 will also provide the Spring 3.1.0.RELEASE features, but I wonder if it doesn't make sense to update to Spring 3.1.0.RELEASE also in Karaf 2.2.x.

          Show
          Jean-Baptiste Onofré added a comment - I tested to update to Spring 3.1.0.RELEASE and it works without problem. Karaf 3.0 will also provide the Spring 3.1.0.RELEASE features, but I wonder if it doesn't make sense to update to Spring 3.1.0.RELEASE also in Karaf 2.2.x.
          Hide
          Christian Müller added a comment -

          JB, do you expect problems when we upgrade Camel 2.10.0 to Spring 3.1.0 (and deploy it into Karaf 2.2.x)?
          Because Camel leverage on the Karaf Spring feature, it will use Spring 3.0.x when running inside Karaf 3.0x and Spring 3.1.x when running in Karaf 3.0.x.

          IMO, when we can upgrade to Spring 3.1.0 without any modification, it should not a problem...

          Show
          Christian Müller added a comment - JB, do you expect problems when we upgrade Camel 2.10.0 to Spring 3.1.0 (and deploy it into Karaf 2.2.x)? Because Camel leverage on the Karaf Spring feature, it will use Spring 3.0.x when running inside Karaf 3.0x and Spring 3.1.x when running in Karaf 3.0.x. IMO, when we can upgrade to Spring 3.1.0 without any modification, it should not a problem...
          Hide
          Christian Müller added a comment -

          I found the following incompatibilities between Spring 3.0 and Spring 3.1 which we have to fix:

          • org.apache.camel.test.spring.CamelSpringTestContextLoader extends org.springframework.test.context.support.AbstractContextLoader. AbstractContextLoader implements org.springframework.test.context.SmartContextLoader (a new interface since 3.1) which adds the new method "ApplicationContext loadContext(MergedContextConfiguration mergedConfig)" which is not implemented by AbstractContextLoader.
          Show
          Christian Müller added a comment - I found the following incompatibilities between Spring 3.0 and Spring 3.1 which we have to fix: org.apache.camel.test.spring.CamelSpringTestContextLoader extends org.springframework.test.context.support.AbstractContextLoader. AbstractContextLoader implements org.springframework.test.context.SmartContextLoader (a new interface since 3.1) which adds the new method "ApplicationContext loadContext(MergedContextConfiguration mergedConfig)" which is not implemented by AbstractContextLoader.
          Hide
          Christian Müller added a comment -

          I think because of this new class "org.springframework.test.context.MergedContextConfiguration" which is now (with Spring 3.1) part of "org.springframework.test.context.support.AbstractContextLoader", we cannot support Spring 3.0 or 3.1.

          Any suggestions?

          Show
          Christian Müller added a comment - I think because of this new class "org.springframework.test.context.MergedContextConfiguration" which is now (with Spring 3.1) part of "org.springframework.test.context.support.AbstractContextLoader", we cannot support Spring 3.0 or 3.1. Any suggestions?
          Hide
          Claus Ibsen added a comment -

          I suggest to log a JIRA at SPR to tell them about this binary incompatibility they introduced between 3.0 and 3.1.

          Show
          Claus Ibsen added a comment - I suggest to log a JIRA at SPR to tell them about this binary incompatibility they introduced between 3.0 and 3.1.
          Hide
          Christian Müller added a comment -

          Claus, do you think the Spring guys will fix this? I think introducing binary incompatibility in a minor version is not a "no go", IMO. It's only bad for us...

          Show
          Christian Müller added a comment - Claus, do you think the Spring guys will fix this? I think introducing binary incompatibility in a minor version is not a "no go", IMO. It's only bad for us...
          Christian Müller made changes -
          Summary Upgrade Spring to 3.1.0.RELEASE Upgrade Spring to 3.1.1.RELEASE
          Hide
          Christian Müller added a comment -

          I added a "spring3.1" feature and set up a new Jenkins build for it.
          I expect the build will fail in camel-test-spring but I'm interested in to see if this is the only issue.

          If this is the case, I propose to revert the changes for camel-test-spring (it's a new component in Camel 2.10.0) because I think supporting Spring 3.1 is much more requested. In this case, I will reopen the issue which with David add camel-test-spring and attach a patch so that it's easy for us to apply it later (when we got this component working with Spring 3.0 or we drop the support for Spring 3.0 in Camel 2.11.0/3.0.0).

          Doubts?

          Show
          Christian Müller added a comment - I added a "spring3.1" feature and set up a new Jenkins build for it. I expect the build will fail in camel-test-spring but I'm interested in to see if this is the only issue. If this is the case, I propose to revert the changes for camel-test-spring (it's a new component in Camel 2.10.0) because I think supporting Spring 3.1 is much more requested. In this case, I will reopen the issue which with David add camel-test-spring and attach a patch so that it's easy for us to apply it later (when we got this component working with Spring 3.0 or we drop the support for Spring 3.0 in Camel 2.11.0/3.0.0). Doubts?
          Christian Müller made changes -
          Link This issue is blocked by CAMEL-4987 [ CAMEL-4987 ]
          Hide
          David Valeri added a comment - - edited

          Christian,

          Just to be clear, you intend to keep camel-test-spring and its existing Spring test support through the CamelTestSupport classes but to roll-back the changes from CAMEL-4987 only?

          I looked into this issue and concur that there is no straightforward way to work with Spring Test 3.1 and 3.0, short of having two modules in our code base, duplicating Spring code in our code base (Removing AbstractContextLoader from the hierarchy), or doing selective compilation.

          I implemented the changes needed to compile with 3.1 locally and confirmed that the tests still pass. So the code in question can definitely support 3.1 when the time comes.

          Show
          David Valeri added a comment - - edited Christian, Just to be clear, you intend to keep camel-test-spring and its existing Spring test support through the CamelTestSupport classes but to roll-back the changes from CAMEL-4987 only? I looked into this issue and concur that there is no straightforward way to work with Spring Test 3.1 and 3.0, short of having two modules in our code base, duplicating Spring code in our code base (Removing AbstractContextLoader from the hierarchy), or doing selective compilation. I implemented the changes needed to compile with 3.1 locally and confirmed that the tests still pass. So the code in question can definitely support 3.1 when the time comes.
          Hide
          Christian Müller added a comment -

          Yes, that's what I mean. Sorry for the unclear comment in my last post - I need some more sleep in these busy days...

          In the meantime, I reverted the relevant changes and running the unit tests on my box. If they succeed, I will commit it and kick on the Jenkins builds for Spring 3.1 und 3.0. I also plan to attach the revert diff of this change to CAMEL-4987. May be this will make it easier to apply it later in Camel 2.11.0 or 3.0.0 (I really like this change).

          Show
          Christian Müller added a comment - Yes, that's what I mean. Sorry for the unclear comment in my last post - I need some more sleep in these busy days... In the meantime, I reverted the relevant changes and running the unit tests on my box. If they succeed, I will commit it and kick on the Jenkins builds for Spring 3.1 und 3.0. I also plan to attach the revert diff of this change to CAMEL-4987 . May be this will make it easier to apply it later in Camel 2.11.0 or 3.0.0 (I really like this change).
          Christian Müller made changes -
          Assignee Jean-Baptiste Onofré [ jbonofre ] Christian Müller [ muellerc ]
          Hide
          David Valeri added a comment -

          I did a little more digging and it turns out that my earlier conclusion was based on some bad observations in Eclipse. It turns out that the only real issue is how Maven wants to do the build. Maven wants one version of Spring on the classpath. If we implement the new method needed to move to Spring 3.1, the camel-spring-test library compiled against 3.1 will work with client code using Spring 3.0 on its classpath. This binary compatibility for client code means that the only issue is compiling the Spring 3.1 compatible camel-spring-test JAR against the Spring 3.0 JARs. This feat won't be possible due to the aforementioned Maven behavior.

          We need a way to compile the camel-test-spring module against Spring 3.1 but run the tests against Spring 3.1 and Spring 3.0. I can think of some ways to achieve that, but they are a little bit messy. Is there a clean way to get Maven to support this use case?

          We also need to update the documentation to say from 2.11 or 3.0 onwards or export the documentation for later use. The Camel 3 stuff is still up in the air so do you have a roadmap for Spring 3.0 support deprecation?

          Show
          David Valeri added a comment - I did a little more digging and it turns out that my earlier conclusion was based on some bad observations in Eclipse. It turns out that the only real issue is how Maven wants to do the build. Maven wants one version of Spring on the classpath. If we implement the new method needed to move to Spring 3.1, the camel-spring-test library compiled against 3.1 will work with client code using Spring 3.0 on its classpath. This binary compatibility for client code means that the only issue is compiling the Spring 3.1 compatible camel-spring-test JAR against the Spring 3.0 JARs. This feat won't be possible due to the aforementioned Maven behavior. We need a way to compile the camel-test-spring module against Spring 3.1 but run the tests against Spring 3.1 and Spring 3.0. I can think of some ways to achieve that, but they are a little bit messy. Is there a clean way to get Maven to support this use case? We also need to update the documentation to say from 2.11 or 3.0 onwards or export the documentation for later use. The Camel 3 stuff is still up in the air so do you have a roadmap for Spring 3.0 support deprecation?
          Hide
          Christian Müller added a comment -

          +1
          I did the following changes:

          • revert my last revert
          • implemented the new required method to be able to compile camel-test-spring with Spring 3.1
          • stick camel-test-spring to Spring 3.1 (this should not be a problem)
          • build all other components with Spring 3.0 or Spring 3.1

          I think with this we are able to support Spring 3.0 and 3.1 AND the new first class support using Spring test based unit tests

          My build is running. Keep you posted...

          Show
          Christian Müller added a comment - +1 I did the following changes: revert my last revert implemented the new required method to be able to compile camel-test-spring with Spring 3.1 stick camel-test-spring to Spring 3.1 (this should not be a problem) build all other components with Spring 3.0 or Spring 3.1 I think with this we are able to support Spring 3.0 and 3.1 AND the new first class support using Spring test based unit tests My build is running. Keep you posted...
          Hide
          Christian Müller added a comment -

          camel-test-spring will be always compiled with Spring 3.1. It's possible to use it with Spring 3.0 because the methods we use didn't changed.

          Show
          Christian Müller added a comment - camel-test-spring will be always compiled with Spring 3.1. It's possible to use it with Spring 3.0 because the methods we use didn't changed.
          Christian Müller made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Christian Müller added a comment -

          I'm wondering what the default should be: Spring 3.1 or Spring 3.0...
          At present, the default is still Spring 3.0.

          Show
          Christian Müller added a comment - I'm wondering what the default should be: Spring 3.1 or Spring 3.0... At present, the default is still Spring 3.0.
          Hide
          David Valeri added a comment - - edited

          Let me know if anything doesn't pass in camel-test-spring or camel-testng since I added Spring Test support in both of those modules.

          Also let me know when you push your changes up so I can review the method implementation you added.

          EDIT: I see you already pushed the changes up. There is a one line difference between the two method implementations in the super class. The extra line supports a Spring Test feature and not a Camel related feature so it wouldn't show up in our unit tests. I will update the code and re-open CAMEL-4987 for now.

          Show
          David Valeri added a comment - - edited Let me know if anything doesn't pass in camel-test-spring or camel-testng since I added Spring Test support in both of those modules. Also let me know when you push your changes up so I can review the method implementation you added. EDIT: I see you already pushed the changes up. There is a one line difference between the two method implementations in the super class. The extra line supports a Spring Test feature and not a Camel related feature so it wouldn't show up in our unit tests. I will update the code and re-open CAMEL-4987 for now.
          Hide
          Christian Müller added a comment -

          Ok, thanks for having a look at it. Go ahead with your changes...

          Show
          Christian Müller added a comment - Ok, thanks for having a look at it. Go ahead with your changes...
          Hadrian Zbarcea made changes -
          Fix Version/s 2.10.0 [ 12317612 ]

            People

            • Assignee:
              Christian Müller
              Reporter:
              Christian Müller
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development