<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Running humantasks with HumanTaskService(Running in JBoss)
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/rajan01">Rajan Bansal</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/625538#625538">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi all,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>I successfully starts the<em style="font-size: 12pt;"> Human Task Service of jBPM5.1</em> in JBoss by modifing the Persistence.xml: <span> :) </span></strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8" standalone="yes"?></p><p><persistence version="1.0" </p><p><span>             xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence" target="_blank">http://java.sun.com/xml/ns/persistence</a></p><p><span>                                 </span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" target="_blank">http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd</a></p><p><span>                                 </span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence/orm" target="_blank">http://java.sun.com/xml/ns/persistence/orm</a><span> </span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" target="_blank">http://java.sun.com/xml/ns/persistence/orm_1_0.xsd</a><span>"</span></p><p><span>             xmlns:orm="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence/orm" target="_blank">http://java.sun.com/xml/ns/persistence/orm</a><span>"</span></p><p><span>             xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"</span></p><p><span>             xmlns="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence" target="_blank">http://java.sun.com/xml/ns/persistence</a><span>"></span></p><p>  <persistence-unit name="org.jbpm.task" transaction-type="JTA"></p><p>    <provider>org.hibernate.ejb.HibernatePersistence</provider></p><p><jta-data-source>java:/testDS1</jta-data-source>   </p><p> <class>org.jbpm.task.Attachment</class></p><p>    <class>org.jbpm.task.Content</class></p><p>    <class>org.jbpm.task.BooleanExpression</class></p><p>    <class>org.jbpm.task.Comment</class></p><p>    <class>org.jbpm.task.Deadline</class></p><p>    <class>org.jbpm.task.Comment</class></p><p>    <class>org.jbpm.task.Deadline</class></p><p>    <class>org.jbpm.task.Delegation</class></p><p>    <class>org.jbpm.task.Escalation</class></p><p>    <class>org.jbpm.task.Group</class></p><p>    <class>org.jbpm.task.I18NText</class></p><p>    <class>org.jbpm.task.Notification</class></p><p>    <class>org.jbpm.task.EmailNotification</class></p><p>    <class>org.jbpm.task.EmailNotificationHeader</class></p><p>    <class>org.jbpm.task.PeopleAssignments</class></p><p>    <class>org.jbpm.task.Reassignment</class></p><p>    <class>org.jbpm.task.Status</class></p><p>    <class>org.jbpm.task.Task</class></p><p>    <class>org.jbpm.task.TaskData</class></p><p>    <class>org.jbpm.task.SubTasksStrategy</class></p><p>    <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class></p><p>    <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class></p><p>    <class>org.jbpm.task.User</class></p><p>    <properties></p><p>      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/></p><p>      <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/></p><p>     <!-- <property name="hibernate.connection.url" value="jdbc:oracle:thin:@172.25.8.251:xxxx:xxx" /></p><p>      <property name="hibernate.connection.username" value="xxxx"/></p><p>      <property name="hibernate.connection.password" value="lxxxx"/> </p><p>      <property name="hibernate.connection.autocommit" value="true" /> --></p><p>      <property name="hibernate.max_fetch_depth" value="3"/></p><p>  <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/></p><p>      <property name="hibernate.hbm2ddl.auto" value="create" /></p><p>      <property name="hibernate.show_sql" value="true" /></p><p>    </properties></p><p>  </persistence-unit></p><p></persistence></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>a<strong>nd by making JTA data-source as under:</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><datasources></p><p>  <xa-datasource></p><p>    <jndi-name>testDS1</jndi-name></p><p>    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class></p><p>    <xa-datasource-property name="URL">jdbc:oracle:thin:@xxx.xx.x.xxx:1521:xxxxx</xa-datasource-property></p><p>   <user-name>jbpm5</user-name></p><p><password>lupin</password>    </p><p></xa-datasource></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></datasources></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>By these modifications and placing the necessary files, I able to start the human task service via JBoss :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>Now I want my <em>jbpm task </em>run using this service as under:</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>                    // load up the knowledge base</p><p>                      KnowledgeBase kbase = readKnowledgeBase();</p><p>                      StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();</p><p>                      WSHumanTaskHandler objWSHuman= new WSHumanTaskHandler();</p><p>                      objWSHuman.setConnection("127.0.0.1", 9123);</p><p>        </p><p>                 ksession.getWorkItemManager().registerWorkItemHandler("Human Task",objWSHuman);</p><p>                 // start a new process instance</p><p>                 Map<String, Object> params = new HashMap<String, Object>();</p><p>                 params.put("employee", "rajan");</p><p>                 params.put("reason", "Yearly performance evaluation");</p><p>                 ksession.startProcess("com.sample.evaluation", params);</p><p>                 System.out.println("Thats itt..");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>But on the JBoss console it gives the following error</strong>: <span> :( </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>19:42:50,382 INFO  [LoggingFilter] CREATED</p><p>19:42:50,382 INFO  [LoggingFilter] OPENED</p><p>19:42:50,428 INFO  [LoggingFilter] RECEIVED: HeapBuffer[pos=0 lim=339 cap=2048: 00 00 01 4F AC ED 00 05 73 72 01 00 1D 6F 72 67...]</p><p>19:42:50,428 INFO  [LoggingFilter] RECEIVED: HeapBuffer[pos=0 lim=336 cap=2048: 00 00 01 4C AC ED 00 05 73 72 01 00 1D 6F 72 67...]</p><p>19:42:50,428 INFO  [LoggingFilter] RECEIVED: HeapBuffer[pos=0 lim=337 cap=1024: 00 00 01 4D AC ED 00 05 73 72 01 00 1D 6F 72 67...]</p><p>19:42:50,444 INFO  [LoggingFilter] RECEIVED: HeapBuffer[pos=0 lim=654 cap=1024: 00 00 02 8A AC ED 00 05 73 72 01 00 1D 6F 72 67...]</p><p>19:42:50,444 ERROR [STDERR] java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction()</p><p>19:42:50,444 ERROR [STDERR]     at org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntityManagerImpl.java:324)</p><p>19:42:50,444 ERROR [STDERR]     at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:811)</p><p>19:42:50,444 ERROR [STDERR]     at org.jbpm.task.service.TaskServiceSession.addTask(TaskServiceSession.java:134)</p><p>19:42:50,444 ERROR [STDERR]     at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:109)</p><p>19:42:50,444 ERROR [STDERR]     at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:176)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)</p><p>19:42:50,444 ERROR [STDERR]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)</p><p>19:42:50,444 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)</p><p>19:42:50,444 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)</p><p>19:42:50,444 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:662)</p><p>19:42:50,460 INFO  [LoggingFilter] SENT: HeapBuffer[pos=0 lim=2292 cap=4096: 00 00 08 F0 AC ED 00 05 73 72 01 00 1D 6F 72 67...]</p><p>19:42:50,460 INFO  [LoggingFilter] SENT: HeapBuffer[pos=0 lim=0 cap=0: empty]</p><p>19:43:02,453 INFO  [LoggingFilter] IDLE</p><p>19:43:13,448 INFO  [LoggingFilter] IDLE</p><p>19:43:25,442 INFO  [LoggingFilter] IDLE</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>no idea on this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Please help!!!</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/625538#625538">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>