I am trying to configure the opsgenie API for creating the alert from my spring boot 3 application.
Here in the configuration class created the AlertApi bean
@Bean
public AlertApi getAlertAPI() {
ApiClient apiClient = new ApiClient();
log.info("apiClient initialized");
apiClient.setApiKey("API key");
return new AlertApi(apiClient);
}
At the starting of application, its giving below error
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.ifountain.opsgenie.client.swagger.api.AlertApi]: Factory method 'getAlertAPI' threw exception with message: null
Bean is not getting initialised
NOTE - API key is correct one Also tried with below approach
@Bean(name = "getOpsGenieClient")
public IOpsGenieClient getOpsGenieClient() {
OpsGenieClient client = new OpsGenieClient();
client.setApiKey("API key");
return client;
}
Same issue getting for getOpsGenieClient bean too.
Maven dependency added is -
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.opsgenie.client</groupId>
<artifactId>sdk</artifactId>
<version>2.13.1</version>
</dependency>
Hi Divya,
I am Agaci from Opsgenie support. Looking at the exception, I can't find any complete API response in it.
We would like more information about the issue. Could you please create a ticket with us here?
Regards,
Agaci
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.