JBPM3 邮件发送 终极解决办法
作为一个工作流,能进行提醒,是一个基本功能。但是作为一个开源产品,JBPM3似乎做得不好,很有鸡肋的感觉,吃起来不好吃,扔了又可惜。现在把结局方案发过来。不过这里要感谢的javaeye另一位大牛的文章。后面有备注。
1.
这是processdefinition.xml
然后是:jbpm.cfg.xml
要新建一个properties把properties和重新写的Mail类,注入进去。
然后编写获取收取邮件的类
以上完成后测试类
at org.jbpm.mail.Mail.send(Mail.java:208)
at org.jbpm.mail.Mail.send(Mail.java:160)
at org.jbpm.mail.Mail.execute(Mail.java:81)
at org.jbpm.graph.def.Action.execute(Action.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)14:58:48,411 [main] DEBUG Services : closing service 'tx': org.jbpm.tx.TxService@a68fd8
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$ffdb9456.execute(<generated>)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:259)
at org.jbpm.graph.node.MailNode.execute(MailNode.java:29)
at org.jbpm.graph.def.Node.enter(Node.java:318)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$84015922.enter(<generated>)
at org.jbpm.graph.def.Transition.take(Transition.java:151)
at org.jbpm.graph.def.Node.leave(Node.java:393)
at org.jbpm.graph.node.StartState.leave(StartState.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$84015922.leave(<generated>)
at org.jbpm.graph.exe.Token.signal(Token.java:192)
at org.jbpm.graph.exe.Token.signal(Token.java:140)
at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:270)
at com.sample.jbpmtest.TestMailNode.main(TestMailNode.java:18)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.AuthenticationFailedException
at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at org.jbpm.mail.Mail.send(Mail.java:206)
... 31 more
-------------------------------- 2 楼 zhoushubing_1206 2010-09-19 请问 运行测试中 根本就不进入此类 com.whqhoo.utils.Mail
是怎么一回事