-
1. Re: Email Service Task - "Cannot find work item handler for Email"
Josny Delson Mar 21, 2014 5:24 AM (in response to Tali Vakarian)Hi Tali,
You should register the workitem Handler for Service Tasks. For email service task
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.getWorkItemManager().registerWorkItemHandler("Notification", new NotificationWorkItemHandler());
HTH
-
2. Re: Email Service Task - "Cannot find work item handler for Email"
Jeewani Lakshani Apr 24, 2014 5:17 AM (in response to Josny Delson)Hi Josny,
from where do we need to register the work item handler. Please update the path please.
Thank you.
-
3. Re: Email Service Task - "Cannot find work item handler for Email"
Maciej Swiderski Apr 24, 2014 12:47 PM (in response to Jeewani Lakshani)check section 5.4.4.2 of configuration in docs. There are few ways you can select to register handlers where the simplest one is to edit CustomWorkItemHandlers.conf finale that is inside kie-wb/WEB-INF/classes/META-INF
HTH
-
4. Re: Email Service Task - "Cannot find work item handler for Email"
Jeewani Lakshani Apr 25, 2014 12:11 AM (in response to Maciej Swiderski)Hi,
Thanks for your quick response. I have edited my CustomWorkItemHandlers.conf as follows. But still get the same error. Please assist me since i am a newbie.
[
"Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(),
"WebService": new org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler(ksession),
"Rest": new org.jbpm.process.workitem.rest.RESTWorkItemHandler()
;
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.getWorkItemManager().registerWorkItemHandler("Notification", new NotificationWorkItemHandler())
]
-
5. Re: Email Service Task - "Cannot find work item handler for Email"
Maciej Swiderski Apr 25, 2014 1:37 AM (in response to Jeewani Lakshani)you should define another mapping for handler and not put code into the conf file e.g.
"Email" : new org.jbpm.process.workitem.email.EmailWorkItemHandler("host", "port", "user", "password")
HTH
-
7. Re: Email Service Task - "Cannot find work item handler for Email"
Maciej Swiderski Apr 25, 2014 2:22 AM (in response to Jeewani Lakshani)check your server log as there might be reason why it cannot send email. Please make sure that you specified correct settings for your mail server in the conf file - replacing host with actual host name or IP address of your mail server, and same for port, user and password.
HTH
-
8. Re: Email Service Task - "Cannot find work item handler for Email"
Jeewani Lakshani Apr 25, 2014 3:56 AM (in response to Maciej Swiderski)Thanks. Your assistance is really helpful for me
This is how i edited conf file;
"Email" : new org.jbpm.process.workitem.email.EmailWorkItemHandler("smtp.gmail.com", "587", "<username>@gmail.com", "<password>")
and my server log says;
java.lang.NullPointerException
at javax.mail.util.ByteArraydataSource etc......
-
9. Re: Email Service Task - "Cannot find work item handler for Email"
Jeewani Lakshani Apr 28, 2014 12:14 AM (in response to Maciej Swiderski)I put jbpm-workitems, javax.mail and javax.activation jars in the lib folder of the AS and the include
"Email" : new org.jbpm.process.workitem.email.EmailWorkItemHandler("smtp.gmail.com", "587", "<username>@gmail.com", "<password>") to CustomWorkItemHandlers.conf file. But when I running the process definition i get the following error message;
[Process Instances failed to start: [emailp.email:4 - Email:2] -- java.lang.RuntimeException: Unable to send email ]
and my server log says;
Caused by: java.lang.RuntimeException: Unable to send email
at org.jbpm.process.workitem.email.SendHtml.fillMessage(SendHtml.java:14
7) [jbpm-workitems-6.0.1.Final.jar:6.0.1.Final]
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:59) [
jbpm-workitems-6.0.1.Final.jar:6.0.1.Final]
... 73 more
Caused by: java.lang.NullPointerException
at javax.mail.util.ByteArrayDataSource.<init>(ByteArrayDataSource.java:1
41) [mail-1.4.4.jar:1.4.4]
at org.jbpm.process.workitem.email.SendHtml.fillMessage(SendHtml.java:13
9) [jbpm-workitems-6.0.1.Final.jar:6.0.1.Final]
Please assist me.
-
10. Re: Email Service Task - "Cannot find work item handler for Email"
Maciej Swiderski Apr 28, 2014 1:30 AM (in response to Jeewani Lakshani)that means you have not specified body of your email that should be set on the email task. Please populate all the fields for Email task and try again.
HTH
-
11. Re: Email Service Task - "Cannot find work item handler for Email"
Jeewani Lakshani Apr 28, 2014 2:15 AM (in response to Maciej Swiderski)Thanks for your prompt response.
Now i get following message i think it os because of im working in a secured network environment.
- java.net.UnknownHostException: smtp.gmail.com
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:178) [rt.jar:1.7.0_11]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) [rt.jar:1.
- 7.0_11]
Does this work if I change my network environment?
Thank you.
-
12. Re: Email Service Task - "Cannot find work item handler for Email"
Maciej Swiderski Apr 28, 2014 3:43 AM (in response to Jeewani Lakshani)yes, that is pure communication error caused by your network settings as the external server cannot be found, make sure you can access that server from the machine where jbpm is running and that should solve the issue.
HTH
-
13. Re: Email Service Task - "Cannot find work item handler for Email"
Jeewani Lakshani Apr 29, 2014 7:08 AM (in response to Maciej Swiderski)i have configured my g,ail settings in unrestricted environment but still i cannot generate email. my steps was as follows;
1. i updated standalone full.xml with followings;
<subsystem xmlns="urn:jboss:domain:mail:1.0">
<mail-session jndi-name="java:jboss/mail/Default">
<smtp-server ssl="true" outbound-socket-binding-ref="mail-smtp">
<login name="@gmail.com" password="*****f"/>
</smtp-server>
</mail-session>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="smtp.gmail.com" port="587"/>
</outbound-socket-binding>
but still i get the server log error
Caused by: org.jbpm.bpmn2.handler.WorkItemHandlerRuntimeException: java.lang.RuntimeException: Unable to send email
at org.jbpm.process.workitem.AbstractLogOrThrowWorkItemHandler.handleException(AbstractLogOrThrowWorkItemHandler.java:40) [jbpm-workitems-6.0.0.Final.jar:6.0.1.Final]
at org.jbpm.process.workitem.AbstractLogOrThrowWorkItemHandler.handleException(AbstractLogOrThrowWorkItemHandler.java:23) [jbpm-workitems-6.0.0.Final.jar:6.0.1.Final]
at org.jbpm.process.workitem.email.EmailWorkItemHandler.executeWorkItem(EmailWorkItemHandler.java:75) [jbpm-workitems-6.0.0.Final.jar:6.0.0.Final]
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:56) [drools-persistence-jpa-6.0.1.Final.jar:6.0.1.Final]
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:124) [jbpm-flow-6.0.1.Final.jar:6.0.1.Final]
... 71 more
Caused by: java.lang.RuntimeException: Unable to send email
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:73) [jbpm-workitems-6.0.0.Final.jar:6.0.0.Final]
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:45) [jbpm-workitems-6.0.0.Final.jar:6.0.0.Final]
at org.jbpm.process.workitem.email.EmailWorkItemHandler.executeWorkItem(EmailWorkItemHandler.java:69) [jbpm-workitems-6.0.0.Final.jar:6.0.0.Final]
... 73 more
Caused by: java.lang.RuntimeException: Connection failure
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:67) [jbpm-workitems-6.0.0.Final.jar:6.0.0.Final]
... 75 more
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. vu3sm6577316igc.6 - gsmtp
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057) [mail-1.4.4.jar:1.4.4]
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1580) [mail-1.4.4.jar:1.4.4]
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1097) [mail-1.4.4.jar:1.4.4]
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:65) [jbpm-workitems-6.0.0.Final.jar:6.0.0.Final]
... 75 more
-
14. Re: Email Service Task - "Cannot find work item handler for Email"
Rafael Soares (Tuelho) Jul 23, 2014 5:38 PM (in response to Tali Vakarian)Hi swiderski.maciej!
Is possible to pass the Work Item Handler constructor's parameters through the Task DataInputs?
For example the Email Handler constructor receives: host, port, user and password parameters. But they are static in the CustomWorkItemHandlers.conf descriptor. Would be nice if the Handlers could be injected in runtime or be able to set the parameters througn Task DataInput values.