簡體   English   中英

執行gae時出現問題:使用gae maven插件運行

[英]Trouble while executing gae:run using gae maven plugin

當我運行gae:run時,它會成功構建jar並啟動服務器。 但由於我無法進入請求的頁面,因此服務器似乎未完全啟動。

當我使用由maven gae插件創建的war啟動使用IDE(不是maven gae插件)的服務器時,它啟動就沒有問題。

這是我的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>deplake</groupId>
<artifactId>deplake-core</artifactId>
<packaging>war</packaging>
<version>1.17R1-SNAPSHOT</version>

<properties>
    <gae.version>1.6.3.1</gae.version>
    <gae.runtime>1.4.0</gae.runtime>
    <gae.home>
        ${settings.localRepository}/com/google/appengine/appengine-java-sdk/${gae.version}/appengine-java-sdk-${gae.version}
    </gae.home>
    <gae.application.version>1</gae.application.version>
    <gae.port>8081</gae.port>
</properties>

<repositories>
    <repository>
        <id>twig</id>
        <url>http://mvn.twig-persist.googlecode.com/hg</url>
    </repository>
    <repository>
        <id>uk</id>
        <url>http://uk.maven.org/maven2/</url>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>maven-gae-plugin-repo</id>
        <name>Maven Google App Engine Repository</name>
        <url>http://maven-gae-plugin.googlecode.com/svn/repository/</url>
    </pluginRepository>
</pluginRepositories>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>net.kindleit</groupId>
            <artifactId>maven-gae-plugin</artifactId>
            <version>0.9.2</version>
            <dependencies>
                <dependency>
                    <groupId>net.kindleit</groupId>
                    <artifactId>gae-runtime</artifactId>
                    <version>${gae.runtime}</version>
                    <type>pom</type>
                </dependency>
                <dependency>
                    <groupId>com.google.appengine</groupId>
                    <artifactId>appengine-tools-sdk</artifactId>
                    <version>${gae.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.google.appengine</groupId>
                    <artifactId>appengine-api-1.0-sdk</artifactId>
                    <version>${gae.version}</version>
                </dependency>
            </dependencies>
        </plugin>

        <plugin>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
                <goals>gae:debug</goals>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>com.vercer.engine.persist</groupId>
        <artifactId>twig-persist</artifactId>
        <version>1.0.4</version>
    </dependency>
    <dependency>
        <groupId>com.opensymphony</groupId>
        <artifactId>xwork</artifactId>
        <version>2.1.2</version>
    </dependency>
    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.19</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>opensymphony</groupId>
        <artifactId>sitemesh</artifactId>
        <version>2.4.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.1.6</version>
    </dependency>



</dependencies>

這是我的日志:

+ Enabling strict checksum verification on all artifact downloads.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - deplake:deplake-core:war:1.17R1-SNAPSHOT
[INFO]    task-segment: [net.kindleit:maven-gae-plugin:0.9.2:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing gae:run
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\4work\mvn+gae+struts2\test\src\test\resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Tests are skipped.
[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] Assembling webapp[deplake-core] in [D:\4work\mvn+gae+struts2\test\target\deplake-core-1.17R1-SNAPSHOT]
[INFO] Dependency[Dependency {groupId=com.vercer.engine.persist, artifactId=twig-persist, version=1.0.4, type=jar}] has changed (was Dependency {groupId=com.vercer.engine.persist, artifactId=twig-persist, version=1.0.4, type=jar}).
[INFO] Dependency[Dependency {groupId=com.opensymphony, artifactId=xwork, version=2.1.2, type=jar}] has changed (was Dependency {groupId=com.opensymphony, artifactId=xwork, version=2.1.2, type=jar}).
[INFO] Dependency[Dependency {groupId=org.freemarker, artifactId=freemarker, version=2.3.19, type=jar}] has changed (was Dependency {groupId=org.freemarker, artifactId=freemarker, version=2.3.19, type=jar}).
[INFO] Dependency[Dependency {groupId=org.springframework, artifactId=spring-web, version=3.1.1.RELEASE, type=jar}] has changed (was Dependency {groupId=org.springframework, artifactId=spring-web, version=3.1.1.RELEASE, type=jar}).
[INFO] Dependency[Dependency {groupId=opensymphony, artifactId=sitemesh, version=2.4.2, type=jar}] has changed (was Dependency {groupId=opensymphony, artifactId=sitemesh, version=2.4.2, type=jar}).
[INFO] Dependency[Dependency {groupId=org.apache.struts, artifactId=struts2-core, version=2.1.6, type=jar}] has changed (was Dependency {groupId=org.apache.struts, artifactId=struts2-core, version=2.1.6, type=jar}).
[INFO] Processing war project
[INFO] Copying webapp resources[D:\4work\mvn+gae+struts2\test\src\main\webapp]
[INFO] Webapp assembled in[417 msecs]
[INFO] Building war: D:\4work\mvn+gae+struts2\test\target\deplake-core-1.17R1-SNAPSHOT.war
[INFO] [gae:run {execution: default-cli}]
16.03.2012 10:10:31 com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
16.03.2012 10:10:31 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed D:\4work\mvn+gae+struts2\test\target\deplake-core-1.17R1-SNAPSHOT\WEB-INF/appengine-web.xml
16.03.2012 10:10:31 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed D:\4work\mvn+gae+struts2\test\target\deplake-core-1.17R1-SNAPSHOT\WEB-INF/web.xml
16.03.2012 10:10:32 com.google.apphosting.utils.jetty.JettyLogger info
INFO: jetty-6.1.x
16.03.2012 10:10:33 com.google.appengine.tools.development.ApiProxyLocalImpl log
INFO: javax.servlet.ServletContext log: Initializing Spring root WebApplicationContext
16.03.2012 10:10:33 org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
16.03.2012 10:10:33 org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Fri Mar 16 10:10:33 UTC 2012]; root of context hierarchy
16.03.2012 10:10:33 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
16.03.2012 10:10:33 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@323274: defining beans []; root of factory hierarchy
16.03.2012 10:10:33 org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 446 ms
16.03.2012 10:10:35 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
16.03.2012 10:10:36 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
16.03.2012 10:10:36 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-plugin.xml]
16.03.2012 10:10:36 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts.xml]
16.03.2012 10:10:36 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Overriding property struts.i18n.reload - old value: false new value: true
16.03.2012 10:10:36 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Overriding property struts.configuration.xml.reload - old value: false new value: true
16.03.2012 10:10:36 com.google.apphosting.utils.jetty.JettyLogger info
INFO: Started SelectChannelConnector@0.0.0.0:8081
16.03.2012 10:10:37 com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8081/
16.03.2012 10:10:37 com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at http://localhost:8081/_ah/admin

當我使用IDE日志啟動服務器時,會有更多項目。 以下是從IDE啟動時添加的行:

INFO: Started SelectChannelConnector@127.0.0.1:8081
16.03.2012 10:27:54 com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8081/
16.03.2012 10:27:54 com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at http://localhost:8081/_ah/admin
16.03.2012 10:27:56 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [struts.actionMapping]
16.03.2012 10:27:56 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [struts.valueStack]
16.03.2012 10:27:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [com.google.appengine.backend.BackendName]
16.03.2012 10:27:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [org.apache.catalina.jsp_file]
16.03.2012 10:27:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [org.apache.catalina.jsp_file]
16.03.2012 10:27:57 com.google.appengine.tools.appstats.AppstatsFilter doFilter
INFO: Appstats available: /appstats/details?time=1331893675205
16.03.2012 10:27:57 com.google.appengine.tools.appstats.AppstatsFilter doFilter
INFO: Appstats available: /appstats/details?time=1331893677745
16.03.2012 10:27:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [struts.actionMapping]
16.03.2012 10:27:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [struts.valueStack]
16.03.2012 10:27:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [com.google.appengine.backend.BackendName]
16.03.2012 10:27:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [org.apache.catalina.jsp_file]
16.03.2012 10:27:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [org.apache.catalina.jsp_file]
16.03.2012 10:28:01 com.google.appengine.tools.appstats.AppstatsFilter doFilter
INFO: Appstats available: /appstats/details?time=1331893681241
16.03.2012 10:28:01 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [struts.actionMapping]
16.03.2012 10:28:01 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [struts.valueStack]
16.03.2012 10:28:01 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [com.google.appengine.backend.BackendName]
16.03.2012 10:28:01 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [org.apache.catalina.jsp_file]
16.03.2012 10:28:01 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Could not find property [org.apache.catalina.jsp_file]
16.03.2012 10:28:01 com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /favicon.ico
16.03.2012 10:28:01 com.google.appengine.tools.appstats.AppstatsFilter doFilter
INFO: Appstats available: /appstats/details?time=1331893681844

將“ mvndependency:tree”的輸出與您的項目“構建路徑”進行比較。 您可能錯過了pom.xml中的依賴項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM