'Ignore specific beans while indexing, using spring-context-indexer

I want to implement spring-context-indexer in my app. I successfully generated spring.components file, but my app won't deploy. Errors I get in logs are:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘accountAdminAjaxService’ defined in class path resource [application-dwr.xml]: Cannot create inner bean ‘echosign.web.spring.account.AccountAdminAjaxServiceImpl#61353421’ of type [echosign.web.spring.account.AccountAdminAjaxServiceImpl] while setting bean property ‘target’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘echosign.web.spring.account.AccountAdminAjaxServiceImpl#61353421’ defined in class path resource [application-dwr.xml]: Cannot resolve reference to bean ‘userSettings’ while setting bean property ‘containerMap’ with key [TypedStringValue: value [USER_SETTINGS], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userSettings’ defined in class path resource [application-dwr.xml]: Cannot resolve reference to bean ‘accountAdminAjaxService’ while setting bean property ‘accountAdminAjaxService’; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name ‘accountAdminAjaxService’: org.springframework.beans.factory.FactoryBeanNotInitializedException: Cannot determine target class for proxy ERROR [2022-02-17T08:49:40,676] [EN510650:RMI TCP Connection(2)-127.0.0.1:] [unavailable] (ContextLoader.initWebApplicationContext:313) Context initialization failed [org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘entityHomeShardCacheInvalidator’: Unsatisfied dependency expressed through field ‘cacheInvalidationService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.adobe.sign.crossshardmigration.entities.service.impl.CacheInvalidationService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

So, I'm guessing some beans can't be loaded using indexer, and instead of indexer, they need to be loaded the old way, scanning through classpath.

My question is: Is there any way to say to indexer to ignore those specific beans, or to set them to be loaded through classpath, while the rest of the beans can be loaded with indexer?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source