-
Couldn't load subscription status.
- Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Christophe Roudet opened SPR-7686 and commented
When using SpringBeanAutowiringSupport.processInjectionBasedOnServletContext()
a NullPointerException is raised in
InjectionMetadata.checkPropertySkipping(PropertyValues pvs)
protected boolean checkPropertySkipping(PropertyValues pvs) {
if (this.skip == null) {
synchronized (pvs) { // <-- NullPointerException
if (this.skip == null) {
in AutowiredAnnotationBeanPostProcessor.processInjection(Object bean)
metadata inject is called with null for PropertyValues
public void processInjection(Object bean) throws BeansException {
Class<?> clazz = bean.getClass();
InjectionMetadata metadata = findAutowiringMetadata(clazz);
try {
metadata.inject(bean, null, null); // <-- pvs is null
}
catch (Throwable ex) {
throw new BeanCreationException("Injection of autowired dependencies failed for class [" + clazz + "]", ex);
}
}
Here is the stack trace:
java.lang.NullPointerException
at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.checkPropertySkipping(InjectionMetadata.java:171)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:526)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.processInjection(AutowiredAnnotationBeanPostProcessor.java:300)
at org.springframework.web.context.support.SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(SpringBeanAutowiringSupport.java:110)
Affects: 3.0.5
Issue Links:
- NullPointerException could be thrown on synchronized (pvs) in InjectionMetadata.checkPropertySkipping [SPR-7688] #12344 NullPointerException could be thrown on synchronized (pvs) in InjectionMetadata.checkPropertySkipping ("is duplicated by")
- Unresolved thread safety issue in AutowiredAnnotationBeanPostProcessor.AutowiredMethodElement [SPR-7635] #12291 Unresolved thread safety issue in AutowiredAnnotationBeanPostProcessor.AutowiredMethodElement
Referenced from: commits 9c64ac7
1 votes, 4 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug