Discussion:
[jboss-user] [jBPM] - Error starting process instance - getting HTTP 500: Unknown error
Senthil Sathiya
2013-07-31 21:12:53 UTC
Permalink
Senthil Sathiya [https://community.jboss.org/people/skumar0105] created the discussion

"Error starting process instance - getting HTTP 500: Unknown error"

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

--------------------------------------------------------------
Hi ,

I have created a  simple bpmn job using jbpm 5.4 libraries "start --->  task -> and end event". I have attached a custom work item handler to the task ( CustomHandler.java) . I have been able to successfully commit the bpm file into guvnor and compile the package. The Jar file is copied into \jboss-as-7.1.1.Final\standalone\deployments\jbpm-gwt-console-server.war\WEB-INF\lib\ folder.

When I open the  jbpm console ( http://localhost:8080/jbpm-console/ http://localhost:8080/jbpm-console/ ) i can see the process listed , but when I try to click start the process it errors out with the following msg :

server/rs/process/definition/com.sample.bpmn.sampleHTformvariables/new_instance
2013-07-31 16:23:37,610 [ERROR] <ul><li>URL: ' http://localhost:8080/gwt-console-server/rs/process/definition/com.sample.bpmn.sampleHTformvariables/new_instance http://localhost:8080/gwt-console-server/rs/process/definition/com.sample.bpmn.sampleHTformvariables/new_instance'
<li>Action: 'org.jboss.bpm.console.client.process.StartNewInstanceAction'
<li>Exception: 'class com.google.gwt.http.client.RequestException'</ul>

HTTP 500: Unknown error
com.google.gwt.http.client.RequestException:
HTTP 500: Unknown error


When I replace the Task with a User Task , the process starts without any issues.

I would appreciate some assistance on this , have been dealing with this issue for the past few days !

Thanks in advance

Senthil
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-08-02 05:19:32 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Error starting process instance - getting HTTP 500: Unknown error"

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

--------------------------------------------------------------
you need to configure work item handler in console as it cannot register it on the session which is most likely the root cause of the error. Take a look at http://docs.jboss.org/jbpm/v5.4/userguide/ch.console.html#d0e4698 documentation for details on how to configure it.

HTH
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Senthil Sathiya
2013-08-02 19:58:15 UTC
Permalink
Senthil Sathiya [https://community.jboss.org/people/skumar0105] created the discussion

"Re: Error starting process instance - getting HTTP 500: Unknown error"

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

--------------------------------------------------------------
Hi Maciej,

Thanks for your reply. I went through the documentation and followed the steps . First , created a sampleprocess.bpmn with - start --->  task (CustomHandler) -> and end event .

2) Wrote a CustomHandler.java workItem handler class

package com.sample.bpmn.project;

import org.apache.log4j.Logger;
import org.drools.runtime.process.WorkItemHandler;
import org.drools.runtime.process.WorkItem;
import org.drools.runtime.process.WorkItemManager;



public class CustomHandler implements WorkItemHandler {
   static Logger log = Logger.getLogger(
            CustomHandler.class.getName());

    //@Override

    public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {       
        // extract parameters       
      System.out.println("aborting *****");
    }


    //@Override

    public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {

       System.out.println("The custom work handler is successfully invoked");     
       log.info("The custom work handler is successfully invoked");
       manager.completeWorkItem(workItem.getId(), null);


    }


}

and packaged it into a .jar and  copied it into ..\jboss-as-7.1.1.Final\standalone\deployments\jbpm-gwt-console-server.war\WEB-INF\lib\  and ..\jbpm-installer\jboss-as-7.1.1.Final\standalone\lib directories.

3) In guvnor, created a workitem defintion CustomWorkItemHandler ( Not sure if this is required )


import org.drools.process.core.datatype.impl.type.ObjectDataType;
import org.drools.process.core.datatype.impl.type.StringDataType;

[

  [
    "name" : "CustomHandler",
    "parameters" : [
        "MyFirstParam" : new StringDataType(),
        "MySecondParam" : new StringDataType(),
        "MyThirdParam" : new ObjectDataType()
    ],
    "results" : [
        "Result" : new ObjectDataType()
    ],
    "displayName" : "CustomHandler",
    "icon" : "",
  ]

]

Successfully packaged and deployed the sampleprocess and wid into the GWT console server via guvnor.


4) Modified the CustomWorkItemHandlers.conf file and added the following entry

[
  "Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(), 
"CustomHandler": new com.sample.bpmn.project.CustomHandler(),
]

5) Restarted the server . I was able to see the SampleProcess in the webconsole , but when I tried to start it , blew up again with the same error message .

I am really frustrated :( , not sure what I am missing here. . Any help would be highly appreciated .

Thanks

Senthil
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-08-05 11:46:23 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Error starting process instance - getting HTTP 500: Unknown error"

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

--------------------------------------------------------------
Step 2, it's enough to place it in jbpm-gwt-console-server.war\WEB-INF\lib
Step 3 is not really needed for runtime.

where is this file (CustomWorkItemHandlers.conf) located? If you look at 5.4 documentation and the link I placed previously you'll notice that there is something called session.template that can be used to configure handlers as well.
In server.log you should see more details about the error.

HTH
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Senthil Sathiya
2013-08-06 00:42:03 UTC
Permalink
Senthil Sathiya [https://community.jboss.org/people/skumar0105] created the discussion

"Re: Error starting process instance - getting HTTP 500: Unknown error"

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

--------------------------------------------------------------
Thanks for your reply . The CustomWorkItemHandlers.conf file is located within the jboss-as-7.1.1.Final\standalone\deployments\jbpm-gwt-console-server.war\WEB-INF\classes\META-INF\ directory . Let me try modifying the session.template and see if that works . I will get back to you after making the changes .

Thanks again :)
--------------------------------------------------------------

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

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