本文介绍了在Google App Engine上运行的Spring Boot Web应用程序-引发码头异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行gradlew appengineRun时,我始终得到:

Starting a Gradle Daemon (subsequent builds will be faster)
Mar 26, 2018 5:47:48 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
2018-03-26 17:47:51.665:INFO::main: Logging initialized @3872ms
2018-03-26 17:47:53.727:INFO:oejs.Server:main: jetty-9.3.18.v20170406
2018-03-26 17:48:01.040:WARN:oeja.ClassInheritanceHandler:qtp99347477-18:
java.lang.NullPointerException
    at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
    at org.eclipse.jetty.annotations.ClassInheritanceHandler.addToInheritanceMap(ClassInheritanceHandler.java:72)
    at org.eclipse.jetty.annotations.ClassInheritanceHandler.handle(ClassInheritanceHandler.java:58)
    at org.eclipse.jetty.annotations.AnnotationParser$MyClassVisitor.visit(AnnotationParser.java:476)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:650)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:525)
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:978)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:958)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:902)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:851)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:546)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
2018-03-26 17:48:01.087:WARN:oeja.ClassInheritanceHandler:qtp99347477-19:
java.lang.NullPointerException
    at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
    at org.eclipse.jetty.annotations.ClassInheritanceHandler.addToInheritanceMap(ClassInheritanceHandler.java:72)
    at org.eclipse.jetty.annotations.ClassInheritanceHandler.handle(ClassInheritanceHandler.java:58)
    at org.eclipse.jetty.annotations.AnnotationParser$MyClassVisitor.visit(AnnotationParser.java:476)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:650)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:525)
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:978)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:958)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:902)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:851)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:546)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
2018-03-26 17:48:01.103:WARN:oeja.ClassInheritanceHandler:qtp99347477-12:
java.lang.NullPointerException

我有Windows 7主机.相同的程序在gradlew bootRun下运行良好.我没有使用web.xml.但是我的build.gradle符合 https://cloud.google .com/appengine/docs/standard/java/tools/gradle .我没有通过Eclipse运行(此处报告了类似的问题: mvn appengine:run-错误403(带有jsp的spring boot web)).springBootVersion ='2.0.0.BUILD-SNAPSHOT'

I have a Windows 7 host. The same program runs fine with gradlew bootRun.I am not using a web.xml. But my build.gradle is along the lines of https://cloud.google.com/appengine/docs/standard/java/tools/gradle.I am not running through eclipse (similar problem is reported here: mvn appengine:run - error 403 (spring boot web with jsp)).springBootVersion = '2.0.0.BUILD-SNAPSHOT'

build.gradle:

build.gradle:

buildscript {
    ext {
        springBootVersion = '2.0.0.BUILD-SNAPSHOT'
    }
    repositories {
        mavenCentral()
        maven { url "https://repo.spring.io/snapshot" }
        maven { url "https://repo.spring.io/milestone" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath 'com.google.cloud.tools:appengine-gradle-plugin:+'    // latest App Engine Gradle tasks
    }
}

apply plugin: 'java'                              // standard Java tasks
apply plugin: 'war'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.google.cloud.tools.appengine'  // App Engine tasks

ext['thymeleaf.version'] = '3.0.9.RELEASE'

compileJava {
    options.warnings = true
    options.debug = true
    options.compilerArgs += ["-Xlint:deprecation"]
}

sourceSets {
    main {
        java {
            exclude '**/RedirectHttpToHttpsOnTomcatConfig.java'
            exclude '**/RedirectHttpToHttpsOnJettyConfig.java'
            exclude '**/RedirectHttpToHttpsOnJetty2Config.java'
            exclude '**/RedirectHttpToHttpsOnJetty3Config.java'
            exclude '**/RedirectHttpToHttpsOnJetty4Config.java'
       }
   }
}

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}

dependencies {
    compile 'com.google.appengine:appengine-api-1.0-sdk:+'  // Latest App Engine Api's
    providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
    compile 'jstl:jstl:1.2'

    compile('org.springframework.boot:spring-boot-starter-thymeleaf')
    compile("org.springframework.boot:spring-boot-starter-web") {
        exclude module: "spring-boot-starter-tomcat"
    }
    compile("org.springframework.boot:spring-boot-starter-jetty")
    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity4')
    compile("org.springframework.boot:spring-boot-starter-jdbc") {
        exclude module: "org.apache.tomcat:tomcat-juli"
    }
    compile("org.springframework.boot:spring-boot-starter-data-jpa") {
        exclude module: "org.apache.tomcat:tomcat-juli"
    }
    compile("com.h2database:h2")
    providedRuntime 'org.slf4j:jul-to-slf4j'
}

configurations {
    compile.exclude module: 'spring-boot-starter-tomcat'
    runtime.exclude module: 'spring-boot-starter-tomcat'
}

appengine {  // App Engine tasks configuration
  deploy {   // deploy configuration

  }
}

sourceCompatibility = 1.8     // App Engine Flexible uses Java 8
targetCompatibility = 1.8     // App Engine Flexible uses Java 8

推荐答案

https://issuetracker.google.com/issues/65200034 .请为该问题加注星标以获取更新.

The issue is being tracked upstream by https://issuetracker.google.com/issues/65200034. Please star that issue to receive updates.

我们认为您的问题是 https://github.com/eclipse/jetty. project/issues/1892 . https://issuetracker.google.com/issues/65200034 最初是关于 https://github.com/eclipse/jetty.project/issues/1692 ,但是已经扩展到涵盖您的问题.

We believe your issue is https://github.com/eclipse/jetty.project/issues/1892. https://issuetracker.google.com/issues/65200034 was originally about https://github.com/eclipse/jetty.project/issues/1692, but it has expanded to cover your issue too.

这篇关于在Google App Engine上运行的Spring Boot Web应用程序-引发码头异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 02:03