Google应用引擎

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

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

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

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

导致:java.lang.ClassNotFoundException:com.google.appengine.api.LifecycleManager $ java.net.URLClassLoader $ ShutdownHook java.net.URLClassLoader $ 1.run(URLClassLoader.java:366)$ 1.run(URLClassLoader.java: 355)at java.lang.ClassLoader.loadClass(ClassLoader.java:423)at com.google.appengine(java.net.URLClassLoader.findClass(URLClassLoader.java:354))java.security.AccessController.doPrivileged(Native Method) .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方法)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.sta rtContext(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.component.AbstractLifeCycle.start(AbstractLifeCycle.java:org.mortbay.jetty.Server.doStart(Server.java:224)org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) 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)at com.google.appengine.tools.developme 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)at 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 "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
    }
}

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

禁用注释处理

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

启用注释处理

compileJava.options.compilerArgs = ['-implicit']
链接地址: http://www.djcxy.com/p/63577.html

上一篇: google app engine

下一篇: google app engine