[jboss-user] [jBPM] - Re: Process Parameters through REST API?

Thomas Setiabudi do-not-reply at jboss.com
Thu Aug 9 06:25:43 EDT 2012


Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: Process Parameters through REST API?"

To view the discussion, visit: https://community.jboss.org/message/752796#752796

--------------------------------------------------------------
Hi Franck,

I tried the  http://localhost:8080/gwt-console-server/rs/form/process/process_id/complete http://localhost:8080/gwt-console-server/rs/form/process/process_id/complete 

here is my code 


public String instantiateDemoEvaluation(String address, String username,
   String reason, String processName) {
  String responseString = "";
  List<NameValuePair> formparams = new ArrayList<NameValuePair>();
  formparams.add(new BasicNameValuePair("employee", "thomas"));
  formparams.add(new BasicNameValuePair("reason", "test"));
  HttpPost httpPost = new HttpPost(" http:// http://" + "localhost:8888"
    + "/gwt-console-server/rs/form/process/" + "com.sample.evaluation"
    + "/complete");
  InputStreamReader inputStreamReader = null;
  BufferedReader bufferedReader = null;
  try {
   UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams,
     "UTF-8");// UrlEncodedFormEntity(formparams,
        // "multipart/form-data"); 
   
   httpPost.setEntity(entity);
   HttpResponse response = httpClient.execute(httpPost);
   InputStream inputStream = response.getEntity().getContent();
   inputStreamReader = new InputStreamReader(inputStream);
   bufferedReader = new BufferedReader(inputStreamReader);
   StringBuilder stringBuilder = new StringBuilder();
   String line = bufferedReader.readLine();
   while (line != null) {
    stringBuilder.append(line);
    line = bufferedReader.readLine();
   }
   responseString = stringBuilder.toString();
  } catch (Exception e) {
   throw new RuntimeException(e);
  } finally {
   if (inputStreamReader != null) {
    try {
     inputStreamReader.close();
    } catch (Exception e) {
     throw new RuntimeException(e);
    }
   }
   if (bufferedReader != null) {
    try {
     bufferedReader.close();
    } catch (Exception e) {
     throw new RuntimeException(e);
    }
   }
  }
  return responseString;
 }


and I got this error

<html><head><title>JBoss Web/7.0.1.Final - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Timeout : unable to retrieve Task org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345) org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321) org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) javax.servlet.http.HttpServlet.service(HttpServlet.java:847) org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)</pre></p><p><b>root cause</b> <pre>java.lang.RuntimeException: Timeout : unable to retrieve Task org.jbpm.task.service.responsehandlers.BlockingGetTaskResponseHandler.getTask(BlockingGetTaskResponseHandler.java:41) org.jbpm.task.service.SyncTaskServiceWrapper.getTask(SyncTaskServiceWrapper.java:369) org.jbpm.integration.console.forms.TaskFormDispatcher.provideForm(TaskFormDispatcher.java:64) org.jbpm.integration.console.forms.FormDispatcherComposite.provideForm(FormDispatcherComposite.java:50) org.jboss.bpm.console.server.FormProcessingFacade.provideForm(FormProcessingFacade.java:205) org.jboss.bpm.console.server.FormProcessingFacade.renderTaskUI(FormProcessingFacade.java:127) sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255) org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220) org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209) org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) javax.servlet.http.HttpServlet.service(HttpServlet.java:847) org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the JBoss Web/7.0.1.Final logs.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.0.1.Final</h3></body></html>
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/752796#752796]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120809/3fd47dd0/attachment.html 


More information about the jboss-user mailing list