https://bz.apache.org/bugzilla/show_bug.cgi?id=58143
Bug ID: 58143 Summary: The WebppClassLoader doesn't call transformers on cached classes Product: Tomcat 8 Version: 8.0.24 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: andrei.iva...@gmail.com The Spring Framework load time weaving mechanism registers class file transformers when the web app is deployed: WebappClassLoader(WebappClassLoaderBase).addTransformer(ClassFileTransformer) line: 666 TomcatLoadTimeWeaver.addTransformer(ClassFileTransformer) line: 88 DefaultContextLoadTimeWeaver.addTransformer(ClassFileTransformer) line: 143 AspectJWeavingEnabler.enableAspectJWeaving(LoadTimeWeaver, ClassLoader) line: 83 AspectJWeavingEnabler.postProcessBeanFactory(ConfigurableListableBeanFactory) line: 71 PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(Collection<BeanFactoryPostProcessor>, ConfigurableListableBeanFactory) line: 284 PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory, List<BeanFactoryPostProcessor>) line: 174 XmlWebApplicationContext(AbstractApplicationContext).invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory) line: 658 XmlWebApplicationContext(AbstractApplicationContext).refresh() line: 504 ContextLoaderListener(ContextLoader).configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext, ServletContext) line: 446 ContextLoaderListener(ContextLoader).initWebApplicationContext(ServletContext) line: 328 ContextLoaderListener.contextInitialized(ServletContextEvent) line: 107 StandardContext.listenerStart() line: 4729 StandardContext.startInternal() line: 5167 StandardContext(LifecycleBase).start() line: 150 StandardHost(ContainerBase).addChildInternal(Container) line: 725 StandardHost(ContainerBase).addChild(Container) line: 701 StandardHost.addChild(Container) line: 717 HostConfig.deployWAR(ContextName, File) line: 945 HostConfig$DeployWar.run() line: 1768 Executors$RunnableAdapter<T>.call() line: 511 FutureTask<V>.run() line: 266 ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1142 ThreadPoolExecutor$Worker.run() line: 617 Thread.run() line: 745 After this moment, any classes loaded will be transformed, if necessary. My problem is that Tomcat loads some classes before these transformers are registered: WebappClassLoader(WebappClassLoaderBase).findResourceInternal(String, String, boolean) line: 2639 WebappClassLoader(WebappClassLoaderBase).findResource(String) line: 936 WebappClassLoader(WebappClassLoaderBase).getResourceAsStream(String) line: 1115 ContextConfig.populateJavaClassCache(String) line: 2165 ContextConfig.populateJavaClassCache(String, JavaClass) line: 2155 ContextConfig.checkHandlesTypes(JavaClass) line: 2060 ContextConfig.processAnnotationsStream(InputStream, WebXml, boolean) line: 2012 ContextConfig.processAnnotationsJar(URL, WebXml, boolean) line: 1961 ContextConfig.processAnnotationsUrl(URL, WebXml, boolean) line: 1936 ContextConfig.processAnnotations(Set<WebXml>, boolean) line: 1897 ContextConfig.webConfig() line: 1149 ContextConfig.configureStart() line: 771 ContextConfig.lifecycleEvent(LifecycleEvent) line: 305 LifecycleSupport.fireLifecycleEvent(String, Object) line: 117 StandardContext(LifecycleBase).fireLifecycleEvent(String, Object) line: 90 StandardContext.startInternal() line: 5066 StandardContext(LifecycleBase).start() line: 150 StandardHost(ContainerBase).addChildInternal(Container) line: 725 StandardHost(ContainerBase).addChild(Container) line: 701 StandardHost.addChild(Container) line: 717 HostConfig.deployWAR(ContextName, File) line: 945 HostConfig$DeployWar.run() line: 1768 Executors$RunnableAdapter<T>.call() line: 511 FutureTask<V>.run() line: 266 ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1142 ThreadPoolExecutor$Worker.run() line: 617 Thread.run() line: 745 This makes subsequent calls to WebappClassLoaderBase.findResourceInternal to return cached resources: ResourceEntry entry = resourceEntries.get(path); if (entry != null) { return entry; } These cached resources will not go through the transformers, which are called bellow. Maybe the resourceEntries cache could be flushed somehow? -- 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