Skip to content

Instantly share code, notes, and snippets.

@sascha-kaufmann
Created March 8, 2021 13:37
Show Gist options
  • Save sascha-kaufmann/c342dd56104a75d5ca110b80941a76bb to your computer and use it in GitHub Desktop.
Save sascha-kaufmann/c342dd56104a75d5ca110b80941a76bb to your computer and use it in GitHub Desktop.
spring-boot startup failure with JDK11 and SecurityManager enabled
plugins {
id 'org.springframework.boot' version '2.2.9.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
}
grant {
permission java.security.AllPermission;
};
rootProject.name = 'abc-application'
package abc.def;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
@SpringBootApplication
public class AbcApplication {
public static void main(String[] args) {
new SpringApplicationBuilder(AbcApplication.class).build().run(args);
}
}
package abc.def;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(
value = "/abc",
produces = MediaType.TEXT_PLAIN_VALUE)
public class AbcResource {
@GetMapping("/hello")
public String isUpdating() {
return "hello";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment