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

标签 java google-app-engine maven gwt

我正在尝试使高复制适用于我的应用程序,但出现此错误:

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,但它似乎仍然没有运行具有高复制的数据存储。

顺便说一句,我使用的是 GAE SDK 版本 1.7.5。

有人知道如何解决这个问题吗?

最佳答案

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

关于java - 启用高复制数据存储 - Maven GWT + GAE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16049873/

相关文章:

java - eclipse maven项目如何配置热部署

java - Spring Controller 必需的字符串参数不存在

java - 我如何更改字符串字段的值(格式 json)?

javascript - 用于 Node 邮件程序的客户端 ID、客户端 key 和刷新 token 的 XOAuth2 gmail

google-app-engine - 错误 : (gcloud. app.deploy) INVALID_ARGUMENT:无法解析源

python - 错误 : bad runtime process port ['' ] on App Engine

eclipse - GWT - 使用 Maven 刷新 'Development Mode' 的更改

java - 视频确实在 Android 模拟器中显示

java - TCP - JAVA 客户端和 C 服务器发送和接收对象/结构

maven - 如果 Maven Central 使用 https 下载 Artifact ,是否需要验证 Artifact 签名?