0
votes

There seems to be a problem with Spring Roo, GAE, and GWT. Here is a simple roo script.

project --topLevelPackage com.my.gae --projectName gaetest --java 6 
persistence setup --provider DATANUCLEUS --database GOOGLE_APP_ENGINE
entity jpa --class ~.domain.Person
field string --fieldName name
web gwt setup
web gwt all --proxyPackage ~.proxy --requestPackage ~.request
web gwt gae update
logging setup --level DEBUG
  1. roo script <path-to-above-script>

  2. Fix a bug in the pom by adding <scope>runtime</scope> to the datanucleus-core dependency

<dependency>
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-core</artifactId>
    <version>3.0.7</version>
    <scope>runtime</scope>
</dependency>

3. mvn gae:run

There will be many errors.

[INFO] Checking rule 
[INFO] [ERROR] Errors in 'file:/C:/Java/Roo/MyRooSamples/gae6/src/main/java/com/my/gae/client/managed/req
uest/ApplicationRequestFactory.java'
[INFO] [ERROR] Line 11: No source code is available for type com.my.gae.request.PersonRequest; did you
 forget to inherit a required module?
[INFO] [ERROR] Errors in 'file:/C:/Java/Roo/MyRooSamples/gae6/src/main/java/com/my/gae/client/managed/act
ivity/ApplicationDetailsActivities_Roo_Gwt.java'
[INFO] [ERROR] Line 29: No source code is available for type com.my.gae.proxy.PersonProxy; did you for
get to inherit a required module?
[INFO] [ERROR] Errors in 'file:/C:/Java/Roo/MyRooSamples/gae6/src/main/java/com/my/gae/client/managed/act
ivity/ApplicationMasterActivities_Roo_Gwt.java'

I am using 1.2.1.RELEASE [rev 6eae723] of Roo.

Is there a workaround or perhaps I have made an error ?

1

1 Answers

1
votes

I was getting several errors as well when trying to create GWT application for the Google App Engine using Spring Roo 1.2.1. I created my project using the SpringSource Tool Suite (STS). Took me forever, but I finally got it working by making some changes to my pom.xml.

    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jpa_2.0_spec</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-core</artifactId>
        <version>3.0.8</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-api-jdo</artifactId>
        <version>3.0.7</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-api-jpa</artifactId>
        <version>3.0.7</version>
    </dependency>
    <dependency>
        <groupId>javax.jdo</groupId>
        <artifactId>jdo-api</artifactId>
        <version>3.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-rdbms</artifactId>
        <version>3.0.7</version>
    </dependency>

I also enabled Datanucleus Support (right click on project, Datanucleus -> Add Data Nucleus Support), then enhanced the classes manually (right click on project, Datanucleus -> Run Enhancer Tool). These Datanucleus steps failed without the preceding pom.xml changes.

The application launches fine. However, now I can't get the RequestValidationTool to work.