Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3543

Compilation error on _Controller.aj when related entity has service created

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Complete
    • 1.2.5.RELEASE
    • 1.3.0.RELEASE
    • WEB MVC
    • None

    Description

      1. Create three entities: UserLogin, UserLoginPermission, Permission
      2. Generate "service layer" of User
      3. Generate web scaffold of the three entities

      On UserLoginPermissionController_Roo_Controller.aj contains

      UserLoginPermissionController_Roo_Controller.aj
          @RequestMapping(params = "form", produces = "text/html")
          public String UserLoginPermissionController.createForm(Model uiModel) {
              populateEditForm(uiModel, new UserLoginPermission());
              List<String[]> dependencies = new ArrayList<String[]>();
              if (userLoginService.countAllUserLogins() == 0) {
                  dependencies.add(new String[] { "userLogin", "userlogins" });
              }
              if (Permission.countPermissions() == 0) {
                  dependencies.add(new String[] { "permission", "permissions" });
              }
              uiModel.addAttribute("dependencies", dependencies);
              return "userloginpermissions/create";
          }
      

      Compiling this generates a exception:

      [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (default) on project xxx: Compiler errors:
      [ERROR] error at if (userLoginService.countAllUserLogins() == 0) {
      [ERROR] ^^^^^^^
      [ERROR] /.../web/party/userlogin/UserLoginPermissionController_Roo_Controller.aj:41:0::0 userLoginService cannot be resolved
      

      This is due to no @Autowire field is generated for userLoginService

      Attachments

        Activity

          People

            jmvivo Jose Manuel Vivó ( Chema ) - DISID.
            jmvivo Jose Manuel Vivó ( Chema ) - DISID.
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: