Announcement Announcement Module
No announcement yet.
Roo and GWT problem Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo and GWT problem

    Hello, I need to use GWT (corporate decision) and I would like to use Roo. But I'm meeting lots of problems even in simple projects. I have simple script like this:

    project --topLevelPackage com.springsource.roo.testroo
    jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
    entity jpa --class ~.domain.Service --testAutomatically
    field string --fieldName SRV_ID --notNull --sizeMax 3 --sizeMin 3
    field string --fieldName SERVICE --notNull --sizeMax 20
    web gwt setup
    web gwt all --proxyPackage ~.client.proxy --requestPackage ~.client.request
    Then exit and mvn gwt:run

    The web page starts but when I click on Create Service there is browser pop-up error:

    Error: One or more exceptions caught, see full set in UmbrellaException#getCauses
    Application Scaffold in GWT Development Mode gives more info:
    [ERROR] Could not find a getter for path sRV_ID in proxy type com.springsource.roo.testroo.client.proxy.ServiceProxy
    [ERROR] Could not find a getter for path sERVICE in proxy type com.springsource.roo.testroo.client.proxy.ServiceProxy
    [ERROR] Unable to create Editor model due to previous errors
    Am I doing something wrong? I tried to resolve it by myself but allmost all tutorials and helps on the net are for Roo 1.1 which is diferent and they didn't work well.

    I am using Roo 1.2.2, Maven 3.0.3

  • #2
    It's funny how I resolve the problem everytime after posting question on the forum.

    The problem were actually names of fields. After changing name to "srvid" and "name" the application works well.

    Should I delete this thread then or leave it for others?


    • #3
      I'd leave it here for others. Are you saying that naming a field 'name' is a problem?


      • #4
        Well I played with it lately and it's quite funny The problem was uppercase and lowercase characters of the field name but it's not that easy I used original names - SRV_ID and SERVICE. Here's what I discovered:

        Only first two characters of the fieldName are important
        1. When the 1st character is uppercase and the 2nd is lowercase the maven build mvn gwt:run will fail with error
        2. When the 2nd character is uppercase and the 1st is lowercase the maven build will run ok, the website will load ok but it will fail when I want to create new service (with error like in OP)
        3. When the 1st and 2nd character is uppercase the situation will be same as in 2.
        4. When the 1st and 2nd character is lowercase then everything works well.

        Short version: first two characters must be lowercase (At least in my project). Funny Is it somewhere in manual or in reference?
        Last edited by Mirosllav; Oct 5th, 2012, 05:19 AM.


        • #5
          I suggest a read of the java beans specification as that is basically is what you describe ... The second letter uppercase is basically an exception to the normal rule of propertyName -> getPropertyName rule... The getter is then pRopertyName -> getpRopertyName...

          So it might be that there is either something fishy in Spring Roo Jpa stuff of GWT stuff (or maybe GWT itself)?