Deploy jar to Tomcat

I wrote a REST API function to retrieve the activity names from a process definition and then built the jar camunda-engine-rest-core-7.12.0.jar. I then deployed the jar on Tomcat at camunda-bpm-tomcat-7.11.0\server\apache-tomcat-9.0.19\webapps\camunda\WEB-INF\lib of the community edition and then restarted the engine. However the function REST path is not recognized. Are the jars affected by the caching or did I do something wrong with build and deployment?

Thanks

And this is the function I use in ProcessDefinitionRestEngine.java

@GET
@Path("/activities")
@Produces(MediaType.APPLICATION_JSON)
List getProcessActivityNames(@Context UriInfo uriInfo);

Hi @Dimitrios,

I just checked my tomcat directory extracted from the zip and there is no camunda-engine-rest-core.jar.

The classes are packaged as camunda-engine-rest-jaxrs2-7.12.0-alpha4.jar.

To be safe, run mvn clean package on the engine-rest folder as the deployable war files are handled in the assembly subfolder. You can speed up the build with -Dmaven.test.skip=true and miss the 3350 written for the Rest Api.

Hope this helps, Ingo

Yes! It worked perfectly. Thank you very mych!

All best

Dimitrios

Hello @Ingo_Richtsmeier ! I am trying to do something very similar to what @Dimitrios did and Iā€™m running into problems. I think that since oct '19 things may have changed in the structure of the jar files.

Iā€™m trying to experiment a bit with the REST-API, by writing my own endpoints that will interact with the engine. I make my changes in the engine-rest subproject, and then I package the engine-rest folder to create the jar file:
camunda-bpm-platform/engine-rest/engine-rest/target/camunda-engine-rest-core-7.15.0-SNAPSHOT.jar

I then try to replace the jar file in the existing tomcat distribution at the following location:
apache-tomcat-9.0.36\webapps\camunda\WEB-INF\lib ,
but the endpoint is still not accessible/ not recognised.

Am I replacing the wrong file? Is there a different way to build and deploy my own jars?
Thank you!

Hi @Ana_Ro, Welcome to the forum :tada::blush:

Path /engine-rest was repeated, is it valid path?

1 Like

Hello @aravindhrs, and thank you!

Yes indeed, the path has a double engine-rest segment because this is how the source code is structured in the folders! You can see the folder structure in the attached snippet.
Is this the jar that I need to use when replacing it in the Camunda webapp folder? Or is it a different one?

Thank you for your help!

ss|250x215