Error starting ApplicationContext.Description:Parameter 1 of constructor in coms.configuration.BloggerServiceConfiguration required a bean of type 'com.google.api.client.json.JsonFactory' that could not be found.Action:Consider defining a bean of type 'com.google.api.client.json.JsonFactory' in your configuration.
Error starting ApplicationContext.Description:Parameter 1 of constructor in coms.configuration.BloggerServiceConfiguration required a bean of type 'com.google.api.client.json.JsonFactory' that could not be found.Action:Consider defining a bean of type 'com.google.api.client.json.JsonFactory' in your configuration.
The
BloggerServiceConfiguration
BloggerServiceConfiguration
is:
@Configurationpublic class BloggerServiceConfiguration { @Value("${GOOGLE_CLIENT_ID}") private String googleClientId; private final HttpTransport httpTransport; private final JsonFactory jsonFactory; private final OAuth2AuthorizedClientService authorizedClientService; public BloggerServiceConfiguration(HttpTransport httpTransport, JsonFactory jsonFactory, OAuth2AuthorizedClientService authorizedClientService, @Value("${GOOGLE_CLIENT_ID}") String googleClientId) { this.httpTransport = httpTransport; this.jsonFactory = jsonFactory; this.authorizedClientService = authorizedClientService; this.googleClientId = googleClientId; } @Bean public Blogger bloggerService() {//....
@Configurationpublic class BloggerServiceConfiguration { @Value("${GOOGLE_CLIENT_ID}") private String googleClientId; private final HttpTransport httpTransport; private final JsonFactory jsonFactory; private final OAuth2AuthorizedClientService authorizedClientService; public BloggerServiceConfiguration(HttpTransport httpTransport, JsonFactory jsonFactory, OAuth2AuthorizedClientService authorizedClientService, @Value("${GOOGLE_CLIENT_ID}") String googleClientId) { this.httpTransport = httpTransport; this.jsonFactory = jsonFactory; this.authorizedClientService = authorizedClientService; this.googleClientId = googleClientId; } @Bean public Blogger bloggerService() {//....
I try to define the
JsonFactory
JsonFactory
:
@Configurationpublic class GoogleApiConfiguration { @Bean public HttpTransport httpTransport() { return new NetHttpTransport(); } @Bean public JsonFactory jsonFactory() { return JacksonFactory.getDefaultInstance(); }}
@Configurationpublic class GoogleApiConfiguration { @Bean public HttpTransport httpTransport() { return new NetHttpTransport(); } @Bean public JsonFactory jsonFactory() { return JacksonFactory.getDefaultInstance(); }}