java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.reflect.annotation")

Spring JIRA | Johann Burkard | 10 months ago
  1. 0

    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: {code} 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) {code} 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.

    Spring JIRA | 10 months ago | Johann Burkard
    java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.reflect.annotation")
  2. 0

    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: {code} 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) {code} 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.

    Spring JIRA | 10 months ago | Johann Burkard
    java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.reflect.annotation")
  3. 0

    AccessControlException after migration to Spring 4.2.4

    Stack Overflow | 12 months ago | Marek Raszewski
    java.lang.IllegalStateException: Cannot load configuration class: xxx.xxx.configuration.AppConfiguration
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Can't open file inside WEB-INF directory inside of Cloud Endpoints (GAE Java)

    Stack Overflow | 8 months ago | MicroR
    java.security.AccessControlException: access denied ("java.io.FilePermission" "/WEB-INF/service-account-credentials.p12" "read")

    25 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.security.AccessControlException

      access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.reflect.annotation")

      at java.security.AccessControlContext.checkPermission()
    2. Java RT
      SecurityManager.checkPermission
      1. java.security.AccessControlContext.checkPermission(AccessControlContext.java:382)
      2. java.security.AccessController.checkPermission(AccessController.java:572)
      3. java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
      3 frames
    3. com.google.apphosting
      CustomSecurityManager.checkPermission
      1. com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:55)
      1 frame
    4. Java RT
      Proxy.getInvocationHandler
      1. java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1525)
      2. sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:188)
      3. sun.reflect.misc.ReflectUtil.checkPackageAccess(ReflectUtil.java:164)
      4. java.lang.reflect.Proxy.getInvocationHandler(Proxy.java:822)
      4 frames
    5. Spring Core
      OrderComparator.compare
      1. org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation(AnnotationUtils.java:1364)
      2. org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:685)
      3. org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:660)
      4. org.springframework.core.annotation.OrderUtils.getOrder(OrderUtils.java:67)
      5. org.springframework.core.annotation.OrderUtils.getOrder(OrderUtils.java:56)
      6. org.springframework.core.annotation.AnnotationAwareOrderComparator.findOrder(AnnotationAwareOrderComparator.java:84)
      7. org.springframework.core.OrderComparator.getOrder(OrderComparator.java:127)
      8. org.springframework.core.OrderComparator.getOrder(OrderComparator.java:116)
      9. org.springframework.core.OrderComparator.doCompare(OrderComparator.java:87)
      10. org.springframework.core.OrderComparator.compare(OrderComparator.java:73)
      10 frames
    6. Java RT
      Collections.sort
      1. java.util.Arrays.mergeSort(Arrays.java:758)
      2. java.util.Arrays.mergeSort(Arrays.java:769)
      3. java.util.Arrays.legacyMergeSort(Arrays.java:668)
      4. java.util.Arrays.sort(Arrays.java:657)
      5. java.util.Collections.sort(Collections.java:217)
      5 frames
    7. Spring Core
      AnnotationAwareOrderComparator.sort
      1. org.springframework.core.annotation.AnnotationAwareOrderComparator.sort(AnnotationAwareOrderComparator.java:116)
      1 frame
    8. Spring Boot
      SpringApplicationBuilder.<init>
      1. org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:396)
      2. org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:385)
      3. org.springframework.boot.SpringApplication.initialize(SpringApplication.java:263)
      4. org.springframework.boot.SpringApplication.<init>(SpringApplication.java:237)
      5. org.springframework.boot.builder.SpringApplicationBuilder.createSpringApplication(SpringApplicationBuilder.java:99)
      6. org.springframework.boot.builder.SpringApplicationBuilder.<init>(SpringApplicationBuilder.java:87)
      6 frames
    9. org.springframework.boot
      SpringBootContextLoaderListener.initWebApplicationContext
      1. org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener.initWebApplicationContext(SpringBootContextLoaderListener.java:48)
      1 frame
    10. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
      1 frame
    11. Jetty Server
      ContextHandler.startContext
      1. org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
      1 frame