GWT 2.7 + GAE应用程序在部署时查找代码服务器 [英] GWT 2.7 + GAE app looks for codeserver when deployed

查看:136
本文介绍了GWT 2.7 + GAE应用程序在部署时查找代码服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么appengine尝试使用超级开发模式?



每次我将我的GWT应用程序部署到appengine并尝试访问它时,我会看到白色的加载屏幕,然后大约20-30秒后,我收到以下消息:



我使用Maven与 gwt-maven-plugin 应用服务引擎-行家-插件。使用 maven-gae-plugin 进行部署会得到相同的结果。



如果我切换回使用2.6.1版本的gwt和gwt-maven-plugin,它会部署OK,所以它看起来与自动开发模式启动器有关。



我的一些pom.xml



 < build> 
< outputDirectory> $ {webappDirectory} / WEB-INF / classes< / outputDirectory>

<资源>
< resource>
<目录> src / main / resources< /目录>
< / resource>
< resource>
<目录> src / main / super< / directory>
< / resource>
< resource>
< directory> $ {project.build.directory} / generated-sources / apt< / directory>
< / resource>
< resource>
< directory> $ {project.build.directory} / generated-sources / gwt< / directory>
< / resource>
< /资源>

< plugins>

< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> $ {maven-compiler-plugin.version}< / version>
<配置>
< source> $ {target.jdk}< / source>
< target> $ {target.jdk}< / target>
< encoding> $ {project.build.sourceEncoding}< /编码>
< proc> none< / proc>
< / configuration>
< / plugin>

<! - JUnit测试 - 跳过* .GwtTest个案 - >
<! - 'mvn test' - 运行Jukito测试 - >
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-surefire-plugin< / artifactId>
< version> $ {maven-surefire-plugin.version}< / version>
<配置>
<包括>
< include> ** / * Test.java< / include>
< / includes>
<排除>
< exclude> ** / * GwtTest.java< / exclude>
< exclude> ** / * JUnitTest.java< / exclude>
< /不包括>
< / configuration>
< / plugin>

<! - GWT - >
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> gwt-maven-plugin< / artifactId>
< version> $ {gwt-maven-plugin.version}< / version>
<配置>
< strict> true< / strict>
< testTimeOut> 180< / testTimeOut>
<! - 多次测试使用GwtTestSuite.java来获得速度 - >
< includes> ** / * GwtTest.java< / includes>
< mode> htmlunit< / mode>

< extraJvmArgs> -Xss1024k -Xmx2048M -XX:MaxPermSize = 512M< / extraJvmArgs>
< logLevel> INFO< / logLevel>
< style> PRETTY< / style>

< copyWebapp> true< / copyWebapp>
< hostedWebapp> $ {webappDirectory}< / hostedWebapp>

< server> com.google.appengine.tools.development.gwt.AppEngineLauncher< / server>
< appEngineVersion> $ {gae.version}< / appEngineVersion>
< appEngineHome> $ {gae.home}< / appEngineHome>
< extraJvmArgs> -Dappengine.sdk.root = $ {gae.home}< / extraJvmArgs>
< extraJvmArgs> -Ddatastore.default_high_rep_job_policy_unapplied_job_pct = 20< / extraJvmArgs>
< port> 8888< / port>

< runTarget> Project.html< / runTarget>
<模块>
< module> com.utilitiessavings.usavappv7.Project< / module>
< / modules>
< / configuration>
<执行次数>
<执行>
<目标>
< goal>编译< / goal>
< goal>测试< / goal>
< /目标>
< /执行>
< /执行次数>
< / plugin>

<! - Google App Engine部署 - >
< plugin>
< groupId> com.google.appengine< / groupId>
< artifactId> appengine-maven-plugin< / artifactId>
< version> $ {gae.version}< / version>
<配置>
< enableJarSplitting> true< / enableJarSplitting>
< / configuration>
< / plugin>
< / plugins>
< / build>

<依赖关系>

<! - Google Web Toolkit依赖项 - >
< dependency>
< groupId> com.google.gwt< / groupId>
< artifactId> gwt-user< / artifactId>
<版本> $ {gwt.version}< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> com.google.gwt< / groupId>
< artifactId> gwt-servlet< / artifactId>
<版本> $ {gwt.version}< / version>
< scope>运行时< / scope>
< /依赖关系>

<! - Google App Engine依赖项 - >
< dependency>
< groupId> com.google.appengine< / groupId>
< artifactId> appengine-api-1.0-sdk< / artifactId>
< version> $ {gae.version}< / version>
< /依赖关系>
<! - Testing - >
< dependency>
< groupId> com.google.appengine< / groupId>
< artifactId> appengine-api-labs< / artifactId>
< version> $ {gae.version}< / version>
< /依赖关系>
< dependency>
< groupId> com.google.appengine< / groupId>
< artifactId> appengine-api-stubs< / artifactId>
< version> $ {gae.version}< / version>
< scope> test< / scope>
< /依赖关系>
< dependency>
< groupId> com.google.appengine< / groupId>
< artifactId> appengine-testing< / artifactId>
< version> $ {gae.version}< / version>
< scope> test< / scope>
< /依赖关系>

<! - 持久性依存关系 - >
< dependency>
< groupId> javax.persistence< / groupId>
< artifactId> persistence-api< / artifactId>
< version> $ {persistence-api.version}< / version>
< /依赖关系>
< dependency>
< groupId> com.googlecode.objectify< / groupId>
< artifactId> objectify< / artifactId>
< version> $ {objectify.version}< / version>
< /依赖关系>
< dependency>
< groupId> javax.validation< / groupId>
< artifactId> validation-api< / artifactId>
< version> $ {javax.validation.version}< / version>
< /依赖关系>

<! - 其他依赖关系 - >
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> servlet-api< / artifactId>
< version> $ {servlet-api.version}< / version>
< scope>运行时< / scope>
< /依赖关系>
< dependency>
< groupId> jstl< / groupId>
< artifactId> jstl< / artifactId>
< version> 1.2< / version>
< /依赖关系>

< /依赖关系>



在我的Project.gwt.xml中



 < add-linker name =xsiframe/> 

(尝试删除此行但仍得到相同结果)

Environment



Eclipse Luna(4.4.1)

Maven 3.2.3(3.2 .1嵌入式)

m2eclipse 1.5.0

解决方案

gwt:compile 试图通过比较nocache.js文件的时间戳与源文件的时间戳来递增工作,如果它认为输出是最新的,则跳过GWT编译至今。不过,这很脆弱 gwt:run (无< superDevMode> false< / superDevMode> ;以及 gwt:运行代码服务器 launcherDir )会覆盖nocache.js,并且这可能会导致 gwt:compile 跳过编译。



结论是:部署或释放时,确保首先运行<$ c通过传递 -Dgwt来运行$ c> mvn clean force gwt:compile 编译器.force 到Maven。


Why does appengine try to use Super Dev Mode?

Every time I deploy my GWT app to appengine and try to access it I get the white loading screen, then after about 20-30 seconds I get this message:

I use maven with the gwt-maven-plugin and appengine-maven-plugin. Deploying using the maven-gae-plugin gives the same results.

If I switch back to using 2.6.1 versions of gwt and the gwt-maven-plugin it deploys ok, so it would seem it's something to do with the automatic dev mode launcher.

Some of my pom.xml

    <build>
        <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/super</directory>
            </resource>
            <resource>
                <directory>${project.build.directory}/generated-sources/apt</directory>
            </resource>
            <resource>
                <directory>${project.build.directory}/generated-sources/gwt</directory>
            </resource>
        </resources>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${target.jdk}</source>
                    <target>${target.jdk}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <proc>none</proc>
                </configuration>
            </plugin>

            <!-- JUnit Testing - skip *.GwtTest cases -->
            <!-- 'mvn test' - runs the Jukito tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/*GwtTest.java</exclude>
                        <exclude>**/*JUnitTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <!-- GWT -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${gwt-maven-plugin.version}</version>
                <configuration>
                    <strict>true</strict>
                    <testTimeOut>180</testTimeOut>
                    <!-- With multiple tests use GwtTestSuite.java for speed -->
                    <includes>**/*GwtTest.java</includes>
                    <mode>htmlunit</mode>

                    <extraJvmArgs>-Xss1024k -Xmx2048M -XX:MaxPermSize=512M</extraJvmArgs>
                    <logLevel>INFO</logLevel>
                    <style>PRETTY</style>

                    <copyWebapp>true</copyWebapp>
                    <hostedWebapp>${webappDirectory}</hostedWebapp>

                    <server>com.google.appengine.tools.development.gwt.AppEngineLauncher</server>
                    <appEngineVersion>${gae.version}</appEngineVersion>
                    <appEngineHome>${gae.home}</appEngineHome>
                    <extraJvmArgs>-Dappengine.sdk.root=${gae.home}</extraJvmArgs>
                    <extraJvmArgs>-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20</extraJvmArgs>
                    <port>8888</port>

                    <runTarget>Project.html</runTarget>
                    <modules>
                        <module>com.utilitiessavings.usavappv7.Project</module>
                    </modules>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Google App Engine Deployment -->
            <plugin>
                <groupId>com.google.appengine</groupId>
                <artifactId>appengine-maven-plugin</artifactId>
                <version>${gae.version}</version>
                <configuration>
                    <enableJarSplitting>true</enableJarSplitting>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>

        <!-- Google Web Toolkit dependencies -->
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwt.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwt.version}</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Google App Engine dependencies -->
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-1.0-sdk</artifactId>
            <version>${gae.version}</version>
        </dependency>
        <!-- Testing -->
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-labs</artifactId>
            <version>${gae.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-stubs</artifactId>
            <version>${gae.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-testing</artifactId>
            <version>${gae.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Persistence dependencies -->
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>${persistence-api.version}</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.objectify</groupId>
            <artifactId>objectify</artifactId>
            <version>${objectify.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>${javax.validation.version}</version>
        </dependency>

        <!-- Other dependencies -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>${servlet-api.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

    </dependencies>

In my Project.gwt.xml

<add-linker name="xsiframe" />

(Tried removing this line but still got the same result)

Environment

Eclipse Luna (4.4.1)

Maven 3.2.3 (3.2.1 Embedded)

m2eclipse 1.5.0

解决方案

gwt:compile tries to work "incrementally" by comparing the timestamp of the nocache.js file with the ones of the source files, and skipping GWT compilation if it thinks the output is up-to-date. This is brittle though. gwt:run (without <superDevMode>false</superDevMode>; and gwt:run-codeserver with launcherDir) will overwrite the nocache.js with a SuperDevMode-specific version, and this is likely to lead to gwt:compile skipping the compilation.

The takeaway is: when deploying or "releasing", make sure you first run mvn clean or force gwt:compile to run by passing -Dgwt.compiler.force to Maven.

这篇关于GWT 2.7 + GAE应用程序在部署时查找代码服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆