Tuesday, 10 September 2013

App engine dev server cross-group transactions with appengine-maven-plugin

App engine dev server cross-group transactions with appengine-maven-plugin

I am receiving an exception when I run JUnit tests on my App Engine project
java.lang.IllegalArgumentException: cross-group transaction need to be
explicitly specified
I am using Objectify (4.0b3), app engine and appengine-maven-plugin (1.8.4).
Objectify enables cross-group transactions if they are possible. However,
I read that they are disabled by default on the dev server. I would like
to enable them via my pom.xml
I have attempted to construct my pom.xml according to the documentation
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.target.version}</version>
<configuration>
<useJava7>true</useJava7>
<address>127.0.0.1</address>
<port>8080</port>
<compileEncoding>utf-8</compileEncoding>
<jvmFlags>
<jvmFlag>-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20</jvmFlag>
</jvmFlags>
</configuration>
</plugin>
My IDE is Eclipse Kepler x64 (the Maven plugin came pre-installed but I
needed to point it to an external installation of Maven 3.1.0) and the
Google Plugin 4.3 (only the required packages). My java is
jdk-7u40-windows-x64.
The only version of the App Engine SDK available to this project is
downloaded through Maven (not installed with the eclipse plugin).
When I go to my project properties (after doing a Maven->Update Project) I
see:

Note that the image says "The selected SDK does not support HRD" and the
Use Specific SDK says "unknown version" at the end. I saw the same thing
with 1.8.3 on my old Eclipse install.
I don't want to install another version of the SDK because Maven will just
overwrite my project settings.
I'm a Java/Maven/App Engine newbie, so any help would be much appreciated.
Thanks.
Update 1:
As an interim solution, I decided to use the UI configuration with an
externally downloaded 1.8.4 SDK (just to test a build). However, the
moment you change the SDK in the UI, it creates a conflict with Maven
The App Engine SDK
'C:\Users\Steven.m2\repository\com\google\appengine\appengine-api-1.0-sdk\1.8.4\appengine-api-1.0-sdk-1.8.4.jar'
on the project's build path is not valid (SDK location
'C:\Users\Steven.m2\repository\com\google\appengine\appengine-api-1.0-sdk\1.8.4\appengine-api-1.0-sdk-1.8.4.jar'
is not a directory) projectname Unknown Google App Engine Problem
Even if the SDK is removed via the UI, its JARs removed from the
classpath, and the project cleaned and updated with Maven, the error will
persist.
I was curious and set the UI to point to the location defaulted in the
dropdown menu (I assume Maven had some hand in populating this) and I see:

And, as another experiment, I attempted to manually add the same directory:

None of this is really surprising though, since Maven is downloading Jars
and not the full SDK.

No comments:

Post a Comment