Skip to content

AnnotationUtils#synthesizeAnnotation prevents startup on Google App Engine [SPR-13925] #18497

Closed

Description

@spring-projects-issues

Johann Burkard opened SPR-13925 and commented

After upgrading eproxy https://github.com/johannburkard/eproxy from Spring Boot 1.2.8-RELEASE (Spring Core 4.1.9-RELEASE) to 1.3.2-RELEASE (Spring Core 4.2.4-RELEASE), I got this error when starting an instance on Google App Engine:

java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.reflect.annotation")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:382)
	at java.security.AccessController.checkPermission(AccessController.java:572)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:55)
	at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1525)
	at sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:188)
	at sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:164)
	at java.lang.reflect.Proxy.getInvocationHandler(Proxy.java:822)
	at org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation(AnnotationUtils.java:1364)
	at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:685)
	at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:660)
	at org.springframework.core.annotation.OrderUtils.getOrder(OrderUtils.java:67)
	at org.springframework.core.annotation.OrderUtils.getOrder(OrderUtils.java:56)
	at org.springframework.core.annotation.AnnotationAwareOrderComparator.findOrder(AnnotationAwareOrderComparator.java:84)
	at org.springframework.core.OrderComparator.getOrder(OrderComparator.java:127)
	at org.springframework.core.OrderComparator.getOrder(OrderComparator.java:116)
	at org.springframework.core.OrderComparator.doCompare(OrderComparator.java:87)
	at org.springframework.core.OrderComparator.compare(OrderComparator.java:73)
	at java.util.Arrays.mergeSort(Arrays.java:758)
	at java.util.Arrays.mergeSort(Arrays.java:769)
	at java.util.Arrays.legacyMergeSort(Arrays.java:668)
	at java.util.Arrays.sort(Arrays.java:657)
	at java.util.Collections.sort(Collections.java:217)
	at org.springframework.core.annotation.AnnotationAwareOrderComparator.sort(AnnotationAwareOrderComparator.java:116)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:396)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:385)
	at org.springframework.boot.SpringApplication.initialize(SpringApplication.java:263)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:237)
	at org.springframework.boot.builder.SpringApplicationBuilder.createSpringApplication(SpringApplicationBuilder.java:99)
	at org.springframework.boot.builder.SpringApplicationBuilder.<init>(SpringApplicationBuilder.java:87)
	at org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener.initWebApplicationContext(SpringBootContextLoaderListener.java:48)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)

Since this prevents app startup and also prevents me from upgrading to the latest and greatest Spring Boot, I've set the prio to critical. Unfortunately, I can't really help with a way to identify points where JDK APIs will (sometimes randomly) break on Google App Engine.


Affects: 4.2.3, 4.2.4

Issue Links:

Activity

  1. spring-projects-issues commented on Feb 6, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    This has been fixed for 4.2.5 already; due for release on Feb 18. Feel free to give a recent 4.2.5.BUILD-SNAPSHOT a try in the meantime...

    It's indeed a pain to find out about those JDK limitations on Google App Engine. This is the only recent one we had though, so it doesn't occur too often either.

    Juergen

  2. spring-projects-issues commented on Feb 7, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Johann Burkard commented

    Thanks Jürgen, will do. GAE is weird at times and you can be sure once Google supports JDK 8 there will be more surprises in their sandbox. :(

  3. added
    type: bug
    status: duplicate
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: duplicate

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions