You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
following code causes cyclic error in spring-boot.
Please some help to fix this.
code:
@Autowired
public Logbook logbook;
@Bean
public RestTemplate restapi() throws Exception {
CloseableHttpClient httpclient = HttpClientBuilder.create()
.addInterceptorFirst(new LogbookHttpRequestInterceptor(logbook))
.addInterceptorFirst(new LogbookHttpResponseInterceptor())
.build();
RestTemplate resttemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory(httpclient));
return resttemplate;
}
@Bean
public BodyFilter bodyFilter() {
return BodyFilter.merge(new PrettyPrintingJsonBodyFilter(), BodyFilters.defaultValue());
}
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
secureLogbookFilter defined in class path resource [org/zalando/logbook/autoconfigure/LogbookAutoConfiguration$SecurityServletFilterConfiguration.class]
+-----+
| logbook defined in class path resource [org/zalando/logbook/autoconfigure/LogbookAutoConfiguration.class]
? ?
| restAPIConfig (field public org.zalando.logbook.Logbook com.restapi.jconfig.RestAPIConfig.logbook)
+-----+
When commenting @Autowired public Logbook logbook
or @bean public BodyFilter bodyFilter() {},
the problem issue is gone.
The text was updated successfully, but these errors were encountered:
following code causes cyclic error in spring-boot.
Please some help to fix this.
code:
When commenting
@Autowired public Logbook logbook
or
@bean public BodyFilter bodyFilter() {},
the problem issue is gone.
The text was updated successfully, but these errors were encountered: