https://bz.apache.org/bugzilla/show_bug.cgi?id=58143

--- Comment #14 from Rainer Jung <rainer.j...@kippdata.de> ---
Finally for the sake of completeness the stacks of the two loading calls for
the class to get woven.

First call (happening before Spring called addTransformer()). Here
name="de/kippdata/demo/weave/Greeting.class",
path="/de/kippdata/demo/weave/Greeting.class", so the class was loaded as a
resource:

        at
org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:3194)
        at
org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:1473)
        at
org.apache.catalina.loader.WebappClassLoaderBase.getResourceAsStream(WebappClassLoaderBase.java:1701)
        at
org.springframework.core.OverridingClassLoader.openStreamForClass(OverridingClassLoader.java:166)
        at
org.springframework.core.OverridingClassLoader.loadBytesForClass(OverridingClassLoader.java:142)
        at
org.springframework.context.support.ContextTypeMatchClassLoader$ContextOverridingClassLoader.loadClassForOverriding(ContextTypeMatchClassLoader.java:111)
        at
org.springframework.core.OverridingClassLoader.loadClass(OverridingClassLoader.java:90)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at
org.springframework.core.OverridingClassLoader.loadClass(OverridingClassLoader.java:84)
        at
org.springframework.context.support.ContextTypeMatchClassLoader.loadClass(ContextTypeMatchClassLoader.java:72)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1429)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1377)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:641)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:609)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1484)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:395)
        at
org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:81)
        at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
        at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
        at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
        at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5109)
        at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5632)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1015)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)
        at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        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:895)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:662)


Second call, now with transformers in place but with class already cached. Here
name="de.kippdata.demo.weave.Greeting",
path="/de/kippdata/demo/weave/Greeting.class", so the class was loaded as an
actual class:

        at
org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:3194)
        at
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3060)
        at
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1388)
        at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1876)
        at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1750)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
        at
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:401)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1432)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1377)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:641)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:609)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1484)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:395)
        at
org.springframework.context.support.DefaultLifecycleProcessor.getLifecycleBeans(DefaultLifecycleProcessor.java:275)
        at
org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:133)
        at
org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:114)
        at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:880)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
        at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
        at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
        at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5109)
        at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5632)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1015)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)
        at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        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:895)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:662)


Before 7.0.70, the two calls did not use the same path for resource and class,
so they did not share the cache entry. After the optimization in r1745608 they
do.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to