Results 1 to 5 of 5

Thread: Roo and GWT problem

Hybrid View

  1. #1
    Join Date
    Sep 2012
    Posts
    6

    Default 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:

    Code:
    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:

    Code:
    Error: One or more exceptions caught, see full set in UmbrellaException#getCauses
    Application Scaffold in GWT Development Mode gives more info:
    Code:
    [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. #2
    Join Date
    Sep 2012
    Posts
    6

    Default

    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. #3
    Join Date
    Jun 2008
    Location
    Philadelphia, PA, USA
    Posts
    212

    Default

    I'd leave it here for others. Are you saying that naming a field 'name' is a problem?
    Ken Rimple
    Chariot Solutions
    email: krimple@chariotsolutions.com
    work: www.chariotsolutions.com/education
    personal: www.rimple.com

    Author: Spring Roo in Action (Manning)
    MEAP Site: manning.com/rimple

  4. #4
    Join Date
    Sep 2012
    Posts
    6

    Default

    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 at 05:19 AM.

  5. #5
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    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)?
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Tags for this Thread

Posting Permissions

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