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

Scaffolded controllers do not detect switch from repository to service



    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3.RELEASE
    • Fix Version/s: None
    • Component/s: @ ROO SHELL, MONITORING
    • Labels:
    • Environment:
      Mac OS X 10.8, Java 7 (Oracle)


      If I create a project with scaffolding and an entity, then create a repository, Roo switches the type to the entity. If I pause for a bit in the shell (like any user does) and then create a service, Roo does not switch the controller ITD to use the service.

      However, if I create the service within a single script along with everything else, it is wired properly.

      If I quit/re-open the shell, the service is wired in.

      Reproduction steps:

      // Spring Roo 1.2.3.BUILD-SNAPSHOT [rev a923887] log opened at 2012-12-08 05:23:53
      project --topLevelPackage org.rimple.demo --projectName roo13demo --java 7
      persistence setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT
      entity jpa --class org.rimple.demo.model.Task
      web mvc setup
      field string --fieldName description --notNull
      field boolean --fieldName completed
      field date --fieldName due --type java.util.Date
      field date --fieldName completeDate --type java.util.Date
      web mvc scaffold --class ~.model.Task
      web mvc scaffold --class ~.web.TaskController --backingType ~.model.Task
      finder list
      finder add --finderName findTasksByDueLessThan
      repository jpa --interface ~.db.TaskRepository --entity ~.model.Task
      // repository is now referenced in the controller

      wait for a bit, then submit
      // at this point, Roo does not update the controller to use the service
      service --interface ~.service.TaskService --entity ~.model.Task

      • notice, it only creates the service, not wiring it to the controller:

      Created SRC_MAIN_JAVA/org/rimple/demo/service
      e9a8568 Created SRC_MAIN_JAVA/org/rimple/demo/service/TaskService.java
      0c62dfe Created SRC_MAIN_JAVA/org/rimple/demo/service/TaskServiceImpl.java
      1cd652f Created SRC_MAIN_JAVA/org/rimple/demo/service/TaskService_Roo_Service.aj
      acbaa91 Created SRC_MAIN_JAVA/org/rimple/demo/service/TaskServiceImpl_Roo_Service.aj

      Try polling, you won't see an update:

      ~.model.Task roo> poll now
      Manual poll completed
      ~.model.Task roo> poll status
      File system polling last took 7 ms; auto-scaled polling is enabled
      ~.model.Task roo> poll now
      Manual poll completed

      Quit and re-start Roo, you get:

      ____ ____ ____
      / __ \/ __ \/ __ \
      / /_/ / / / / / / /
      / , _/ // / /_/ /
      // ||___/___/ 1.2.3.BUILD-SNAPSHOT [rev a923887]

      Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
      [FelixDispatchQueue] e9e7cde Updated SRC_MAIN_JAVA/org/rimple/demo/web/ApplicationConversionServiceFactoryBean_Roo_ConversionService.aj
      [FelixDispatchQueue] da50d94 Updated SRC_MAIN_JAVA/org/rimple/demo/web/TaskController_Roo_Controller.aj

      Looks like some sort of metadata / listener problem.




            Unassigned Unassigned
            krimple Ken Rimple
            1 Vote for this issue
            2 Start watching this issue