Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.ifountai

Divya Sharma
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 15, 2024

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>

 

1 answer

0 votes
Agaci Avinas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2024

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events