citrusframework / citrusframework/citrus
How to remove warnings "Bean 'citrusSpringConfig' and Bean 'citrusReferenceResolver' not eligible for getting processed by all BeanPostProcessors"
- Dominant language
- Java
- Stars
- 485
- Forks
- 155
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 6
Description
**Citrus Version**
4.2.1
**Question**
I get the following warnings when running my citrus test:
```bash
WARN PostProcessorChecker| Bean 'citrusSpringConfig' of type [org.citrusframework.config.CitrusSpringConfig$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [citrusComponentInitializer] is declared through a non-static factory method on that class; consider declaring it as static instead.
WARN PostProcessorChecker| Bean 'citrusReferenceResolver' of type [org.citrusframework.context.SpringBeanReferenceResolver] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [citrusComponentInitializer]? Check the corresponding BeanPostProcessor declaration and its dependencies.
```
How to get rid of the warnings?
**Additional information**
EndpointConfig.java looks like:
```java
package com.pablopaul.integrationtests;
import org.citrusframework.kafka.endpoint.KafkaEndpoint;
import org.citrusframework.kafka.endpoint.KafkaEndpointBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import java.util.HashMap;
@Configuration
public class EndpointConfig {
@Autowired
Environment env;
@Bean
public KafkaEndpoint kafkaEndpoint() {
String keyvaultUri = env.getProperty("keyvault.uri");
AzureKeyVault keyVaultClient = new AzureKeyVault(keyvaultUri);
String apiKey = keyVaultClient.getSecret("api-key");
String apiSecret = keyVaultClient.getSecret("api-secret");
HashMap endpointProps = new HashMap<>();
endpointProps.put("security.protocol", "SASL_SSL");
endpointProps.put("ssl.endpoint.identification.algorithm", "https");
endpointProps.put("sasl.mechanism", "PLAIN");
endpointProps.put("sasl.jaas.config",
"org.apache.kafka.common.security.plain.PlainLoginModule required username='" + apiKey + "' password='" + apiSecret + "';");
return new KafkaEndpointBuilder()
.server(env.getProperty("kafka.broker.uri"))
.producerProperties(endpointProps)
.consumerProperties(endpointProps)
.topic(env.getProperty("kafka.topic"))
.build();
}
}
```
Contributor guide
Research direction
Start by tracing CitrusSpringConfig, citrusComponentInitializer, and SpringBeanReferenceResolver to understand why the warnings are emitted during bean creation. Use the provided EndpointConfig.java and the warning text as the reproduction context; done means the Citrus test starts without these BeanPostProcessor warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kafka, spring
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100