I have a test.jsp file that is calling a class "DocumentDelegate":

<%
// 2304 is a test document
DocumentDelegate dd = new DocumentDelegate(2304);
dd.doAction(1, null, "plightbo");
// this action is supposed to throw an exception
//       because the action, 1, is not allowed right now
%>

DocumentDelegate.doAction() in turn calls a session bean:

DocumentMgr.doAction(long docId, int action, Hashtable params, String userId)
{
try {
  Workflow workfow = new TACWorkflow();
  workflow.action(docId, action, userId, params);
} catch (Exception e) {
throw new EJBException(e.getMessage());
}
}

In turn, the code in workflow.action() is doing:
throw new EJBException("This workflow step can't be called right now");

--------------
Now that I got that out of the way... when I hit test.jsp on the browser, 
the exception shows up on the browser and I can see the transaction.log 
show up in the console. But... if I hit the page again with the browser, 
nothing happens at all. No transaction logs, no System.out.println() 
statements, nothing. I have to click stop on the browser. When I click 
reload, now TWO transactions (and System.out.println()) statements show up 
(this one and the last one). What is going on here?

I changed workflow.action() to just return; instead of throwing an 
EJBException, then the transactions take place as they should and the print 
statements show up as they should. I tried chaning EJBException to other 
exceptions, and the same problem occurs. Why would a thrown Exception cause 
this behavior?

To recap: test.jsp calls class DocumentDelegate, which calls DocumentMgr 
session bean, which in turn loads up a class TACWorkflow and calls a method 
there.

-Pat

PS: this happens in 1.4.5 and 1.4.8


Reply via email to