[JBoss jBPM] - Re: TaskInstance.end() hogs CPU time
by Johan.Parent
Hi Koen,
Many thanks for your answer!
You're are right of course, below the relevant code and definition.
I've run into the exact same problem using a HSQLDB as well as a Sybase backend.
The process definition is (IMHO) simple:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="oe_process">
| <swimlane name="Prescriber">
| <assignment expression="user(doc1)"></assignment>
| </swimlane>
|
| <swimlane name="OrderEntryPeople">
| <assignment expression="user(oe1)" />
| </swimlane>
|
| <start-state name="Prescribe">
| <task swimlane='PrescriberTask' />
| <transition name="" to="Oe">
| </transition>
| </start-state>
|
| <task-node name="Oe">
| <task name="OeTask" swimlane="OrderEntryPeople">
| </task>
| <transition name="" to="Sign"></transition>
| </task-node>
|
|
| <task-node name="Sign">
| <task name="SignTask" swimlane="Prescriber"></task>
| <transition name="" to="end"></transition>
| </task-node>
|
| <end-state name="end"></end-state>
|
| </process-definition>
|
As is the actual client code that consumes all the CPU time:
| public void processHandle(String processName) {
| // The code in this method could be the content of a message driven bean.
|
| // Lookup the pojo persistence context-builder that is configured above
| createSession();
|
| System.out.println(jbpmContext.getActorId());
|
| try {
| jbpmContext.setActorId(actorName);
|
| // First, we need to get the process instance back out of the database.
| // There are several options to know what process instance we are dealing
| // with here. The easiest in this simple test case is just to look for
| // the full list of process instances. That should give us only one
| // result. So let's look up the process definition.
|
| ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition(processName);
|
| // Now we search for all the tasks waiting for our actor
| List tasksActor = taskMgmtSession.findTaskInstances(actorName);
|
| if (verboseFlag)
| System.out.println("ID: " + id + " got " + tasksActor.size() + " tasks waiting");
|
| if (tasksActor.size() > 0) {
| for (int i=0; i<tasksActor.size(); i++) {
| TaskInstance instance = (TaskInstance) tasksActor.get(i);
|
| if (verboseFlag) {
| System.out.println("ID: " + id + " Token positioned in " + instance.getName() + " " + instance.getId());
| System.out.println("Values: " + instance.getVariable("userName") + " " + instance.getVariable("UUID") );
| }
|
| // Skip already finished instances
| if (instance.hasEnded()) {
| System.out.println("Tasks has already been processed. CHECK THIS!!!!");
| } else {
| // Now we can do our work here and mark the end of this task
| instance.end();
| }
|
| // Now we can update the state of the execution in the database
| jbpmContext.save(instance);
| }
| }
| } finally {
| // Tear down the pojo persistence context.
| closeSession();
| }
| }
|
To be complete I'll add the utility methods too:
| protected void createContext() {
| jbpmContext = jbpmConfiguration.createJbpmContext();
| }
|
| protected void closeContext() {
| jbpmContext.close();
| }
|
| protected void createSession() {
| createContext();
| initializeMembers();
| }
|
| protected void closeSession() {
| closeContext();
| resetMembers();
| }
|
| protected void initializeMembers() {
| session = jbpmContext.getSession();
| graphSession = jbpmContext.getGraphSession();
| taskMgmtSession = jbpmContext.getTaskMgmtSession();
| schedulerSession = jbpmContext.getSchedulerSession();
| contextSession = jbpmContext.getContextSession();
| }
|
| protected void resetMembers() {
| session = null;
| graphSession = null;
| taskMgmtSession = null;
| schedulerSession = null;
| contextSession = null;
| }
|
Additional runs show that the observed decrease in performance (aka cpu hogging) coincides with a rapid increase in mem usage. I wonder whether I'm using the jbpm api correctly.
Regards,
Johan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000471#4000471
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000471
19 years, 3 months
[JBoss Portal] - Re: Help Needed on How to deploy a Struts Application as a p
by hussain_rangwala
Hey thomas
Thanks a lot for the idea..the WSRP problem is solved i suppose..
However i m still not able to deploy my application..I have read all the documents and done all the modifications in the deployment descriptors .while deploying my struts application in the deploy folder I get this error on the console...Hope you could just help
| 2007-01-11 20:10:57,310 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
|
| --- Incompletely deployed packages ---
| org.jboss.deployment.DeploymentInfo@d5daf42b { url=file:/D:/JBoss/jboss-portal-2.4.0/server/default/deploy/SETLAppName.war }
| deployer: MBeanProxyExt[jboss.web:service=WebServer]
| status: Deployment FAILED reason: Error during deploy; - nested throwable: (javax.naming.NamingException: ejb-local-ref: 'ejb/AccountDetailsEJB', with web.xml ejb-link: 'AccountDetails' failed to resolve to an ejb with a LocalHome)
| state: FAILED
| watch: file:/D:/JBoss/jboss-portal-2.4.0/server/default/deploy/SETLAppName.war
| altDD: null
| lastDeployed: 1168526453288
| lastModified: 1168526454000
| mbeans:
|
| --- MBeans waiting for other MBeans ---
| ObjectName: jboss.web.deployment:war=SETLAppName.war,id=-707070933
| State: FAILED
| Reason: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: ejb-local-ref: 'ejb/AccountDetailsEJB', with web.xml ejb-link: 'AccountDetails' failed to resolve to an ejb with a LocalHome)
|
| --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
| ObjectName: jboss.web.deployment:war=SETLAppName.war,id=-707070933
| State: FAILED
| Reason: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: ejb-local-ref: 'ejb/AccountDetailsEJB', with web.xml ejb-link: 'AccountDetails' failed to resolve to an ejb with a LocalHome)
|
|
| 2007-01-11 20:10:57,310 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Notified that enabled: true
| 2007-01-11 20:10:57,310 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Started jboss.deployment:type=DeploymentScanner,flavor=URL
| 2007-01-11 20:10:57,310 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.deployment:type=DeploymentScanner,flavor=URL dependent components: []
| 2007-01-11 20:10:57,435 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: jboss-service.xml
| 2007-01-11 20:10:57,435 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/D:/JBoss/jboss-portal-2.4.0/server/default/conf/jboss-service.xml
| 2007-01-11 20:10:57,435 DEBUG [org.jboss.web.tomcat.tc5.Tomcat5] Saw org.jboss.system.server.started notification, starting connectors
| 2007-01-11 20:10:57,482 INFO [org.apache.coyote.http11.Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
| 2007-01-11 20:10:57,764 INFO [org.apache.jk.common.ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
| 2007-01-11 20:10:57,779 INFO [org.apache.jk.server.JkMain] Jk running ID=0 time=0/141 config=null
| 2007-01-11 20:10:57,795 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 1m:3s:96ms
|
Also can you refer me any link that can give me a step by step guide on how to deploy a struts application as a Portlet on JBoss.....
Any suggestions will be of great help
Regards
Hussain
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000469#4000469
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000469
19 years, 3 months
[JBoss Messaging] - MDB Redelivery bizarre behaviour
by mskonda
I created a simple durable MDB.
In my onMessage(), I create an Exception and throw it so that during try-catch, I'll rollback the Tx by calling mdbContext.setRollbackOnly().
I pump in messages to the destination where this MDB is listening to.
First message is redelivered as expected. The second time, it won't. Thirdtime again it does. Fourth time no.. So, the redelivery occurs for every alternate process..!!
Either I must be missing fundamentally something or something is wrong with MBD redelivery mechanism.
My onMessage looks like this:
| public void onMessage(Message message)
| {
| counter++;
| try
| {
| logger.info("---> onMessage" + this.hashCode() + ": message "
| + message.getJMSMessageID());
|
| if(message.getJMSRedelivered())
| {
| logger.info(" ---> MESSAGE IS REDELIVERED ");
| }
| logger.info(" ---> Throwing ex");
|
| throw new Exception("ex");
|
| } catch (Exception e)
| {
| logger
| .info(" ---> Exception occured. Rolling back Tx (must retry)-"
| + mdbContext);
| getMessageDrivenContext().setRollbackOnly();
| }
| }
|
My deployment descriptors:
| JBOSS.xml
| <message-driven>
| <configuration-name>Standard Message Driven Bean</configuration-name>
| <ejb-name>testMDB</ejb-name>
| <local-jndi-name>testMDB</local-jndi-name>
| <mdb-client-id>testMDB</mdb-client-id>
| <mdb-subscription-id>testMDB</mdb-subscription-id>
| <destination-jndi-name>/topic/testTopic</destination-jndi-name>
| </message-driven>
|
| EJB-JAR.xml
|
| <enterprise-beans>
| <message-driven>
| <ejb-name>testMDB</ejb-name>
| <ejb-class>test.com.cmi2.jms.TestMDB</ejb-class>
| <transaction-type>Container</transaction-type>
| <message-driven-destination>
| <destination-type>javax.jms.Topic</destination-type>
| <subscription-durability>Durable</subscription-durability>
| </message-driven-destination>
| </message-driven>
| </enterprise-beans>
|
My console log when a message is first sent:
| 14:31:32,723 INFO [TestMDB] ---> onMessage34695986: message ID:JBM-4567040
| 14:31:32,723 INFO [TestMDB] ---> Throwing ex
| 14:31:32,723 INFO [TestMDB] ---> Exception occured. Rolling back Tx (must retry)
|
| 14:31:32,727 INFO [TestMDB] ---> onMessage34695986: message ID:JBM-4567040
| 14:31:32,727 INFO [TestMDB] ---> MESSAGE IS REDELIVERED
| 14:31:32,727 INFO [TestMDB] ---> Throwing ex
| 14:31:32,727 INFO [TestMDB] ---> Exception occured. Rolling back Tx (must retry)
|
| 14:31:32,730 INFO [TestMDB] ---> onMessage34695986: message ID:JBM-4567040
| 14:31:32,730 INFO [TestMDB] ---> MESSAGE IS REDELIVERED
| 14:31:32,730 INFO [TestMDB] ---> Throwing ex
| 14:31:32,731 INFO [TestMDB] ---> Exception occured. Rolling back Tx (must retry)
|
| 14:31:32,733 INFO [TestMDB] ---> onMessage34695986: message ID:JBM-4567040
| 14:31:32,734 INFO [TestMDB] ---> MESSAGE IS REDELIVERED
| 14:31:32,734 INFO [TestMDB] ---> Throwing ex
| 14:31:32,734 INFO [TestMDB] ---> Exception occured. Rolling back Tx (must retry)
| 14:31:32,736 WARN [DLQHandler] Message resent too many times; sending it to DLQ; message id=ID:JBM-4567040
|
When a message is sent second time:
|
| 14:31:50,791 INFO [TestMDB] ---> onMessage34695986: message ID:JBM-4567296
| 14:31:50,791 INFO [TestMDB] ---> Throwing ex
| 14:31:50,791 INFO [TestMDB] ---> Exception occured. Rolling back Tx (must retry)
|
|
I am a bit confused - so any pointers are higly appreciated!
Thanks
Madhu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000461#4000461
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000461
19 years, 3 months