启用高复制数据存储 - Maven GWT + GAE

时间:2013-04-17 01:22:23

标签: java google-app-engine maven gwt

我试图让High replication与我的应用程序一起工作,但是我收到了这个错误:

java.lang.IllegalArgumentException: transactions on multiple entity groups only allowed in High Replication applications

我的maven插件可能无法获得正确的配置(jvmFlag):

     <plugin>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
        <version>${gaeVersion}</version>
     </plugin>
     <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${gwtVersion}</version>
        <executions>
           <execution>
              <!-- gwt:compile happens just before package phase -->
              <phase>prepare-package</phase>
              <goals>
                 <goal>compile</goal>
              </goals>
           </execution>
        </executions>
        <configuration>
           <modules>
              <module>org.jboss.errai.ui.demo.App</module>
           </modules>
           <runTarget>index.html</runTarget>
           <appEngineVersion>${gaeVersion}</appEngineVersion>
           <!-- tell the gwt plugin that the webapp source resides in src/main/webapp -->
           <webappDirectory>${webappDirectory}</webappDirectory>
           <!-- tell the gwt plugin that dev mode should be run using the webapp that resides in target/${webappDirectory} -->
           <hostedWebapp>${webappDirectory}</hostedWebapp>
           <!-- Normally the gwt maven plugin executes dev mode using a builtin jetty server.
                This config property instructs the gwt maven plugin to execute dev mode using the 
                jetty server supplied by the appengine sdk. -->
           <server>com.google.appengine.tools.development.gwt.AppEngineLauncher</server>
           <jvmFlags>
                <jvmFlag>-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20</jvmFlag>
           </jvmFlags>
        </configuration>
     </plugin>

我使用此命令运行我的应用程序mvn gwt:run它工作正常,它只能在执行Transaction时正确访问数据存储区我得到了该错误。我已经添加了jvmFlag,但它似乎仍然没有运行带有High Replication的数据存储区。

我使用的是GAE SDK版本1.7.5 BTW。

任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

<plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>2.5.1</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <server>com.google.appengine.tools.development.gwt.AppEngineLauncher</server>
                        <appEngineVersion>1.8.0</appEngineVersion>
                        <runTarget>test.html</runTarget>
                        <hostedWebapp>${webappDirectory}</hostedWebapp>
                        <extraJvmArgs>-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20</extraJvmArgs>
                    </configuration>
</plugin>

这部分POM适合我!我使用<extraJvmArgs>代替<jvmFlag>