camunda-community-hub / camunda-platform-7-rest-client-java

Community extension to generate a Java client from the provided Camunda 7 OpenAPI descitpion and also warp it into Spring Boot
Apache License 2.0
60 stars 10 forks source link

Could not autowire. No beans of 'IncidentApi' type found. #116

Closed JimmyYouhei closed 4 months ago

JimmyYouhei commented 8 months ago

When using Spring rest client api when inject IncidentApi there is error :

Untitled

and Spring boot is unable to boot

I am currently using 7.20.4 version and Spring boot 3.1.7

alex-fgsfds commented 5 months ago

The same problem on Spring Boot 3.2.4. Does it work on Spring Boot 3 then? Indeed, I do not see the required annotations on the ProcessDefinitionApi class, for example. It seems that defining a @Configuration with corresponding bean factory methods solves this particular issue. image

jonathanlukas commented 5 months ago

Does this work with 7.20.5?

If not, I will have to dig deeper as the artefacts should contain the spring boot 3 style autoconfiguration.imports

hauch commented 4 months ago

It's simply missing in CamundaApi. One workaround is to add it manually in a class annotated with Configuration: @Autowired private ApiClient apiClient; ... @Bean public IncidentApi incidentApi() { return new IncidentApi(apiClient); }