Announcement Announcement Module
Collapse
No announcement yet.
@DependsOn with multiple dependencies does not work Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @DependsOn with multiple dependencies does not work

    Hello,

    It seems that @DependsOn("Dependency1") works fine, but the annotation does not support multiple dependencies.

    I tried @DependsOn("Dependency1, Dependency2"), but Tomcat throws this runtime error:
    org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'Dependency1, Dependency2' is defined.

    The documentation for the XML config "depends-on" says that it should work...

    Can anyone help me out here? Thank you.

    FT

  • #2
    I suggest a read of the docs again... There is a difference between "Dependency1, Dependency2" and {"Dependency1", "Dependency2"}.

    Comment


    • #3
      Originally posted by Marten Deinum View Post
      I suggest a read of the docs again... There is a difference between "Dependency1, Dependency2" and {"Dependency1", "Dependency2"}.

      Thank you. You are correct.

      I actually did not find that documented anywhere, but it does work. I found the documentation for the XML-based "depends-on" config, which uses "Dependency1, Dependency2" but not the different form for the annotation. Do you know where it is?

      FT

      Comment


      • #4
        Java Doc is found here. Also you probably use an IDE so you should see the fact that it is an array instead of a single string. In XML there are no arrays for an attribute so the single comma separated string is being converted into a String[]... This is not needed for the java based edition.

        Comment

        Working...
        X