Skip to content

Commit 05683fe

Browse files
committed
Skip LoadTimeWeaverAwareProcessor with native images
1 parent 718d46a commit 05683fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory b
726726

727727
// Detect a LoadTimeWeaver and prepare for weaving, if found in the meantime
728728
// (e.g. through an @Bean method registered by ConfigurationClassPostProcessor)
729-
if (beanFactory.getTempClassLoader() == null && beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {
729+
if (!IN_NATIVE_IMAGE && beanFactory.getTempClassLoader() == null && beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {
730730
beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));
731731
beanFactory.setTempClassLoader(new ContextTypeMatchClassLoader(beanFactory.getBeanClassLoader()));
732732
}

0 commit comments

Comments
 (0)