Announcement Announcement Module
No announcement yet.
Spring Explorer with Java-based Web-Container configuration Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Explorer with Java-based Web-Container configuration


    i configure my WebApp with the javax.servlet.ServletContainerInitializer respecitve with a WebApplicationInitializer, and Java based Configuration.
    Is there a way to configure the Spring Eplorer View of STS to show the Configuration and the Dependency Graph correctly?

    A Google & a Forum search was without result.

    Any hint will be helpful for me..

    Best Regards,
    Gianpietro Dal Zio

  • #2

    The tooling doesn't recognize the Spring configuration at the moment if there is not a single configuration file. This should definitely be changed to support this scenario. I filed an enhancement request for this:

    In the meantime you could add a simple configuration file that contains the component-scanning definition and add that to the list of used config files for the project. This is a somewhat ugly workaround (I know), but it should at least work.



    • #3
      Hello Martin,

      thak you very much for your answer, and for the enhancement request.
      I already try the "simple configuration file" workaround; bud it does not work really good, the recongnition of the dependencies between Beans are not recognized:

      public TesterBean testerBean()
      	TesterBean tb = null;
      			tb = new TesterBean(this.entityManager());
      	catch (Throwable e)
      		// TODO Auto-generated catch block
      		return tb;
      The graphs shows the #testerBean but not the dependency with the #entityManager bean...

      Tank you!


      • #4
        Hey Gianpietro!

        The beans graph is not yet able to analyse those dependencies between beans that are coming from inside @Bean configurations. This is somewhat complex to analyze and to implement because of the wide variety of possibilities and ways to configure beans using this style. Nevertheless, I think it would be great to have those dependencies within that graph as well. I opened this JIRA issue to track this:



        • #5
          Thank you Martin,



          • #6
            Hi Martin,

            I too came across the problem that the "Spring Explorer" doesn't show me beans for my purely annotation-driven Spring project (... I'm currently playing around with the spring-social-showcase ).

            I tried your workaround using a simple configuration file.

            In the project's src/main/java folder, I created a file componentscan.xml with the following content
            <beans xmlns=""
                   <context:component-scan base-package=""/>
            Then I added this xml file to the "Beans Support config file list": Project properties -> Spring -> Beans Support -> Config Files -> Scan... -> select src/main/java/componentscan.xml -> OK -> OK

            Now the Spring Explorer view gets a refresh.

            To my suprise, this list does not include all beans which are part of the spring-social-showcase (e.g. @Bean beans dataSource, facebook, textEncryptor, etc.). Instead the Spring Explorer's beans list includes a handful of @Controller controllers and @Configuration configurations).

            Is it the case that the Spring Explorer view is currently broken with respect to viewing @Bean annotated beans?


            • #7

              If the Spring explorer doesn't show the @Bean annotated beans for your case, it sounds like a bug in Spring IDE or STS. Can you please file a JIRA for this:


              and maybe attach a small sample project that reproduces the problem? That would be great!



              • #8
                I'd like to file a request. The problem is I only have a vague understanding about STS' features and views. That is, I didn't find any documation explaining what the different Spring views (e.g. "Spring Explorer", "Beans Cross References") are supposed to do and how to work with them.

                Therefore, I cannot say whether what I'm asking for ("Annotation beans don't show up in Spring Explorer") is a feature request or an observed defect, or is actually completely out of place.

                tl;dr: Please provide documentation for STS, explaining what you can do with it.


                • #9

                  Sorry for not getting back to this sooner, it slipped through my to-do list somehow. Sorry for that.
                  We don't have extensive documentation about the IDE features in a written-down format, but you can find a lot of useful information from this collection of "getting started" material:


                  Hope this helps!