Correctness11 - SpotBugsExtensionForSpringFrameWork/CS5098 GitHub Wiki

Bug pattern name: Bean should be defined if it is used in the Spring configuration file.

Description

// BeanZ does not exsit resulting in "cannot load the bean class"
<bean id="beanZ" class="com.baeldung.web.BeanZ" />

Solution

Create the bean defined in the configuration file Use annotation - any stereotype annotation.

// Example
package com.baeldung.web.BeanZ;

@Component
public class BeanZ{
 //...
}

Reference List

https://www.baeldung.com/spring-beancreationexception#cause-5