[JBoss jBPM] - Re: JBPM4: FOREIGN KEY problem
by shekharv
as I said, I did check it with mysql, it says so in the hibernate config.
Can you try in a different database? Hsql? the stuff that jbpm comes with default?
| <?xml version="1.0" encoding="utf-8"?>
|
| <!DOCTYPE hibernate-configuration PUBLIC
| "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
|
| <hibernate-configuration>
| <session-factory>
|
| <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
| <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
| <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
| <property name="hibernate.connection.username">sa</property>
| <property name="hibernate.connection.password"></property>
| <property name="hibernate.hbm2ddl.auto">create-drop</property>
| <property name="hibernate.format_sql">true</property>
| <!--<property name="hibernate.show_sql">true</property>-->
|
| <mapping resource="jbpm.repository.hbm.xml" />
| <mapping resource="jbpm.execution.hbm.xml" />
| <mapping resource="jbpm.history.hbm.xml" />
| <mapping resource="jbpm.task.hbm.xml" />
| <mapping resource="jbpm.jpdl.hbm.xml" />
| <mapping resource="jbpm.identity.hbm.xml" />
|
| </session-factory>
| </hibernate-configuration>
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242551#4242551
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242551
17 years
[JBoss jBPM] - Re: JBPM4: FOREIGN KEY problem
by shekharv
OK, well I could not sleep, so I did try your code out, and it worked. Within Mysql.
Your code was unchanged except for the fact that there was a method that you did not put in the earlier post. test.PID(). You did not put that method in the post you had.
Here's the jbpm.hibernate.cfg.xml i had:
| <?xml version="1.0" encoding="utf-8"?>
|
| <!DOCTYPE hibernate-configuration PUBLIC
| "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
|
| <hibernate-configuration>
| <session-factory>
|
| <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
| <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
| <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpm</property>
| <property name="hibernate.connection.username">root</property>
| <property name="hibernate.connection.password"></property>
| <property name="hibernate.format_sql">true</property>
|
| <mapping resource="jbpm.repository.hbm.xml"/>
| <mapping resource="jbpm.execution.hbm.xml"/>
| <mapping resource="jbpm.history.hbm.xml"/>
| <mapping resource="jbpm.task.hbm.xml"/>
| <mapping resource="jbpm.jpdl.hbm.xml"/>
| <mapping resource="jbpm.identity.hbm.xml"/>
|
| </session-factory>
| </hibernate-configuration>
|
|
| package org.jbpm.examples.task.assignee;
|
| import org.jbpm.api.Configuration;
| import org.jbpm.api.ExecutionService;
| import org.jbpm.api.HistoryService;
| import org.jbpm.api.IdentityService;
| import org.jbpm.api.ManagementService;
| import org.jbpm.api.ProcessEngine;
| import org.jbpm.api.ProcessInstance;
| import org.jbpm.api.RepositoryService;
| import org.jbpm.api.TaskService;
| import org.jbpm.api.task.Task;
| import org.jbpm.api.cmd.CommandService;
|
| import java.util.ArrayList;
| import java.util.HashMap;
| import java.util.List;
| import java.util.Map;
| import java.util.Set;
|
| /**
| * Created by IntelliJ IDEA.
| * User: svemuri
| * Date: Jul 8, 2009
| * Time: 10:04:22 PM
| */
| public class TestUpdate {
|
| protected ProcessEngine processEngine = null;
|
| protected RepositoryService repositoryService;
| protected ExecutionService executionService;
| protected ManagementService managementService;
| protected TaskService taskService;
| protected HistoryService historyService;
| protected IdentityService identityService;
| protected CommandService commandService;
| long deploymentDbid;
| protected List registeredDeployments = new ArrayList();
| protected ProcessInstance processInstance;
|
| /**
| * @param args
| */
| public static void main(String[] args) {
| // TODO Auto-generated method stub
| TestUpdate test = new TestUpdate();
| test.init();
| test.doCreate();
|
| //test.doCheckTask("hexiaof");
| //test.doCheckTask("hexiaofeng");
|
| test.doTaskAssign();
| test.doCheckTask("hexiaof");
| //test.doCheckTask("hexiaofeng");
|
| //test.searchPID();
| test.doTaskReview();
| //test.doCheckTask("hexiaof");
| test.doCheckTask("hexiaofeng");
| test.doCompleteTask();
|
| test.del();
|
| }
|
| private void init() {
|
| processEngine = new Configuration().buildProcessEngine();
|
| repositoryService = processEngine.get(RepositoryService.class);
| executionService = processEngine.getExecutionService();
| historyService = processEngine.getHistoryService();
| managementService = processEngine.getManagementService();
| taskService = processEngine.getTaskService();
| identityService = processEngine.getIdentityService();
| commandService = processEngine.get(CommandService.class);
|
| deploymentDbid = repositoryService.createDeployment()
| .addResourceFromClasspath("org/jbpm/examples/task/assignee/process.jpdl.xml").deploy();
|
| processInstance = executionService
| .startProcessInstanceByKey("TaskDemo");
| processInstance = executionService
| .startProcessInstanceByKey("TaskDemo", "123345");
| System.out.println("processInstance.getId===========:" + processInstance.getId());
| System.out.println("deploymentDbid===========:" + deploymentDbid);
| }
|
|
| private void doCreate() {
| System.out.println("<<<=====doCreate=====");
| Map<String, Object> variables = new HashMap<String, Object>();
| variables.put("order", new Order("hexiaof"));
| variables.put("form", "formID");
| String executionId = processInstance.findActiveExecutionIn("create").getId();
| processInstance = executionService.signalExecutionById(executionId,
| "toTaskAssign", variables);
| System.out.println("TaskAssign is " + processInstance.isActive("TaskAssign"));
| }
|
| private void doCheckTask(String username) {
| System.out.println("<<<=====doCheckTask=====:" + username);
| List<Task> taskList = taskService.findPersonalTasks(username);
| System.out.println(username + "=====tasks number=====:" + taskList.size());
|
| Task task = null;
| long taskDBId = -1;
| for (int i = 0; i < taskList.size(); i++) {
| task = taskList.get(i);
| System.out.println("=====tasks getName=====:" + task.getName());
| System.out.println("=====tasks getForm=====:" + task.getForm());
| System.out.println("=====tasks getDescription=====:" + task.getDescription());
| System.out.println("=====tasks getPriority=====:" + task.getPriority());
| System.out.println("=====tasks getPriority=====:" + task.getAssignee());
| taskDBId = task.getDbid();
| System.out.println("=====tasks getDbid=====:" + taskDBId);
|
| Set variableNames = taskService.getVariableNames(taskDBId);
| Map<String, Object> variables = taskService.getVariables(taskDBId, variableNames);
| System.out.println("form value is " + variables.get("form"));
| taskService.completeTask(taskDBId);
|
| System.out.println(username + " complete the task:" + task.getName());
| }
| taskList = taskService.findPersonalTasks(username);
| System.out.println(username + "=====tasks number=====:" + taskList.size());
|
| }
|
| private void doTaskAssign() {
| System.out.println("<<<=====doTaskAssign=====");
| Map<String, Object> variables = new HashMap<String, Object>();
| variables.put("order", new Order("hexiaofeng"));
| variables.put("formID", "formID123123");
| String executionId = processInstance.findActiveExecutionIn("TaskAssign").getId();
| processInstance = executionService.signalExecutionById(executionId,
| "toTaskReview", variables);
| System.out.println("TaskReview is " + processInstance.isActive("TaskReview"));
| }
|
| private void doTaskReview() {
| System.out.println("<<<=====doTaskReview=====");
| ProcessInstance pi = processEngine.getExecutionService().findProcessInstanceById(this.processInstance.getId());
| String executionId = pi.findActiveExecutionIn("TaskReview").getId();
| processInstance = executionService.signalExecutionById(executionId,
| "tocompleteTask");
| System.out.println("End is " + processInstance.isActive("completeTask"));
| }
|
| private void doCompleteTask() {
| System.out.println("<<<=====docompleteTask=====");
| String executionId = processInstance.findActiveExecutionIn("completeTask").getId();
| processInstance = executionService.signalExecutionById(executionId,
| "toEnd");
| System.out.println("End is " + processInstance.isActive("End"));
| }
|
| private void del() {
| System.out.println("<<<=====del=====");
| ProcessInstance pi = processEngine.getExecutionService().findProcessInstanceById(this.processInstance.getId());
| String executionId = pi.findActiveExecutionIn("end").getId();
| processInstance = executionService.signalExecutionById(executionId);
| //
| executionService.endProcessInstance(this.processInstance.getId(), "end");
| //repositoryService.deleteDeployment(this.deploymentDbid);
| }
| }
|
The above example fails at the line that tries to load a ProcessInstance that does not even exist in the db, coz it's ended and has been deleted.
| processInstance.getId===========:TaskDemo.asdd
| deploymentDbid===========:6
| <<<=====doCreate=====
| 01:56:25,173 FIN | [Signal] signalling activity(create), signalName=toTaskAssign
| 01:56:25,173 FIN | [ScopeInstanceImpl] create variable 'form' in 'process-instance' with value 'formID'
| 01:56:25,174 FIN | [ScopeInstanceImpl] create variable 'order' in 'process-instance' with value 'org.jbpm.examples.task.assignee.Order@74b1a7a0'
| 01:56:25,267 FIN | [ExecuteActivity] executing activity(TaskAssign)
| TaskAssign is true
| <<<=====doTaskAssign=====
| 01:56:25,329 FIN | [Signal] signalling activity(TaskAssign), signalName=toTaskReview
| 01:56:25,332 FIN | [ScopeInstanceImpl] updating variable 'order' in 'process-instance' to value 'org.jbpm.examples.task.assignee.Order@38a88c32'
| 01:56:25,337 FIN | [ScopeInstanceImpl] create variable 'formID' in 'process-instance' with value 'formID123123'
| 01:56:25,345 FIN | [ExecuteActivity] executing activity(TaskReview)
| TaskReview is true
| <<<=====doCheckTask=====:hexiaof
| 01:56:25,355 FIN | [TaskQueryImpl] select distinct task from org.jbpm.pvm.internal.task.TaskImpl as task where task.state != 'suspended' and task.assignee = :assignee order by task.priority desc
| 01:56:25,362 FIN | [TaskQueryImpl] setting parameter assignee: hexiaof
| hexiaof=====tasks number=====:1
| =====tasks getName=====:TaskAssign
| =====tasks getForm=====:null
| =====tasks getDescription=====:null
| =====tasks getPriority=====:0
| =====tasks getPriority=====:hexiaof
| =====tasks getDbid=====:3
| form value is formID
| hexiaof complete the task:TaskAssign
| 01:56:25,417 FIN | [TaskQueryImpl] select distinct task from org.jbpm.pvm.internal.task.TaskImpl as task where task.state != 'suspended' and task.assignee = :assignee order by task.priority desc
| 01:56:25,417 FIN | [TaskQueryImpl] setting parameter assignee: hexiaof
| hexiaof=====tasks number=====:0
| <<<=====doTaskReview=====
| 01:56:25,427 FIN | [Signal] signalling activity(TaskReview), signalName=tocompleteTask
| 01:56:25,429 FIN | [ExecuteActivity] executing activity(completeTask)
| End is true
| <<<=====doCheckTask=====:hexiaofeng
| 01:56:25,433 FIN | [TaskQueryImpl] select distinct task from org.jbpm.pvm.internal.task.TaskImpl as task where task.state != 'suspended' and task.assignee = :assignee order by task.priority desc
| 01:56:25,433 FIN | [TaskQueryImpl] setting parameter assignee: hexiaofeng
| hexiaofeng=====tasks number=====:1
| =====tasks getName=====:TaskReview
| =====tasks getForm=====:null
| =====tasks getDescription=====:null
| =====tasks getPriority=====:0
| =====tasks getPriority=====:hexiaofeng
| =====tasks getDbid=====:4
| form value is formID
| hexiaofeng complete the task:TaskReview
| 01:56:25,465 FIN | [TaskQueryImpl] select distinct task from org.jbpm.pvm.internal.task.TaskImpl as task where task.state != 'suspended' and task.assignee = :assignee order by task.priority desc
| 01:56:25,465 FIN | [TaskQueryImpl] setting parameter assignee: hexiaofeng
| hexiaofeng=====tasks number=====:0
| <<<=====docompleteTask=====
| 01:56:25,471 FIN | [Signal] signalling activity(completeTask), signalName=toEnd
| 01:56:25,473 FIN | [ExecuteActivity] executing activity(End)
| 01:56:25,473 FIN | [Execution] process-instance ends with state ended
| 01:56:25,489 FIN | [DbSessionImpl] deleting process instance TaskDemo.asdd
| End is false
| <<<=====del=====
| Exception in thread "main" java.lang.NullPointerException
| at org.jbpm.examples.task.assignee.TestUpdate.del(TestUpdate.java:163)
| at org.jbpm.examples.task.assignee.TestUpdate.main(TestUpdate.java:64)
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242548#4242548
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242548
17 years
[JCA/JBoss] - Re: Changinh connection state in CMP EJB
by vickyk
"dimonv" wrote :
| Nevertheless I had a look into the patch suggested by Vicky and have some comments regarding org.jboss.resource.connectionmanager.JBossManagedConnectionPool. Even if an RA supports re-authentication, its connections may not be put into a OnePool per default, since their CRIs e.g. types can differ.
|
What issue do you see here?
"dimonv" wrote :
| Moreover if an RA supports re-authentication, it doesn't mean automatically that re-authentication should be applied, I think it's the matter of -ds.xml.
|
Not really IMO, the reauthentication would be decided at the RA level. The -ds.xml should then supply the infrastructure needed to support the reauthentication i.e reauthentication mechanish as in case of jdbc rar.
Logically re-authentication means a single pool.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242541#4242541
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242541
17 years
[EJB/JBoss] - JBoss 4.3 - Entity Beans Reentrant behavior
by rksavvion
Presently for our EJB application, we have REENTRANT as false for the Entity beans (ejb 2.1) and performance test involving higher concurrency pose no problem for JBoss 5 (as well as for weblogic, websphere).
However, for JBoss 4.3, with REENTRANT as false for Entity beans,
following exception occurs for higher concurrency.
TransactionRolledbackLocalException: Reentrant method call detected
Setting the REENTRANT behavior to TRUE solves this problem and there are no "Reentrant method call detected" exception.
Any suggestions or documentation suggesting the pros/cons of setting the
Entity Beans Reentrant behavior to TRUE is appreciated.
Stack trace:
javax.ejb.TransactionRolledbackLocalException: Reentrant method call detected: ProcessInstanceEBBBean 4808
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:262)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:527)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:65)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242539#4242539
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242539
17 years
[JNDI/Naming/Network] - jboss 4 behind proxy server
by gkatz
Hi all;
in my network configuration I have a jboss server running on machine A. the application deployed on that jboss has an EJB/JMS business logic and a fat swing client that is deployed inside the ear that is downloaded via webstart.
all communications with machine A must be done via a proxy server. in machine B, which I am trying to access machine A from, I have configured java to use that proxy server. when i download the client via webstart all HTTP communication goes through the proxy which is fine. however,upon the application startup i see that connection on ports 1099 (jndi), 8093 (jms) are trying to be opened directly to machine A and not through the proxy server.
I searched the forum and could not an answer. I would greatly appreciate any help of reference to a document or something. i am not even sure its a jboss issue.
thanks for your time.
Guy.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242536#4242536
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242536
17 years