0 Replies Latest reply on Nov 4, 2013 10:30 AM by ocramot

    Parameters and Header for POST call to perform task operation in REST services

    ocramot Newbie

      Hello,

      I'm trying to retrieve the TaskForm content and perform task operations (start, complete, ... ) using the REST service provided with the kie-services-remote module.

      To do so, I'm sending a POST request to the addresses:

      http://127.0.0.1:8080/jbpm-console/rest/task/123456/content

      http://127.0.0.1:8080/jbpm-console/rest/task/123456/start

      http://127.0.0.1:8080/jbpm-console/rest/task/123456/complete

       

      I'm having no problems with other GET requests such as query, but everytime I try a POST request, I'm getting either "Ignoring unsupported locale":

       

      15:20:29,042 WARNING [org.jboss.resteasy.core.request.AcceptHeaders] (http--0.0.0.0-8080-8) Ignoring unsupported locale: null

       

      or ".LoggableFailure":

       

      15:20:25,422 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jbpm-console].[javax.ws.rs.core.Application]] (http--0.0.0.0-8080-8) Servlet.service() for servlet javax.ws.rs.core.Application threw exception: org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data of type: javax.ws.rs.core.HttpHeaders

              at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:53) [resteasy-jaxrs-2.3.2.Final.jar:]

              at com.sun.proxy.$Proxy210.getRequestHeaders(Unknown Source)

              at org.kie.services.remote.rest.ResourceBase.getVariant(ResourceBase.java:115) [kie-services-remote-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]

              at org.kie.services.remote.rest.exception.DescriptiveExceptionHandler.toResponse(DescriptiveExceptionHandler.java:66) [kie-services-remote-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]

              at org.kie.services.remote.rest.exception.DescriptiveExceptionHandler.toResponse(DescriptiveExceptionHandler.java:25) [kie-services-remote-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]

              at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]

              at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:44) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

              at org.kie.services.remote.rest.exception.DescriptiveExceptionHandler$Proxy$_$$_WeldClientProxy.toResponse(DescriptiveExceptionHandler$Proxy$_$$_WeldClientProxy.java) [kie-services-remote-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]

              at org.jboss.resteasy.core.SynchronousDispatcher.executeExceptionMapper(SynchronousDispatcher.java:324) [resteasy-jaxrs-2.3.2.Final.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:229) [resteasy-jaxrs-2.3.2.Final.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:123) [resteasy-jaxrs-2.3.2.Final.jar:]

              at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]

              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]

              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.2.1.Final.jar:3.2.1.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.2.1.Final.jar:3.2.1.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70) [jbpm-designer-backend-6.0.0.CR5.jar:6.0.0.CR5]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:266) [uberfire-security-server-0.3.0.CR5.jar:0.3.0.CR5]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397) [jbossweb-7.0.13.Final.jar:]

              at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:416) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]

       

      Depending on the parameters and the header I'm sending. Which one is the correct content of the header? for the GET requests such as query, I'm using no params, and header is:

       

      headers : { "Authorization" : authString,"Accept" : "application/xml" }

       

      and it is working fine. What do I have to use for POST request?