Results 1 to 9 of 9

Thread: roo hangs on creating a new entity

  1. #1

    Default roo hangs on creating a new entity

    This bug has been raised before, but there was no further discussion on it.

    http://forum.springsource.org/showthread.php?t=79487

    I log on to roo and run the following command:

    entity --class ~.domain.customer.data.CustomerEntity

    roo> entity --class ~.domain.customer.data.CustomerEntity
    Created SRC_MAIN_JAVA\uk\co\mo\app\moses\domain\customer\d ata
    Created SRC_MAIN_JAVA\uk\co\mo\app\moses\domain\customer\d ata\CustomerEntity.java

    Hangs

    Opening up a new command shell running roo again then creates

    Created SRC_MAIN_JAVA\uk\co\mo\app\moses\domain\customer\d ata\CustomerEntity_Roo
    _Entity.aj
    Created SRC_MAIN_JAVA\uk\co\mo\app\moses\domain\customer\d ata\CustomerEntity_Roo
    _ToString.aj
    Created SRC_MAIN_JAVA\uk\co\mo\app\moses\domain\customer\d ata\CustomerEntity_Roo
    _Configurable.aj
    Undo create SRC_MAIN_JAVA\uk\co\mo\app\moses\domain\customer\d ata\CustomerEntity
    _Roo_Configurable.aj
    Undo create SRC_MAIN_JAVA\uk\co\mo\app\moses\domain\customer\d ata\CustomerEntity
    _Roo_ToString.aj
    Undo create SRC_MAIN_JAVA\uk\co\mo\app\moses\domain\customer\d ata\CustomerEntity
    _Roo_Entity.aj

    This still does not creat all the files needed.

    Thanks for any help

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    From the information you shared here it is hard for us to determine what exactly went wrong. Would you mind switching on development mode before running your script?:

    Code:
    roo> development mode
    roo> project ...
    This should produce a complete stack trace which you can analyse and share here.

    It would also help if you should share the script you are running (log.roo).
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  3. #3

    Default

    Thanks for the reply we found the problem, one of the first entitys created had a private instance variable.

    As soon as we made it protected the roo entity command no longer hanged.

    Tony

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Hi Tony

    Roo shouldn't hang if you have a private instance variable. Would you mind helping us fix this up by seeing if you can revert your .java file back to the form where it broke Roo and then posting that file in a Jira issue report at https://jira.springsource.org/browse/ROO? That way we can fix it up for everyone.

    Thanks
    Ben
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  5. #5

    Default

    Will try to when I get time, will try this weekend, project constraints at the moment.

  6. #6

    Default

    The first var customerId. Create a new entity it will hang, change it to private it works.


    @Entity
    @org.hibernate.annotations.Entity(dynamicUpdate = true)
    @RooJavaBean
    @RooToString
    @RooEntity
    @Table(name = "Customers")
    public class CustomerEntity {
    @Id
    @NotNull
    @Column(name = "customer_id")
    private Integer customerId;

    @NotNull
    @Column(name = "crn", columnDefinition = "CHAR 8 NULL")
    @Size(max = 8)
    private String crn;

    @Size(max = 50)
    private String forename;

    @Size(max = 50)
    private String surname;


    /**
    * @param crn the crn to set
    */
    public void setCrn(String crn) {
    this.crn = crn;
    }


    /**
    * @return the crn
    */
    public String getCrn() {
    return crn;
    }

    /**
    * @return the forename
    */
    public String getForename() {
    return forename;
    }

    /**
    * @return the surname
    */
    public String getSurname() {
    return surname;
    }

    /**
    * @return the customerId
    */
    public Integer getCustomerId() {
    return customerId;
    }

    /**
    * @param forename the forename to set
    */
    public void setForename(String forename) {
    this.forename = forename;
    }

    /**
    * @param surname the surname to set
    */
    public void setSurname(String surname) {
    this.surname = surname;
    }

    }

  7. #7

    Default

    Sorry I mean change it to protected it works.

  8. #8

    Default

    Its only the vars with the @id annotation that should be protected not private

  9. #9
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    This could be related to https://jira.springsource.org/browse/ROO-489. I did some fixes which will be in Roo 1.0.1 and it might correct the problem. Would you mind trying Roo from trunk and seeing if it works OK now? If not, please log a bug report at https://jira.springsource.org/browse/ROO and I will be pleased to get this fixed for you.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •