Search code examples
eclipsespringspring-ide

Content Assist not working in applicationContext.xml with Java Project with 'Spring Project Nature' in eclipse


I have a simple Java project using Spring 3 and Hibernate 3.

I've added the "Spring Project Nature" using Spring IDE. The applicationContext.xml file is in the src folder of the project.

The Content Assist feature of Eclipse 3.5 doesn't seem to work in applicationContext.xml:

  • Inside the class attribute of bean tag it can't seem to find the packages and classes in my Java Project.
  • It can't assist with any attribute, like finding existing beans in applicationContext.xml for the ref attribute.

Solution

    1. Project Properties > Spring > Bean Support > Config Sets > Add New Group (contains all configuration files). Then open applicationContext.xml again.
    2. If content assist does not work, try opening the related file with Spring Config Editor.
    3. If Project Properties > Spring in step 1 doesn't exist, install:

      • SpringSource Tool Suite: Core/STS > SpringSource Tool Suite (required)
      • Additional extensions if needed, e.g. AOP, Autowire, Security.