A problem in the Service Task REST HTTP

Hi ,
I am new using camunda, I want to implement Rest Service call with HTTP connector that returns after 5 Sec a message. When I execute JUnit test, I get the message after 5 sec. But the problem is when I deploy .war file to tomcat server and start my process “SEQ.bpmn” after 5 seconds I get the following error “The process could not be started. :Internal Server Error”. I do not know if there is any special configuration I have to do in the tomcat or something else.

I follow this example with few changes: camunda-bpm-examples/servicetask/rest-service at master · camunda/camunda-bpm-examples · GitHub.

pom.xml (3.1 KB)

Best Regards,

Alio

Hi AlioPro,

Are you using the prepackaged Camunda Tomcat distribution? If so, please attach the following files:

  • %TOMCAT_HOME%/logs/catalina.out
  • %TOMCAT_HOME%/logs/localhost.log
  • your ProcessApplication class (extending ServletProcessApplication, annotated with @ProcessApplication)
  • processes.xml under /META-INF

The latter two files are mandatory and must have been created by yourself, because the example does not provides them.

Edit: Check this tutorial on how to create a ProcessApplication which can be deployed on Tomcat.

Cheers,
Christian

Hi @hawky4s,

Thanks for your reply, Yes I use the prepackaged Camunda Tomcat distribution. I followed that tutorial before.

The required files with XML format just for upload it to the forum

https://bitbucket.org/Ali_Al-Hashimi/http-rest-service/src/8b8c1fc7c7f2?at=master
catalina.2016-07-14.log.xml (214.1 KB)
localhost.2016-07-14.log.xml (228.0 KB)
HttpConnectorApp.java.xml (298 Bytes)
processes.xml (454 Bytes)

Plus I uploaded process package in Bitbucket on the following link

https://bitbucket.org/Ali_Al-Hashimi/http-rest-service/src/8b8c1fc7c7f2?at=master

Hi @AlioPro,

It seems there is an exception thrown when the Camunda engine tries to execute the groovy script.
It probably happens, because you are declaring the dependency groovy-all 2.0.3 in your project. That is not necessary because the prepackaged distribution engine already ships with groovy in version 2.4.5, which is tested with the engine.
Just remove the groovy dependency or update it to version 2.4.5 and set the scope to provided/test, that should solve your problem.

Cheers,
Christian

1 Like

Hi @hawky4s ,

I tried both remove the groovy dependencies and update groovy version but it did not work.As you expected when I deployed the .bpmn without the groovy script it’s work fine. The main point for using the groovy script is to print the message return from the rest service.

Best Regards,

Hi @AlioPro,

I cloned your project and then changed the groovy dependency to

<dependency>
  <groupId>org.codehaus.groovy</groupId>
  <artifactId>groovy-all</artifactId>
  <version>2.4.6</version>
  <scope>test</scope>
</dependency>

I was able to successfully deploy and run your process, see the attached log.

tomcat-log.txt (6.2 KB)

Cheers,
Christian

Hi @hawky4s ,

I tried it also but does not work. I used camunda-bpm-tomcat-7.5.0 with apache-tomcat-8.0.24
from : Camunda Download Center -
and followed instruction from : Install the Full Distribution on a Tomcat Application Server manually | docs.camunda.org

Can you please tell me, which Pre-Packaged Distribution you use?

localhost.2016-07-15.log.xml (31.5 KB)

catalina.2016-07-15.log.xml (87.0 KB)

Best Regards,

Seems you’re another tomcat instance on same ports because of “java.net.BindException: Address already in use: bind”.

Hi @langfr ,
yes, that’s right there were two instances of tomcat used at 17:06. But know just one instance and the same result.

catalina.2016-07-15.log.xml (165.7 KB)
localhost.2016-07-15.log.xml (63.8 KB)

Best Regards,

Hi @AlioPro,

Sorry but I can’t help you any further. It worked for me using following steps:

  1. Downloaded a clean prepackaged Camunda Tomcat 7.5 distro
  2. Cloned your project
  3. Modified your project’s pom by changing the existing groovy dependency to
org.codehaus.groovy groovy-all 2.4.6 test ``` 4. Compiled your project ```mvn clean package``` 5. Copied the resulting WAR from project's _target_ folder to Camunda Tomcat's _webapps_ folder 6. Start Tomcat 7. Process Application deployed successfully 8. Went to [Camunda Webapp](http://localhost:8080/camunda/) 9. Started a process instance of your SEQ processes through _Start Process_ in tasklist 10. Works and watched the process in Cockpit. 11. Checked the output in the Tomcat log - something like 6 lines displayed _timer startedfinally_

Cheers,
Christian

Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.5 and you are trying to load version 2.0.1

I do not have experience with Tomcat or Groovy, but this error message seems quite clear to me.
Camunda Tomcat comes with Groovy 2.4.5. You’re trying to use version 2.0.1.
So it seems to me the groovy reference in your code is still 2.0.1 and not 2.4.5 or 2.4.6 like Christian advised you to change to. So check your code.

Hi @langfr ,

Thanks a lot , Finally it is working now. The problem seems to be was with target contents since WEB-INF was using an old version of groovy. After deleting the content of target folder in eclipse and the old version of groovy in .m2\repository\org\codehaus , it’s work perfectly. Thanks again

Best Regards,