I’m trying to integrate my application with the camunda engine via rest client using this guy. When I try to start camunda process with the given id and businessKey I get the following error:
Caused by: java.lang.NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'
at org.camunda.community.rest.client.invoker.ApiClient.serialize(ApiClient.java:816)
at org.camunda.community.rest.client.invoker.ApiClient.buildRequest(ApiClient.java:1069)
at org.camunda.community.rest.client.invoker.ApiClient.buildCall(ApiClient.java:1018)
at org.camunda.community.rest.client.api.ProcessDefinitionApi.startProcessInstanceByKeyCall(ProcessDefinitionApi.java:4995)
at org.camunda.community.rest.client.api.ProcessDefinitionApi.startProcessInstanceByKeyValidateBeforeCall(ProcessDefinitionApi.java:5007)
at org.camunda.community.rest.client.api.ProcessDefinitionApi.startProcessInstanceByKeyWithHttpInfo(ProcessDefinitionApi.java:5048)
at org.camunda.community.rest.client.api.ProcessDefinitionApi.startProcessInstanceByKey(ProcessDefinitionApi.java:5028)
An here is the code where I use rest api client:
@Service
@Transactional
@RequiredArgsConstructor
public class CamundaIssueService {
private final ProcessDefinitionApi processDefinitionApi;
public void startProcess() throws ApiException {
processDefinitionApi.startProcessInstanceByKey(
START_ISSUE_KEY,
new StartProcessInstanceDto().businessKey("1")
);
}
}
When i try to do the same with the POSTMAN call to http://localhost:8080/engine-rest/process-definition/myProcessKey/start, then everything works perfectly fine.
Does anyone knows what’s wrong?
Thanks for your quick reply. Missing method is already shown in attached logs, which is okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType).
The problem lies on the wrong version of the com.squareup.okhttp3:okhttp and like @jonathan.lukas
suggested, one have to add proper version to the dependencyManagement in the root pom.xml file