Announcement Announcement Module
Collapse
No announcement yet.
STS 2.6.0 - AspectJ Compilation Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS 2.6.0 - AspectJ Compilation Error

    I am working on a web project where I use Spring Roo and GAE (google App engine). I defined a particular entity which references a set as shown below

    @RooJavaBean
    @RooToString
    @RooEntity
    public class Person {

    private String firstName;

    @ManyToMany(cascade = CascadeType.ALL)
    private Set<NickName> nickNames = new HashSet<NickName>();

    }

    the idea is user can have multiple nick names. Nickname object is defined below


    @RooJavaBean
    @RooToString
    @RooEntity
    public class NickName {

    private String nickName;
    }

    Since GAE does not support ManyToMany annotation, so Roo declares ManyToMany directive in the Person_Roo_JavaBean aspect and puts a minus/ hypen "-" sign before it. When the code is compiled using Roo, this hyphen is removed and the package is built without any issues.

    But STS is unable to perform the same step and throws compilation error on this field. I have uploaded a snapshot of the error.

    Any idea to overcome this issue is much appreciated. Let me know if additional details are required

  • #2
    Hi,

    declare @field: something: -@SomeAnnotation

    is actually supported syntax in AspectJ 1.6.11. It means remove that annotation from the target. If using an up to date AJDT then you should get the same behaviour in STS as Roo gets on the command line. Can you confirm the version of AspectJ you are using in that STS? In the plugin details for the AJDT feature it should show you 1.6.11.XXXX something like that.

    When you get the error, are you getting it solely in the editor or do you also see it in the problems view?

    I guess it may also make a difference whether you are treating the project as a pure AspectJ project or as a maven project. If a maven project we need to ensure it is pointing at an up to date AspectJ - but if this builds on the command line using maven, I guess that is already correct.

    cheers,
    Andy
    SpringSource Tool Suite Team

    Comment


    • #3
      Andy,

      I have the following version of AJDT.

      Version: 2.1.2.e36x-20101109-1600
      AspectJ version: 1.6.11.20101101122100

      Also, the error appears in Problems as well, as "Syntax error on token "-", delete this token".

      The project would be a maven project (I actually created a project using Spring Roo and added other web layers to it).

      Let me know if you need additional details.

      Thanks
      Ashwin

      Comment


      • #4
        Hi,

        Thanks for the info - that looks like an old version of AJDT. How did you get to 2.6.0, did you upgrade an old one? It looks like that is what might have happened and you didn't pickup a new AJDT in the process. I just unpacked a fresh 2.6.0 and it contained AJDT 2.1.2.e36x-20110307-1000.

        I recommend updating your AJDT from:

        http://download.eclipse.org/tools/ajdt/36/update

        That will give you the release version of 2.1.2

        cheers
        Andy

        Comment


        • #5
          Andy,

          Thank You. The upgrade took care of the problem. I can compile now without any issues.

          Regards
          Ashwin

          Comment

          Working...
          X