2

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.
approxiblue
  • 6,624
  • 16
  • 47
  • 56
skip
  • 10,691
  • 27
  • 99
  • 146

3 Answers3

9
  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.
approxiblue
  • 6,624
  • 16
  • 47
  • 56
lschin
  • 6,649
  • 2
  • 36
  • 52
1

Spring IDE and STS only complete Java class and package names after at least one character has been typed into the class or corresponding attributes.

If you want to get content assist for Bean references by name across XML files you need to define a Config Set (Project Properties > Spring > Bean Support > Config Sets).

approxiblue
  • 6,624
  • 16
  • 47
  • 56
0

To enable content assist for a spring project in Eclipse,
go to Projects->Properties->Spring->Config Detection and select all the options for auto detection.

Rohan
  • 169
  • 3
  • 3