当前位置: 首页 > 知识库问答 >
问题:

springBootVersion='2.0.0.m6'在开始使用java9后立即失败

欧浩淼
2023-03-14
buildscript {
    ext {
        springBootVersion = '2.0.0.M6'
    }
    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}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'

group = 'test.com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility =9.0

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

configurations {
    providedRuntime
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-web-services')
    runtime('org.springframework.boot:spring-boot-devtools')
    compileOnly('org.projectlombok:lombok')
    providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

控制台如下所示,

2017-11-08 16:31:01.268  INFO 7704 --- [  restartedMain] dk.danskespil.ebu.EbuApplication         : No active profile set, falling back to default profiles: default

2017-11-08 16:31:01.369  INFO 7704 --- [  restartedMain] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@52c4a7bc: startup date [Wed Nov 08 16:31:01 CET 2017]; root of context hierarchy

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/C:/Users/amga/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.0.1.RELEASE/1e0344e553a5ff714f299096216769beffd0d291/spring-core-5.0.1.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)

WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

2017-11-08 16:31:02.876  INFO 7704 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729

2017-11-08 16:31:02.913  INFO 7704 --- [  restartedMain] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup

2017-11-08 16:31:02.932  INFO 7704 --- [  restartedMain] dk.danskespil.ebu.EbuApplication         : Started EbuApplication in 2.556 seconds (JVM running for 4.056)

2017-11-08 16:31:02.936  INFO 7704 --- [       Thread-7] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@52c4a7bc: startup date [Wed Nov 08 16:31:01 CET 2017]; root of context hierarchy

2017-11-08 16:31:02.939  INFO 7704 --- [       Thread-7] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown

共有1个答案

戚明朗
2023-03-14

删除org.springframework.boot:spring-boot-starter-tomcat解决了这个问题。

boot:spring-boot-starter-web包含spring-boot-starter-tomcat,所以不需要单独添加它。

带有Gradle4.3和Java9的Spring boot 2.0.0.M6现在运行良好。

 类似资料:
  • 我有一个活动需要在启动时打开屏幕(如果关闭)。所以在onCreate中,我有: 使用这个与wakelock在扩频接收器的帮助下,我能够使我的活动显示,每当它从广播接收器开始。 但问题很奇怪,活动生命周期以这种方式调用,onPause()和onResume在开始活动后立即执行 创建时 开始时 继续 打开暂停 onStop(停止) 开始时 继续 所以问题出在启动和恢复调用两次时,停止时也调用,我想在

  • 本文向大家介绍怎么在watch监听开始之后立即被调用?相关面试题,主要包含被问及怎么在watch监听开始之后立即被调用?时的应答技巧和注意事项,需要的朋友参考一下 有个参数 https://cn.vuejs.org/v2/api/#vm-watch

  • 所以我想用java编写一个Tic-Tac-Toe游戏。 现在点击一个按钮,我想把按钮的图像设置为“十字”或“圆圈”,但是一旦一个类型跟随代码,按钮就会消失,直到我悬停在它们上面,然后它们就会返回。 没有上面的代码会是什么样子 这里的项目结构

  • 问题内容: 建立与服务器的连接,并显示连接打开的警报!但是之后,连接立即关闭。服务器没有调用close,并且控制台中似乎没有其他错误。chrome和firefox中都在发生这种情况。 我在网上看了一堆不同的类似示例,但都无济于事。 问题答案: 解决它! 我要做的就是在websocket连接关闭之前阻止处理程序返回

  • 问题内容: 我有一个包含10个元素的div,这些元素将被逐个更新,延迟时间为2秒。下面是相同的代码 但是,当我运行它时,所有元素都会一起更新。该程序只是添加一个延迟添加一个开始,并且所有元素都一起更新(被标记)。如何制作代码来逐一标记元素? 问题答案: 您正在打破React的两个基本规则: 不要直接改变状态 如果根据现有状态更新状态,请使用回调形式,因为状态更新可能是异步的(无论如何,在您的示例中

  • 问题内容: 我正在使用Jenkins DSL插件自动为git项目的所有分支创建构建作业。DSL插件由Web挂钩触发,以便在创建新分支后立即运行。每个分支生成的生成作业也被配置为由Web挂钩触发。 当前设置的问题是,仅在第二次提交后才执行构建。第一次提交将触发Jenkins DSL插件来创建相应的Jenkins作业,然后第二次提交将触发新创建的作业。 有什么方法可以通过DSL插件创建Jenkins作