Announcement Announcement Module

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Classpath cycle Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Classpath cycle


    I am not entirely sure this is the right forum to ask this question, so please let me know if a different forum is better suited.

    I have a bundle, which depends on org.springframework.beans, org.springframework.context and org.springframework.core. I downloaded all bundles from the SpringSource Bundle Repository. I tried with version 2.5.6 and 2.5.6.A, same result.

    Additionally, in my Eclipse target, I have spring bundles org.springframework.aop, org.springframework.jdbc, org.springframework.orm, org.springframework.transaction, org.springframework.web and org.springframework.web.servlet, because some other plugins I develop depend on these (working on an Eclipse RCP application, which uses spring remoting to talk to a server part, which uses spring and hibernate).

    Now if I try to export my plugin, I get the following error message:

    A cycle was detected when generating the classpath at MYPLUGIN,
    org.springframework.context_2.5.6.A, org.springframework.orm_2.5.6.A,
    Asking eclipse for the dependencies between plugins, one can also see that org.springframework.context depends on ...orm, which depends on ...transaction, which in turn depends on ...context.

    Is there something wrong with the definition of the spring bundles, or is it eclipse (or equinox), which does not correctly calculate dependencies or is not able to correctly resolve the dependencies?



  • #2
    Christoph, feel free to raise an issue on Spring JIRA on this topic. As far as I know, it's okay to have cycles between the bundles though the Eclipse plugin seems to differ.


    • #3

      there is already a bug for this:

      To work around this problem we hacked the manifest of the context bundle by removing the optional dependency mentioned in the jira issue.

      --- Jens


      • #4
        Hi Jens,

        thanks for the hint, just tried it, works perfectly. Lets hope this will be fixed in some of the next versions of the bundles.



        • #5
          Hi all,

          I am getting the same error when trying to export the bundle with org.springframework.web_2.5.6.A.jar dependency.

          Could anyone please help me give more details of how to hack the manifest file? Does it mean "don't put any require-bundle and import-package for that specific packages" during the export and manually add it to the in the newly-exported jar after the export?

          Please let me know. Thanks.

          Originally posted by cja View Post
          Hi Jens,

          thanks for the hint, just tried it, works perfectly. Lets hope this will be fixed in some of the next versions of the bundles.



          • #6
            The hack consists of deleting the optional dependency in the context bundle mentioned in the jira issue. Of course this can only be applied if you know for sure that this dependency will never be needed at runtime in your application...


            • #7
              Right which I wouldn't recommend since, if you do happen to need that package (even indirectly through class loading), you'll start getting NoClassDefFound and most likely, you won't think of the Spring manifest modification.