AspectJ and EclipseLink Model Generation in STS

Spring Roo projects frequently combine AspectJ load-time weaving with EclipseLink JPA. When generating canonical metamodel classes for the Criteria API, the org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor may never execute if AspectJ tooling intercepts the annotation processing pipeline.

Symptoms

  • mvn compile or STS incremental builds fail to produce *_.java metamodel classes.
  • The Eclipse Problems view reports cannot find symbol errors for Q-style criteria classes.

Resolution Steps

  1. Disable the AspectJ Development Tools → Enable AspectJ support option for the project.
  2. Clean the workspace (Project → Clean) to remove stale build output.
  3. Rebuild; the EclipseLink canonical model generator now emits the metamodel classes under target/generated-sources/annotations.
  4. If AspectJ weaving is required, switch to Maven or Gradle builds and run the annotation processor during the command-line compile phase instead of STS incremental compilation.

Recommendation

Where possible, standardise on Maven/Gradle for annotation processing workflows. IDE-only configuration often drifts between workstations and masks build failures that would surface in CI.

References