Hi all,
I successfully starts the Human Task Service of jBPM5.1 in JBoss by modifing the Persistence.xml: :)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.jbpm.task" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/testDS1</jta-data-source>
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
<class>org.jbpm.task.Comment</class>
<class>org.jbpm.task.Deadline</class>
<class>org.jbpm.task.Comment</class>
<class>org.jbpm.task.Deadline</class>
<class>org.jbpm.task.Delegation</class>
<class>org.jbpm.task.Escalation</class>
<class>org.jbpm.task.Group</class>
<class>org.jbpm.task.I18NText</class>
<class>org.jbpm.task.Notification</class>
<class>org.jbpm.task.EmailNotification</class>
<class>org.jbpm.task.EmailNotificationHeader</class>
<class>org.jbpm.task.PeopleAssignments</class>
<class>org.jbpm.task.Reassignment</class>
<class>org.jbpm.task.Status</class>
<class>org.jbpm.task.Task</class>
<class>org.jbpm.task.TaskData</class>
<class>org.jbpm.task.SubTasksStrategy</class>
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.User</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
<!-- <property name="hibernate.connection.url" value="jdbc:oracle:thin:@172.25.8.251:xxxx:xxx" />
<property name="hibernate.connection.username" value="xxxx"/>
<property name="hibernate.connection.password" value="lxxxx"/>
<property name="hibernate.connection.autocommit" value="true" /> -->
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
and by making JTA data-source as under:
<datasources>
<xa-datasource>
<jndi-name>testDS1</jndi-name>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@xxx.xx.x.xxx:1521:xxxxx</xa-datasource-property>
<user-name>jbpm5</user-name>
<password>lupin</password>
</xa-datasource>
</datasources>
By these modifications and placing the necessary files, I able to start the human task service via JBoss :
Now I want my jbpm task run using this service as under:
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
WSHumanTaskHandler objWSHuman= new WSHumanTaskHandler();
objWSHuman.setConnection("127.0.0.1", 9123);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task",objWSHuman);
// start a new process instance
Map<String, Object> params = new HashMap<String, Object>();
params.put("employee", "rajan");
params.put("reason", "Yearly performance evaluation");
ksession.startProcess("com.sample.evaluation", params);
System.out.println("Thats itt..");
But on the JBoss console it gives the following error: :(
19:42:50,382 INFO [LoggingFilter] CREATED
19:42:50,382 INFO [LoggingFilter] OPENED
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...]
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...]
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...]
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...]
19:42:50,444 ERROR [STDERR] java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction()
19:42:50,444 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntityManagerImpl.java:324)
19:42:50,444 ERROR [STDERR] at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:811)
19:42:50,444 ERROR [STDERR] at org.jbpm.task.service.TaskServiceSession.addTask(TaskServiceSession.java:134)
19:42:50,444 ERROR [STDERR] at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:109)
19:42:50,444 ERROR [STDERR] at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
19:42:50,444 ERROR [STDERR] at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)
19:42:50,444 ERROR [STDERR] at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
19:42:50,444 ERROR [STDERR] at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:176)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)
19:42:50,444 ERROR [STDERR] at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)
19:42:50,444 ERROR [STDERR] at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
19:42:50,444 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
19:42:50,444 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
19:42:50,444 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
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...]
19:42:50,460 INFO [LoggingFilter] SENT: HeapBuffer[pos=0 lim=0 cap=0: empty]
19:43:02,453 INFO [LoggingFilter] IDLE
19:43:13,448 INFO [LoggingFilter] IDLE
19:43:25,442 INFO [LoggingFilter] IDLE
no idea on this:
Please help!!!