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:
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.
A cycle was detected when generating the classpath at MYPLUGIN,
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?
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.
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.
thanks for the hint, just tried it, works perfectly. Lets hope this will be fixed in some of the next versions of the bundles.
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.
Originally Posted by cja
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...
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.