Discussion:
[jboss-user] [jBPM] - Custom work handler not found in classpath
npoczynek
2013-02-20 04:44:35 UTC
Permalink
npoczynek [https://community.jboss.org/people/npoczynek] created the discussion

"Custom work handler not found in classpath"

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

--------------------------------------------------------------
Hi, I've been trying to follow https://community.jboss.org/people/bpmn2user/blog/2011/03/30/jbpm5-example--human-task-forms-with-variables--workitems this guide and can't get my custom work item handler running (I made a new email handler that uses the javax library). I've tested it independently and have sent emails with it. Unfortunately when I try to execute a process using the Email service task I get an error saying "Could not find work item handler for Email".

I have updated CustomWorkHandlers.conf as shown on that page. I've deployed my NewEmailHandler.jar inside jbpm-gwt-console-server.war.

The structure of my .jar file is NewEmailHandler/com/sample/NewEmailHandler.class.

I've found a similar issue on https://community.jboss.org/people/bpmn2user/blog/2011/03/28/jbpm5--work-itemdomain-specific-process-hello-process-example this page where they suggest checking the classpath setting. Does anyone have advice on this? I set my package for NewEmailHandler.java as "com.sample" just because I've been following examples that did the same thing. I'm relatively certain I've deployed my .jar to the correct location and set my CustomWorkHandlers.conf correctly, so I'm not sure what to try next.
--------------------------------------------------------------

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

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-02-20 10:47:02 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Custom work handler not found in classpath"

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

--------------------------------------------------------------
could you show here the content of CustomWorkHanlders.conf? Once you define your class there it should discover it automatically from there. Make sure that your handler has default (no arg) constructor.

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

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
npoczynek
2013-02-20 14:23:05 UTC
Permalink
npoczynek [https://community.jboss.org/people/npoczynek] created the discussion

"Re: Custom work handler not found in classpath"

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

--------------------------------------------------------------
Sure, here's the content of CustomWorkHandlers.conf:

[
  "Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(),
  "Email" : new com.sample.NewEmailHandler(),
]

Also in drools.session.conf:

drools.workItemHandlers = CustomWorkItemHandlers.conf

I'm currently using the default constructor - I hard-coded user information temporarily to make sure there are no errors in passing arguments.
I made a project yesterday using the eclipse editor where I was able to use this handler successfully after a call to ksession.getWorkItemManager().registerWorkItemHandler("Email", NewEmailHandler);
--------------------------------------------------------------

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

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