Dear Camunda Community,
First, thanks for the great documentation and adviceyou guys provide through this forum. It already got me pretty far - but now I am stucked.
My Environment and what i am trying to achieve:
I am using the prepackaged camunda on Tomcat and an eclipse environment.
I am trying to get the following bpmn up and running:
On process start, two parameters are provided via a form in entry node “Data received”. Then, in check Input, I would like to trigger a Java Delegate - so I specified a Java implementation with Java Class: org.exampleDemo.core.CheckWebsiteDelegate - in the bpmn file.
The delegate wants to do an GET HTTP request to the following API: http://api.icndb.com/jokes/random
I am using the code below:
package org.exampleDemo.core;
import java.util.logging.Logger;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.camunda.connect.Connectors;
import org.camunda.connect.httpclient.HttpConnector;
import org.camunda.connect.httpclient.HttpResponse;
public class CheckWebsiteDelegate implements JavaDelegate {
private final static Logger LOGGER = Logger.getLogger("mylogger");
public void execute(DelegateExecution execution) throws Exception {
LOGGER.info("Processing request.");
LOGGER.info("Website : '" + execution.getVariable("user_existingUrl"));
LOGGER.info("email : '" + execution.getVariable("user_contactEmail"));
HttpConnector http = Connectors.getConnector(HttpConnector.ID);
HttpResponse response = http.createRequest()
.get()
.url("http://api.icndb.com/jokes/random")
.execute();
if(response.getStatusCode() == 200) {
LOGGER.info("Random Chuck Norris joke: " + response.getResponse());
}
else {
LOGGER.info("failure, return code was: " + response.getStatusCode());
}
}
}
The following error occurs:
I start a new process from the task list, then enter my information into two fields, once I click submit I get “Internal server” error:
My debugging so far:
-
Check debug logs of Tomcat server. I could not find any strange behavior here. It seem that the java code excutes until the line
HttpConnector http = Connectors.getConnector(HttpConnector.ID);
(because I see debug output until then).
catalina.2017-08-10_part.log (25.3 KB) -
I cross-checked my POM file against the Camunda getting starting guide and some of the examples at github, that seems ok for me. Can anyone spot a problem here? pom.xml (2.1 KB)
-
Use a vanilla processes.xml file
processes.xml (473 Bytes) -
My bpmn file: spectra.bpmn (4.6 KB)
-
I tried to close all firewalls and antivirus programs on my computer and tried on a completely different machine, and I got the same error.
The only error I get form time to time when I am building the project (I think that is not the problem because when I set compiler compliance level to 1.8, then do a maven update project, and then do a maven install I get a .war file that i can deploy.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project spectra-camunda: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
Do you have any ideas why this is failing or what I could do to get to the root of this issue? Right now I just get the “Internal Server Error” but no better read about where it fails.
Thank you so much,
P