Announcement Announcement Module
Collapse

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
Cycles in Dependency Graph Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cycles in Dependency Graph

    I am trying to use Spring Dynamic Modules for a very simple application, very quickly I ran into eclipse complaining about the existence for cycles in dependency graph for my simple application.

    Eventually I decided to restart development in a fresh workspace.

    I imported the following 4 bundles into my workspace, using File -> Import -> Plug-ins and Fragment from eclipse

    spring beans
    spring context
    spring jdbc
    spring orm

    all version 2.5.4

    Then I selected the manifest for the spring jdbc, in the dependency tab selected "show dependent plug-ins and fragments"

    the hierarchy shows

    spring orm depends on spring jdbc
    spring orm & jdbc depend on spring context ($%#%#%)
    spring context depends on spring orm

    resulting in a loop between context, jdbc, orm

    Nope, I am not crazy, this is definitely what eclipse thinks, checked and double-checked and ...

    Verified that the Import-Packages directive in context has at least 1 reference to orm

    org.springframework.orm.jpa.support

    the cycle does not seem to matter much until I try to use both spring jdbc and orm in my application at the same time, it is a no go, as eclipse will not even build.

    What am I doing wrong, or is this a bug (either in spring bundles or equinox/eclipse)

  • #2
    The optional import is required since the spring context jar contains some classes that provide dynamic loading for certain environments. While unfortunate the package dependency should not create problems when running your application under Eclipse Equinox. I haven't used Eclipse PDE that much but I would suggest to use the Spring-DM target platform (kindly supported by Spring-IDE platform site): http://static.springframework.org/os...tegration.html

    Hope this helps,

    Comment


    • #3
      By the way, I've just raised an issue to potentially address this in the future:
      http://jira.springframework.org/browse/SPR-4802

      Comment


      • #4
        im facing the same problem

        Almost in every jar about spring (2.5.4) , you can find that it imports what it exports !

        im developing RCP , the cycle stop eclipse from exporting entire app .

        then i export the spring jars manually , it is really...

        will it be fixed ?

        Comment


        • #5
          Originally posted by lakemove View Post
          will it be fixed ?
          As I see, the issue is currently scheduled for the 2.5.5 release. In any case you may vote for the issue to increase its importance.

          Comment


          • #6
            Importing exported packages is not a bad practice - quite the contrary.
            See this blog entry from Peter Kriens: http://www.osgi.org/blog/2007/04/imp...importing.html
            I haven't used Eclipse RCP but since this scenario is supported, I think there is a problem with the tool itself.
            Consider searching their mailing list or even posting - maybe there is some workaround.

            Comment


            • #7
              Just to clarify - there is one thing to have cycles between packages (bad) and another to importe what you're exporting (good).

              Comment


              • #8
                i read the article

                and i agree that it is the RCP tools' problem.

                thank you for pointing out, :P

                Comment


                • #9
                  though it maybe not belongs to this topic, i will write out my problem and solution for continuous.

                  when i exporting the RCP Product, it told me

                  a cycle was detected when generating spring web

                  i worked on that damn problem for really a long time, finally i found that , in my plugins directory, contains :

                  spring.jar
                  spring-web.jar


                  then i deleted the spring-web.jar, it works

                  since both above jars exports "org.springframework.web" package, it cause confusion when generating classpath(for exporting) . i guess

                  Comment


                  • #11
                    Enable "allow for binary cycles in the target platform" - see http://help.eclipse.org/galileo/topi...rt_plugins.htm

                    To quote:
                    Allow binary cycles in target platform is an option that controls how the export operation deals with cycles in the dependency graph for a plug-in. PDE Build cannot compile if a cycle is detected. However, if a cycle only contains binary plug-ins from the target platform, turning on this option will allow PDE Build to continue.

                    Comment

                    Working...
                    X