Announcement Announcement Module
Collapse
No announcement yet.
STS 2.5.0RELEASE failure of "enable spring aspects tooling" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS 2.5.0RELEASE failure of "enable spring aspects tooling"

    I can't seem to get "enable spring aspects tooling" to work in my Roo project in STS 2.5.0 RELEASE. It didn't work in 2.3.0 either.

    I make a fresh Roo project, Add a couple of entities and it all compiles and tests are working. Yet, when I try to get to a field that are inside the ITDs they are nowhere to be found. No content assist. It's like aspectj is inactive.

    I tried both suggestions in possible bug in sts "enable spring aspects tooling" of last years.

    Solution reported there was either rename maven dependency "org.springframework.aspects-3.0.0.RELEASE.jar" to just "spring-aspects.jar" or add the aspects jar to Aspect Path. Neither of these work for me.

    JDT weaving is enabled.

    What can I do to fix this? How can I see what is happening when I select "enable spring aspects tooling". As far as the IDE tells it seems nothing is happening.

    Is this a known bug? Can it be routed around somehow?


    JDK1.5_20, Mac OS X 10.5.8
    Last edited by MiB; Mar 2nd, 2011, 06:39 PM.

  • #2
    All that the "Enable Spring Aspects Tooling" command does is enable JDT weaving and ensure that the spring-aspects.jar is on your aspect path.

    If you are doing both of those manually, and still you are seeing odd behavior, then something else is wrong.

    You said that JDT Weaving is enabled, but that you do not see content assist for ITDs coming from Aspects. I'm assuming that there has been a successful build of your project (the crosscutting model is not created until there has been a build).

    Some other questions:

    1. Do you see aspect markers in the gutter of your Java editor?
    2. Can you use them to navigate?
    3. Any exceptions in your error log?

    Comment


    • #3
      Yes, I have the markers, I can see the aspect declarations and I can go to the source.

      Actually, this problem may have something to do with Maven as I got a compiler error there now: "The field User.id is not visible". I'll have to investigate what that means.

      So weaving seem to work then, it's my compilation I need to fix. But why is beyond me at the moment.

      Comment


      • #4
        The crosscutting model is not completely built if there are compile errors. So, that is probably the reason why you are not getting the proper content assist.

        Comment


        • #5
          verify crosscutting model?

          How can I verify the crosscutting model? I changed the this.id part of the isNew() method in my User entity and everything compiles. Yet, I can't get content assist to any of the fields that are in the itd-files. I can get to them via the aspect markers and if I add them like: this.id STS accepts that as a member and doesn't complain. It's maven that again will raise the compiler error about fields in the itd-files.
          I tried both Maven 2.2.9 and the built-in Maven 3.0, in STS and from the command line. I have had no problems before building with references to fields in the itd-files, so something must be wrong with how I have set up the project, which is pretty much taken from the Hades Project Manual, though I want to use the id field that Roo manages in the User_Roo_Entity.aj file.


          The User object:

          Code:
          @RooJavaBean
          @RooToString
          @RooEntity
          public class User {
          
              private String username;
          
              private String password;
          
              private String email;
          
              @ManyToMany(cascade = CascadeType.ALL)
              private Set<Role> roles;
              
              public boolean isNew() {
              	return null == this.id; //changed to null == null to get compilation working 
              }
          }
          Last edited by MiB; Mar 2nd, 2011, 06:40 PM.

          Comment


          • #6
            Instead of this.id, try this.getId(). User.id is defined as private in the User_Roo_Entity.aj file (meaning that it is only accessible inside the aspect and not in the class on which it is defined), and User_Roo_Entity.aj defines a getter and setter for id that other classes should be using.

            Comment


            • #7
              Thanks Andrew. It seems this and the fact I need to build with STS at least one time instead of Maven, solved all the problems I had.

              Comment

              Working...
              X