[JBoss jBPM] - Could not send mail with mail node
by 1womps1
Hi,I'm trying to send mail using the mail nodes ,my jbpm.cfg.xml file is the following
| <jbpm-configuration>
| <string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
| <string name="jbpm.mail.smtp.host" value="172.20.1.183" />
| <string name='jbpm.mail.from.address' value='jboss(a)eds.com' />
| <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
| <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
| </jbpm-configuration>
|
when i deploy the process i have the following message:
| Error completing task: An exception of type "org.jbpm.JbpmException" was thrown. The message is: couldn't send email
|
and in the console i have these errors
| Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localh
| ost, port: 25;
| nested exception is:
| java.net.ConnectException: Connection refused: connect
| at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
| at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:37
| 0)
| at javax.mail.Service.connect(Service.java:275)
| at javax.mail.Service.connect(Service.java:156)
| at javax.mail.Service.connect(Service.java:105)
| at javax.mail.Transport.send0(Transport.java:168)
| at javax.mail.Transport.send(Transport.java:98)
| at org.jbpm.mail.Mail.send(Mail.java:206)
| ... 68 more
| Caused by: java.net.ConnectException: Connection refused: connect
| at java.net.PlainSocketImpl.socketConnect(Native Method)
| at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
| at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
| at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
| at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
| at java.net.Socket.connect(Socket.java:519)
| at java.net.Socket.connect(Socket.java:469)
| at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
| at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
| at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
|
thanks for your help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164753#4164753
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164753
17 years, 8 months
[JBoss jBPM] - closed JbpmContext in different order then they were created
by dovetail
I have the following code snippet which loads a process instance, loops for unfinished tasks and ends them
In JBPM 3.1.4 this code works fine, but in 3.2.2 it fails with the following error
Caused by: org.jbpm.JbpmException: closed JbpmContext in different order then they were created... check your try-finally's around JbpmContexts blocks
The error is on the jbpmContext.close() in the finally block
The log.debug points show that the correct context is created initially, but a new context is created within the taskInstance.end() code and this has
been added to the stack causing the error to occur.
Can you please shed some light on how this should be handled?
Thanks
public void endTask( Long processId ) {
| JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
| log.debug( "Current context 1" + JbpmConfiguration.getInstance().getCurrentJbpmContext().toString() );
| try {
| ProcessInstance processInstance = jbpmContext.loadProcessInstance( processId );
| List<TaskInstance> taskInstanceList = (List<TaskInstance>)processInstance.getTaskMgmtInstance().getUnfinishedTasks( processInstance.getRootToken() );
| for ( TaskInstance taskInstance : taskInstanceList ) {
| log.debug( "Current context 2" + JbpmConfiguration.getInstance().getCurrentJbpmContext().toString() );
| taskInstance.end();
| log.debug( "Current context 3" + JbpmConfiguration.getInstance().getCurrentJbpmContext().toString() );
| }
| } finally {
| log.debug( "Current context 4" + JbpmConfiguration.getInstance().getCurrentJbpmContext().toString() );
| log.debug( "Closing context" +jbpmContext.toString() );
| jbpmContext.close();
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164723#4164723
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164723
17 years, 8 months
[JBoss jBPM] - Deployment using PAR File
by nizzy
Hi,
I'm trying to programmatically deploy a par file using JBPM 3.2.2 and JBoss 4.2.2.
I have written the following code
| public void deployParFile(String fileName) throws Exception {
| if (log.isDebugEnabled()) {
| log.debug("inside deployParFile(fileName)");
| }
|
| JbpmContext ctx = JbpmConfiguration.getInstance().createJbpmContext();
| try {
| FileInputStream fis = new FileInputStream(fileName);
| ZipInputStream is = new ZipInputStream(fis);
| ProcessDefinition pd = ProcessDefinition.parseParZipInputStream(is);
|
| ctx.deployProcessDefinition(pd);
| ctx.getGraphSession().saveProcessDefinition(pd);
|
| } finally {
| ctx.close();
| }
|
| }
However I get the following error
| javax.ejb.EJBException: org.jbpm.jpdl.JpdlException: [[ERROR] no processdefinition.xml inside process archive]
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| Caused by: org.jbpm.jpdl.JpdlException: [[ERROR] no processdefinition.xml inside process archive]
| at org.jbpm.jpdl.par.JpdlArchiveParser.readFromArchive(JpdlArchiveParser.java:43)
| at org.jbpm.jpdl.par.ProcessArchive.parseProcessDefinition(ProcessArchive.java:81)
| at org.jbpm.graph.def.ProcessDefinition.parseParZipInputStream(ProcessDefinition.java:198)
| at com.ecebs.core.processviewer.ui.service.JBPMConsoleManager.deployParFile(JBPMConsoleManager.java:212)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| at $Proxy0.deployParFile(Unknown Source)
| at com.ecebs.test.MultipleProcessesTest.deployPar(MultipleProcessesTest.java:96)
| at com.ecebs.test.MultipleProcessesTest.<init>(MultipleProcessesTest.java:73)
| at com.ecebs.test.MultipleProcessesTest.main(MultipleProcessesTest.java:172)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| at $Proxy0.deployParFile(Unknown Source)
| at com.ecebs.test.MultipleProcessesTest.deployPar(MultipleProcessesTest.java:96)
| at com.ecebs.test.MultipleProcessesTest.<init>(MultipleProcessesTest.java:73)
| at com.ecebs.test.MultipleProcessesTest.main(MultipleProcessesTest.java:172)
I'm passing in to my deployPar method the name of the par file to be deployed, this file is present in the bin directory of my JBoss installation.
1. Any ideas for the error, I know that the par file contains the processdefinition.xml?
2. Will using this deployment method enable me to dislay the processdefinition image or will I have to write other code to perform this?
I have previous deployed programmatically using the following code and it works however it would be much tidier if I could use the par file!
public void deployProcessDefinitions(Collection<String> dirs) {
| // Get JBPM Context
| JbpmContext ctx = JbpmConfiguration.getInstance().createJbpmContext();
| try {
| for (String dir : dirs) {
|
| // each entry of dirs is of format [processdefintion.xml : processimage.jpg : gpd.xml ]
|
| log.info("Attempting to deploy [processdefintion.xml : processimage.jpg : gpd.xml ] from " + dir);
| // Parse process definition
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(dir + "/processdefinition.xml");
| // Deploy
| ctx.deployProcessDefinition(processDefinition);
| ctx.getGraphSession().saveProcessDefinition(processDefinition);
|
| // Add processimage.jpg and gpd.xml
| FileDefinition fd = processDefinition.getFileDefinition();
| if (fd == null) {
| fd = new FileDefinition();
| processDefinition.addDefinition(fd);
| }
|
| // Create InputStream from fileName
| FileInputStream fis = new FileInputStream(dir + "/processimage.jpg");
| fd.addFile("processimage.jpg", fis);
| ctx.getGraphSession().saveProcessDefinition(processDefinition);
|
| fis = new FileInputStream(dir + "/gpd.xml");
| fd.addFile("gpd.xml", fis);
| ctx.getGraphSession().saveProcessDefinition(processDefinition);
|
| log.info("Successfully deployed [processdefintion.xml : processimage.jpg : gpd.xml ] from " + dir);
| }
| } catch (Exception e) {
| e.printStackTrace();
| } finally {
| ctx.close();
| }
Thanks for continued support!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164698#4164698
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164698
17 years, 8 months