gradle-gae-plugin无法运行gaeRun

时间:2013-07-15 18:17:29

标签: google-app-engine gradle

我正在努力证明当我们开发GAE java后端时,gradle和gradle-gae-plugin将为我们完成工作。

我取得了一些成功,但后来度过了2周假期当然应该受到惩罚......

现在我甚至无法启动应用程序。所有依赖项似乎都是正确的,项目编译正常。

=============================================== =======================

引起:java.lang.ClassNotFoundException:com.google.appengine.api.LifecycleManager $ ShutdownHook     在java.net.URLClassLoader $ 1.run(URLClassLoader.java:366)     在java.net.URLClassLoader $ 1.run(URLClassLoader.java:355)     at java.security.AccessController.doPrivileged(Native Method)     在java.net.URLClassLoader.findClass(URLClassLoader.java:354)     at java.lang.ClassLoader.loadClass(ClassLoader.java:423)     在com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:214)     at java.lang.ClassLoader.loadClass(ClassLoader.java:356)     ......还有30多个 显示java.lang.NullPointerException     at java.lang.Class.isAssignableFrom(Native Method)     在org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)     在org.mortbay.jetty.servlet.Context.startContext(Context.java:140)     at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)     在org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)     在org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)     在org.mortbay.jetty.Server.doStart(Server.java:224)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:230)     在com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:307)     在com.google.appengine.tools.development.AutomaticServerInstanceHolder.startUp(AutomaticServerInstanceHolder.java:26)     在com.google.appengine.tools.development.AbstractServer.startup(AbstractServer.java:80)     在com.google.appengine.tools.development.Servers.startup(Servers.java:78)     在com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:216)     在com.google.appengine.tools.development.DevAppServerMain $ StartAction.apply(DevAppServerMain.java:332)     在com.google.appengine.tools.util.Parser $ ParseResult.applyArgs(Parser.java:48)     在com.google.appengine.tools.development.DevAppServerMain。(DevAppServerMain.java:268)     在com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:244)

================================

apply plugin: 'gae'
apply plugin: 'eclipse'

ext.version = "130"

buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath 'org.gradle.api.plugins:gradle-gae-plugin:0.8'
    }
}

repositories {
    mavenLocal()
    mavenCentral()
    maven {
        url "http://maven.kungfuters.org/content/groups/public/"        // javapns lives here!
    }
}

configurations {
    all*.exclude module: 'slf4j-log4j12'
}

dependencies {
    def gaeVersion = '1.7.7'
    def jerseyVersion = '1.17.1'

    gaeSdk "com.google.appengine:appengine-java-sdk:$gaeVersion"

    // compile fileTree(dir: 'war/WEB-INF/lib', includes: ['*.jar'])    // TODO: Change this in ze future!

    compile "javax.servlet:servlet-api:2.5"

    compile "commons-cli:commons-cli:1.2"
    compile "org.apache.commons:commons-lang3:3.1"
    compile "org.json:json:20090211"
    compile "javax.ws.rs:jsr311-api:1.1.1"

    compile "org.picocontainer:picocontainer:2.14.3"

    compile "com.google.appengine:appengine-api-1.0-sdk:$gaeVersion"
    compile "com.google.appengine:appengine-api-stubs:$gaeVersion"
    compile "com.google.appengine:appengine-remote-api:$gaeVersion"

    compile "com.google.appengine.tools:appengine-gcs-client:0.3"
    compile "com.google.appengine.tools:appengine-mapreduce:0.2"
    compile "com.google.appengine.tools:appengine-pipeline:0.1"


    compile "com.google.api-client:google-api-client:1.15.0-rc"
    compile "com.google.api-client:google-api-client-appengine:1.15.0-rc"
    compile "com.google.api.client:google-api-client-json:1.2.3-alpha"
    compile "com.google.apis:google-api-services-bigquery:v2-rev97-1.15.0-rc"
    compile "com.google.apis:google-api-services-storage:v1beta2-rev10-1.15.0-rc"
    compile "com.google.http-client:google-http-client:1.15.0-rc"
    compile "com.google.http-client:google-http-client-jackson:1.15.0-rc"

    compile "com.googlecode.javapns:javapns:2.2"

    compile "com.sun.jersey:jersey-core:$jerseyVersion" 
    compile "com.sun.jersey:jersey-server:$jerseyVersion"   
    compile "com.sun.jersey:jersey-servlet:$jerseyVersion" 
    compile "com.sun.jersey:jersey-client:$jerseyVersion"   
    compile "com.sun.jersey:jersey-json:$jerseyVersion"

    compile "org.bouncycastle:bcprov-jdk15on:1.48"

    runtime "org.slf4j:slf4j-jdk14:1.7.5"

    testCompile "junit:junit:4.10"
    testCompile "org.mockito:mockito-all:1.9.0"
    testCompile "com.google.appengine:appengine-testing:$gaeVersion"
}


sourceSets {
    main { java {srcDir 'src' } }
    test { java {srcDir 'testsrc' } }
}

test {
  // set heap size for the test JVM(s)
  minHeapSize = "128m"
  maxHeapSize = "512m"

  // set JVM arguments for the test JVM(s)
  jvmArgs '-XX:MaxPermSize=768m'

  // listen to events in the test execution lifecycle
  beforeTest { descriptor ->
     logger.lifecycle("Running: " + descriptor)
  }
} 

webAppDirName = file('war') 

gae {
    httpPort = 8888
    jvmFlags = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8889', '-Xmx1024m', '-XX:MaxPermSize=512m']
    downloadSdk = true
    warDir = file('war')

    appcfg {
        update {
         useJava7 = true
        }

        email = 'foo@bar.se'
        passIn = true

        logs {
            severity = 1
            numDays = 1
            outputFile = file('dalby.log')
        }

        app {
            id = 'dalby-gunnar'
        }
    }
}

eclipse {
    classpath {
       downloadSources=true
    }
}

1 个答案:

答案 0 :(得分:0)

听起来你必须告诉Java编译器(我假设您的代码是用Java编写的)来设置注释处理。从我在错误消息中看到的内容,我将尝试以下内容:

停用注释处理

compileJava.options.compilerArgs = ['-proc:none']

启用注释处理

compileJava.options.compilerArgs = ['-implicit']