Results 1 to 7 of 7

Thread: Classpath cycle

  1. #1
    Join Date
    Sep 2006
    Posts
    5

    Default Classpath cycle

    Hi,

    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:

    Code:
    A cycle was detected when generating the classpath at MYPLUGIN,
    org.springframework.context_2.5.6.A, org.springframework.orm_2.5.6.A,
    org.springframework.transaction_2.5.6.A, 
    org.springframework.context_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?

    Thanks,

    Christoph

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Aug 2008
    Posts
    29

    Default

    Hi,

    there is already a bug for this:
    jira.springframework.org/browse/SPR-4936

    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. #4
    Join Date
    Sep 2006
    Posts
    5

    Default

    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.

    Christoph

  5. #5
    Join Date
    Jul 2009
    Posts
    8

    Default

    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 MANIFEST.mf in the newly-exported jar after the export?

    Please let me know. Thanks.

    Jeff,
    Quote 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.

    Christoph

  6. #6
    Join Date
    Aug 2008
    Posts
    29

    Default

    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. #7
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •