-
1. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
jhalliday Jun 2, 2008 6:55 AM (in response to fil78)Most likely an attempt to begin a transaction on a Thread that already has one, which is not allowed by default.
-
2. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
fil78 Jun 2, 2008 7:30 AM (in response to fil78)And is it possible to clean transactions stack? - because even after server restarting this transaction starts again - as I understand this transaction hanging over somewhere.
-
3. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
jhalliday Jun 2, 2008 7:42 AM (in response to fil78)What evidence is that understanding based on?
-
4. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
fil78 Jun 2, 2008 7:57 AM (in response to fil78)Well.. - When I restart server in debug mode during the restarting (in its final stage) the process stops in a breakpoint.
-
5. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
jhalliday Jun 2, 2008 8:04 AM (in response to fil78)and this breakpoint is set where exactly? Transaction.magicallyResurrect()? it would certainly have to be in some code that's specific to reinstating a pre-existing transaction on the thread, otherwise its irrelevant.
-
6. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
fil78 Jun 2, 2008 8:10 AM (in response to fil78)I have an action class of my jBPM process and this transaction invokes this class - here is the snippet:
@SuppressWarnings("unchecked") public void execute(ExecutionContext context) throws Exception { context.getContextInstance().setVariable("mess", mess); if (context.getContextInstance().getVariable("theBody") instanceof HashMap){ System.out.println("Preparation of candidate to employee..."); HashMap<String,String> tmp = null; tmp = (HashMap<String,String>)context.getContextInstance().getVariable("theBody"); EmployeeInformationVO employee = new EmployeeInformationVO(); Iterator<String> it = tmp.keySet().iterator(); while (it.hasNext()) { String elem = (String) it.next(); String value = (String)tmp.get(elem); if (elem.compareTo("s_name") == 0){ employee.setSurname(tmp.get(elem)); System.out.println("The candidate " + value + " was removed to the employee status"); } else if (elem.compareTo("f_name") == 0){ employee.setName(tmp.get(elem)); } else if (elem.compareTo("city") == 0){ CityVO city = new CityVO(); city.setId(Long.parseLong(tmp.get(elem))); employee.setCity(city); } } // pInfoInterface.addEmployee(employee); } }
Breakpoint is set in this line: context.getContextInstance().setVariable("mess", mess); -
7. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
jhalliday Jun 2, 2008 8:23 AM (in response to fil78)OK, let me see if I've understood this. When the app server starts up, it runs some of your business logic. You set a breakpoint in that business logic.
When the execution hits the breakpoint, you drop into the debugger and take a look around. There is an active Transaction on the Thread that is executing the business logic. You make a careful note of the transaction's identity.
You restart the execution, it throws an exception, per your first posting. You then stop and restart the app server.
It runs your business logic again, hits the breakpoint and, lo and behold, the same transaction you saw during the previous run is once again active on the Thread.
Based on this evidence, you believe 'even after server restarting this transaction starts again - as I understand this transaction hanging over somewhere.' i.e. the same Transaction has (re)started along with the app server. Is that right? -
8. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
fil78 Jun 2, 2008 8:33 AM (in response to fil78)Yes. That is my thoughts... And because stack includes arjuna exceptions... - I must say I have not faced before JTA and JTS...
-
9. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
jhalliday Jun 2, 2008 8:43 AM (in response to fil78)Hmm, fascinating case. Just out of curiosity, the transaction identity you made a careful note of and which reappears on the second run of the app server - what is it?
-
10. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
fil78 Jun 2, 2008 8:56 AM (in response to fil78)No - I have not made a note of transaction id - cause I do not know where could I find it. I just suspect that it goes like this....
-
11. Re: org.jbpm.JbpmException: couldn't start JTA transaction..
jhalliday Jun 2, 2008 9:55 AM (in response to fil78)Rather than treating the symptom by removing the unwanted transaction association from the thread (TransactionManager.suspend() BTW, and don't forget to resume it when you are done) perhaps it would be better to worry about why it's there in the first place? A Thread will not have a transaction associated to it unless something performs that association. Find whatever that is and make sure it's also cleaning up the association when it's done. The most likely problem here is failure to properly resolve an earlier transaction on the same thread.