阅读背景:

gradle-gae-plugin无法运行gaeRun

来源:互联网 

I am struggling with proving that gradle and gradle-gae-plugin will do the job for us when we develop our GAE java backend.

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

I have had some success but then took 2 weeks vacation which of course should be punished ...

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

Now I can't even start the app. All dependencies seems correct and the project compiles alright.

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

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

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

引起:java.lang.ClassNotFoundException:java.net.URLClassLoader $ 1.run中的com.google.appengine.api.LifecycleManager $ ShutdownHook在java.net.URLClassLoader $ 1.run(URLClassLoader.java:366)$ 1.run(URLClassLoader.java: 355)在com.google.appengine的java.lang.ClassLoader.loadClass(ClassLoader.java:423)java.net.URLClassLoader.findClass(URLClassLoader.java:354)的java.security.AccessController.doPrivileged(Native Method) .tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:214)在java.lang.ClassLoader.loadClass(ClassLoader.java:356)......在java.lang.Class.isAssignableFrom 30多个显示java.lang.NullPointerException(母语法)在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.webapp.WebAppContext.sta的org.mortbay.jetty.servlet.Context.startContext(Context.java:140) org.mortbay上org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)的org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)中的rtContext(WebAppContext.java:1250) .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上的com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:230) com.google.appengine.tools.developme上的.tools.development.AutomaticServerInstanceHolder.startUp(AutomaticServerInstanceHolder.java:26) nt.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)at 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 "https://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 = '[email protected]'
        passIn = true

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

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

eclipse {
    classpath {
       downloadSources=true
    }
}

1 个解决方案

#1


0  

Sounds like you have to tell the Java compiler (I am assuming your code is written in Java) to set annotation processing. From what I can see in the error message I would try the following:

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

Disable annotation processing

禁用注释处理

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

Enable annotation processing

启用注释处理

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

分享到: