java.lang.Exception: Stack trace

Spring JIRA | Kevin O'Riordan | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Environment: Spring MVC 3.1.2 in Tomcat 7.0.23, jdk 1.6. When switching on java security, I realized that spring context is reading java.lang.Object from rt.jar when processing bean definitions, unnecessary and a bit dubious perhaps? It required me to grant read access to rt.jar, no big deal. Without knowing too much about the innards of the internals of spring's bean/annotation processing, I wonder if ClassMetaReadingVisitor.hasSuperClass() should return false when java core classes are encountered? I am curious as to why an input stream is read for each class rather than doing a simple class load? I hope this is helpful, really liking the latest Spring MVC stuff! Stack trace here: access: access denied (java.io.FilePermission /sbcimp/run/tp/sun/jdk/v1.6.0_31-64bit/jre/lib/rt.jar read) java.lang.Exception: Stack trace at java.lang.Thread.dumpStack(Thread.java:1249) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:364) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkRead(SecurityManager.java:871) at sun.misc.URLClassPath.check(URLClassPath.java:416) at sun.misc.URLClassPath$JarLoader.checkResource(URLClassPath.java:676) at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:759) at sun.misc.URLClassPath.getResource(URLClassPath.java:169) at sun.misc.URLClassPath.getResource(URLClassPath.java:221) at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1150) at java.lang.ClassLoader.getResource(ClassLoader.java:999) at java.lang.ClassLoader.getResource(ClassLoader.java:997) at java.lang.ClassLoader.getResource(ClassLoader.java:997) at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1192) at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1504) at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:154) at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:49) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:257) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:149) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:126) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:263) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:622) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866) at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:128) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:151) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:140) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:840) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)

    Spring JIRA | 4 years ago | Kevin O'Riordan
    java.lang.Exception: Stack trace
  2. 0

    Environment: Spring MVC 3.1.2 in Tomcat 7.0.23, jdk 1.6. When switching on java security, I realized that spring context is reading java.lang.Object from rt.jar when processing bean definitions, unnecessary and a bit dubious perhaps? It required me to grant read access to rt.jar, no big deal. Without knowing too much about the innards of the internals of spring's bean/annotation processing, I wonder if ClassMetaReadingVisitor.hasSuperClass() should return false when java core classes are encountered? I am curious as to why an input stream is read for each class rather than doing a simple class load? I hope this is helpful, really liking the latest Spring MVC stuff! Stack trace here: access: access denied (java.io.FilePermission /sbcimp/run/tp/sun/jdk/v1.6.0_31-64bit/jre/lib/rt.jar read) java.lang.Exception: Stack trace at java.lang.Thread.dumpStack(Thread.java:1249) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:364) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkRead(SecurityManager.java:871) at sun.misc.URLClassPath.check(URLClassPath.java:416) at sun.misc.URLClassPath$JarLoader.checkResource(URLClassPath.java:676) at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:759) at sun.misc.URLClassPath.getResource(URLClassPath.java:169) at sun.misc.URLClassPath.getResource(URLClassPath.java:221) at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1150) at java.lang.ClassLoader.getResource(ClassLoader.java:999) at java.lang.ClassLoader.getResource(ClassLoader.java:997) at java.lang.ClassLoader.getResource(ClassLoader.java:997) at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1192) at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1504) at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:154) at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:49) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:257) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:149) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:126) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:263) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:622) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866) at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:128) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:151) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:140) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:840) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)

    Spring JIRA | 4 years ago | Kevin O'Riordan
    java.lang.Exception: Stack trace

    Root Cause Analysis

    1. java.lang.Exception

      Stack trace

      at java.lang.Thread.dumpStack()
    2. Java RT
      ClassLoader.getResourceAsStream
      1. java.lang.Thread.dumpStack(Thread.java:1249)
      2. java.security.AccessControlContext.checkPermission(AccessControlContext.java:364)
      3. java.security.AccessController.checkPermission(AccessController.java:546)
      4. java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
      5. java.lang.SecurityManager.checkRead(SecurityManager.java:871)
      6. sun.misc.URLClassPath.check(URLClassPath.java:416)
      7. sun.misc.URLClassPath$JarLoader.checkResource(URLClassPath.java:676)
      8. sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:759)
      9. sun.misc.URLClassPath.getResource(URLClassPath.java:169)
      10. sun.misc.URLClassPath.getResource(URLClassPath.java:221)
      11. java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1150)
      12. java.lang.ClassLoader.getResource(ClassLoader.java:999)
      13. java.lang.ClassLoader.getResource(ClassLoader.java:997)
      14. java.lang.ClassLoader.getResource(ClassLoader.java:997)
      15. java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1192)
      15 frames
    3. Glassfish Core
      WebappClassLoader.getResourceAsStream
      1. org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1504)
      1 frame
    4. Spring Core
      SimpleMetadataReaderFactory.getMetadataReader
      1. org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:154)
      2. org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:49)
      3. org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
      4. org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
      5. org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
      5 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:257)
      2. org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:149)
      3. org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:126)
      4. org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:263)
      5. org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203)
      6. org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:622)
      7. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
      7 frames
    6. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
      3 frames
    7. Glassfish Core
      ContainerBase$PrivilegedAddChild.run
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
      2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
      3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      4. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
      5. org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:128)
      6. org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:151)
      7. org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:140)
      7 frames
    8. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    9. Glassfish Core
      HostConfig$DeployDirectory.run
      1. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:840)
      2. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      3. org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
      4. org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
      4 frames
    10. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      3. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      5. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      6. java.lang.Thread.run(Thread.java:662)
      6 frames