Announcement Announcement Module
Collapse
No announcement yet.
Spring Roo 1.1.0.M2 controller cause not exist webmvc-config.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Roo 1.1.0.M2 controller cause not exist webmvc-config.xml



    every body know that.
    the first "controller " command will create "webmvc-config.xml"
    like that
    controller scaffold ~.web.Gobroad_userController
    Created SRC_MAIN_JAVA/com/gbd/gobroad/web
    Created SRC_MAIN_JAVA/com/gbd/gobroad/web/Gobroad_userController.java
    Created SRC_MAIN_WEBAPP/WEB-INF/spring
    Created SRC_MAIN_WEBAPP/WEB-INF/spring/webmvc-config.xml
    but in my project also display that

    Undo create SRC_MAIN_JAVA/com/gbd/gobroad/web/Gobroad_userController_Roo_Controller.aj
    Undo create SRC_MAIN_WEBAPP/WEB-INF/spring/webmvc-config.xml
    Undo create SRC_MAIN_WEBAPP/WEB-INF/spring
    Undo create SRC_MAIN_JAVA/com/gbd/gobroad/web/Gobroad_userController.java
    Undo create SRC_MAIN_JAVA/com/gbd/gobroad/web
    Value required
    Script execution aborted
    [Timer-0] Created SRC_MAIN_JAVA/com/gbd/gobroad/web
    [Timer-0] Created SRC_MAIN_JAVA/com/gbd/gobroad/web/Gobroad_userController_Roo_Controller.aj
    [Timer-0] Managed ROOT/pom.xml [Added dependency org.apache.tiles:tiles-core:2.2.1]
    [Timer-0] Managed ROOT/pom.xml [Added dependency org.apache.tiles:tiles-jsp:2.2.1]
    [Timer-0] Undo manage ROOT/pom.xml
    [Timer-0] Undo create SRC_MAIN_JAVA/com/gbd/gobroad/web/Gobroad_userController_Roo_Controller.aj
    [Timer-0] Undo create SRC_MAIN_JAVA/com/gbd/gobroad/web
    [Timer-0] File '/Users/gbd/Documents/stsWorkspace/gobroad/src/main/webapp/WEB-INF/spring/webmvc-config.xml' does not exist
    my roo.log like that:
    // Spring Roo 1.1.0.M2 [rev 0b3543e] log opened at 2010-08-10 15:52:08
    project --topLevelPackage com.gbd.gobroad
    persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
    database properties list
    entity --class ~.domain.gobroad_user --testAutomatically
    field number id --type java.lang.Integer
    field string mobile --type java.lang.String --sizeMin 11 --sizeMax 21
    test integration
    // [failed] controller scaffold ~.web.Gobroad_userController
    // [failed] script --file ../roobackup/gobroad.memory.roo
    why?
    Last edited by sjbwylbs; Aug 10th, 2010, 04:23 AM.

  • #2
    There was a small bug in Roo which stopped the execution of your script (see https://jira.springframework.org/browse/ROO-1206 - fixed for M3 release) This has now been fixed so your script does execute correctly.

    However your script won't work with JPA / Hibernate since you seem to use some odd conventions for type naming. The MVC scaffolding will not generate pretty labels for your gobroad_user type as a result.

    I would therefore recommend for you not to use underscores in package or type names. Also, the field name 'id' is a field which Roo does use for JPA identifiers internally. Roo detects that you want to use this field as part of your business logic and automatically renames its internal JPA identifier field to '_id'. It is recommended that you name the identifier field explicitly in this case:

    Code:
    entity --class ~.Person --identifierField specialIdName
    So your script should look more like this:

    Code:
    project --topLevelPackage com.gbd.gobroad
    persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
    entity --class ~.domain.GobroadUser --identifierField userId --testAutomatically
    field number id --type java.lang.Integer
    field string mobile --type java.lang.String --sizeMin 11 --sizeMax 21
    controller scaffold ~.web.GobroadUserController
    This script should even work without the bug fix I have done for your case.

    HTH,
    Stefan

    Comment


    • #3
      thanks Stefan

      it's fine.

      Comment

      Working...
      X