Getting an error when trying to start a process via REST

4,949 views
Skip to first unread message

steffen....@gmail.com

unread,
Aug 19, 2013, 4:01:02 AM8/19/13
to camunda-...@googlegroups.com
Hi Forum,

got another problem here with REST. After utilizing the great quickstart for Camunda BPM and REST (https://github.com/camunda/camunda-quickstarts/tree/master/deployment/embedded-spring-rest) I am now fiddling around with the REST API.

For starters I tried to start the deployed process loanApproval.bpmn via the REST API using http://localhost:8080//embedded-spring-rest-7.0.0-SNAPSHOT/engine/MyBPMEngine/process-definition/loanApproval/start and the Firefox RESTClient.

However I receive an error that I can not resolve on my own.

5059790 [http-bio-8080-exec-10] ERROR org.jboss.resteasy.core.ExceptionHandler - failed to execute
javax.ws.rs.NotSupportedException: Cannot consume content type
at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:375)
at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:113)
at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:43)
at org.jboss.resteasy.core.LocatorRegistry.getResourceInvoker(LocatorRegistry.java:79)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:131)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:109)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:135)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:103)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
at org.jboss.resteasy.core.SynchronousDispatcher.invokePropagateNotFound(SynchronousDispatcher.java:217)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:224)
at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Neither providing a message body nor using another process did change anything.

Any help is much appreciated.

Best,
Steffen

Daniel Meyer

unread,
Aug 19, 2013, 4:59:30 AM8/19/13
to steffen....@gmail.com, camunda-...@googlegroups.com
Hi Steffen,

Can you provide the request / response headers of the request you are
executing? Which accept content type header is being set?
The headers can probably be obtained using Firebug. As an alternative you
could provide us with a screenshot of the settings you are using in
Firefox RESTClient.

Cheers,
Daniel Meyer

Steffen Heublein

unread,
Aug 21, 2013, 3:10:14 AM8/21/13
to Daniel Meyer, camunda-...@googlegroups.com

Hi Daniel,

after changing the header content-type to application/json  I receive 400 Bad Request errors now.

as I understood the API, I used the following URI in order to start the process.

http://localhost:8080//embedded-spring-rest-7.0.0-SNAPSHOT/engine/CRM/process-definition/loanApproval/start

As the process does not use any variables I left the body empty (not sure whether this is correct, but trying like in the screenshot did not work out either).

Not sure what is wrong here, the console says now the following:

128473 [http-bio-8080-exec-4] ERROR org.jboss.resteasy.core.ExceptionHandler - Failed executing POST /engine/CRM/process-definition/loanApproval/start
org.jboss.resteasy.spi.ReaderException: java.io.EOFException: No content to map to Object due to end of input
    at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:183)
    at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:88)
    ...

Best,
Steffen


2013/8/19 Daniel Meyer <daniel...@camunda.com>
REST.png

Daniel Meyer

unread,
Aug 21, 2013, 4:31:55 AM8/21/13
to Steffen Heublein, camunda-...@googlegroups.com

Hi Steffen,

 

I think that your request body is incorrect:

 

 

Should be

{}

 

or

 {

    "variables": {

        "creditor": {

            "value": "jonny",

            "type": "String"

        }

    }

}

 

See also:

http://docs.camunda.org/api-references/rest/#!/process-definition/post-start-process-instance

 

I find this to be a useful tool for validating the validity of json objects:

http://jsonlint.com/

 

Cheers,

Daniel

--
You received this message because you are subscribed to the Google Groups "camunda BPM users & process application developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

image001.png

steffen....@gmail.com

unread,
Aug 21, 2013, 8:17:40 AM8/21/13
to camunda-...@googlegroups.com, steffen....@gmail.com
Hi Daniel,

thanks for your help, I think that did it! I was unsure how to express an empty request body, and obviously did it wrong on my own. But your response got that solved

Best,
Steffen

Daniel Meyer

unread,
Aug 21, 2013, 8:19:20 AM8/21/13
to steffen....@gmail.com, camunda-...@googlegroups.com
Great! I am always happy to help.

Cheers,
Daniel

-----Urspr�ngliche Nachricht-----
steffen....@gmail.com
Gesendet: Mittwoch, 21. August 2013 14:18
An: camunda-...@googlegroups.com
Cc: steffen....@gmail.com
Betreff: Re: Getting an error when trying to start a process via REST

Reply all
Reply to author
Forward
0 new messages