I start up the WAR and see these errors in the logs:
18-Feb-2020 09:33:47.080 SEVERE [http-nio-8080-exec-79] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.camunda.bpm.engine.rest.impl.FetchAndLockContextListener]
java.util.ServiceConfigurationError: org.camunda.bpm.engine.rest.spi.FetchAndLockHandler: Provider org.camunda.bpm.engine.rest.impl.FetchAndLockHandlerImpl could not be instantiated
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:581)
at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:803)
at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:721)
at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1394)
at org.camunda.bpm.engine.rest.impl.FetchAndLockContextListener.lookupFetchAndLockHandler(FetchAndLockContextListener.java:57)
at org.camunda.bpm.engine.rest.impl.FetchAndLockContextListener.contextInitialized(FetchAndLockContextListener.java:38)
Were you previously running camunda-bpm-tomcat-7.12.0.zip ?
This distribution already contains the rest api under
server\apache-tomcat-9.0.24\webapps\engine-rest
When working with different camunda distributions (wildfly, prepackage tomcat, docker, Spring boot,…) the rest base url can differ. Spring boot per default does not include the web root “camunda” and the rest API is deployed under “rest” only, so the url can be e.g. localhost:8080/rest or localhost:8080/camunda/engine-rest
< Content-Type: text/html;charset=utf-8
< Content-Language: en
< Content-Length: 729
< Date: Tue, 18 Feb 2020 09:23:50 GMT
<
* Connection #0 to host localhost left intact
<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> /engine-rest</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/8.5.50 (Debian)</h3></body></html>
Didn’t you want to use the prepackage distribution? That would be the one under the link above, following the quick start tutorial here: https://docs.camunda.org/get-started/quick-start/
This distribution already includes all you need and will get you started much easier and faster. Or do you have a specific need for Tomcat 8?
If you want to compose an environment yourself I would recommend looking into the Spring Boot option: https://docs.camunda.org/get-started/spring-boot/ but if your are just getting back to Java dealing with Maven and Spring Boot not be the first step.
Danny, you do not seem to have a strict requirement for Tomcat 8.5. To get to the fun BPM part faster, I would recommend to just use the prepackage distribution. If you prefer to fix your Tomcat 8.5 setup then I suggest you check the contents of the prepackage distribution and compare your setup to it.
Which looks correct, to me. It’s the same response I get when I call it in my local (testing) environment.
However when I try hit a resource on the API:
{"type":"NotFoundException","message":"Could not find resource for relative : /deployment of full path: http://localhost:8080/camunda/api/engine/deployment"}
Could this maybe be a datasource issue? Is this an expected response from the REST engine?
I see. Yes, that is the prepackaged distro I am referring to. The rest api should become available via the camunda-engine-rest war you deployed, e.g. here: http://localhost:8080/engine-rest/deployment
not under camunda/api/engine.
You followed this instrucution and also renamed the file?
Copy the war file to $TOMCAT_HOME/webapps . Optionally you may rename it or extract it to a folder to deploy it to a specific context like /engine-rest .
I should’ve clarified - in my last message I was referring to the REST engine that comes bundled with the standalone instance as you indicated.
I’ve now gotten to a point where I’m getting a 401 back for the following call:
curl http://localhost:8080/camunda/api/engine/engine/default/deployment
<!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Description</b> The request has not been applied because it lacks valid authentication credentials for the target resource.</p><hr class="line" /><h3>Apache Tomcat/8.5.50 (Debian)</h3></body></html>
This to me does not look like an error message returned by the engine, though.
Is there some documentation on using the embedded REST API in the Camunda Tomcat distribution?
That endpoint is used exclusively by the webapps - it’s not indeed to be used in any other way, it’s different to the REST API that @rob2universe is suggesting you use
I see that, but I’m actually not sure what the problem could be.
I think @rob2universe already suggeste the likely issues, e.g. that the version of the engine does not match the version of the REST API. Beyond that i’m not really sure what could be wrong.