http://ofbiz.116.s1.nabble.com/XSD-schema-conversion-anyone-tp170452p170464.html
(module attached).
start I'd just like to check ...
I am not after a full Shark implemenation. All I am looking for is a similar
level of implementation as previously was available.
So ... Is the Ofbiz/shark likely to run my simple workflows?
If you think I can get them working ... My efforts may be better spent on
incremental improvements to Shark.
PS I have attached a mimimal module that shows the resume failure.
and that should take care of the warnings.
class is a mess. The way it uses try/catch blocks is just so wrong for safe
hardly anything since Andy ended his efforts on it)...
basically to use 2 and only 2 try/catch blocks, one inside the other. The
rollback/commit in the finally block).
runSync method that starts on line 239.
it is showing up as a tx problem...
-David J.
> Thankyou!
>
> The code I am using is about 2 weeks old.
>
> I checked the code for WorkflowEngine.java is the same as the current.
>
> So are you suggesting update the calls in
> org.ofbiz.workflow.WorkflowEngine as below. This creates a similar
> exception in the resume (which is also changed).
>
> To call as follows
> //CHANGE ... remove TransactionManager tm =
> TransactionFactory.getTransactionManager();
> //if (tm == null) {
> // throw new GenericServiceException("Cannot get the
> transaction
> manager; cannot run persisted services.");
> //}
>
> Transaction parentTrans = null;
> boolean beganTransaction = false;
> try {
> try {
> parentTrans = TransactionUtil.suspend();
> beganTransaction = TransactionUtil.begin();
> //Debug.logInfo("Suspended transaction; began new: " +
> beganTransaction, module);
> // } catch (SystemException se) {
> // Debug.logError(se, "Cannot suspend transaction: " +
> se.getMessage(), module);
> } catch (GenericTransactionException e) {
> Debug.logError(e, "Cannot begin nested transaction:
> " +
> e.getMessage(), module);
> }
>
>
> AND
>
> try
> {
> // REMOVE tm.resume(parentTrans);
> TransactionUtil.resume(parentTrans);
> //Debug.logInfo("Resumed the parent
> transaction.", module);
> }
> catch (GenericTransactionException e)
> {
> throw new GenericServiceException("Cannot resume
> transaction", e);
> }
> // } catch (InvalidTransactionException ite) {
> // throw new GenericServiceException("Cannot resume
> transaction", ite);
> // } catch (SystemException se) {
> // throw new GenericServiceException("Unexpected
> transaction error", se);
> // }
>
>
>
>
>
> 2006-08-08 15:44:36,138 (http-0.0.0.0-8443-Processor3) [
> TransactionUtil.java:530:WARN ]
> ---- exception report
> ----------------------------------------------------------
> WARNING: In setTransactionBeginStack a stack placeholder was
> already in
> place, here is where the transaction began:
> Exception: java.lang.Exception
> Message: Tx Stack Placeholder
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Tx Stack Placeholder
> org.ofbiz.entity.transaction.TransactionUtil.setTransactionBeginStack(
> Transa
> ctionUtil.java:524)
> org.ofbiz.entity.transaction.TransactionUtil.begin
> (TransactionUtil.java:111)
> org.ofbiz.entity.transaction.TransactionUtil.begin
> (TransactionUtil.java:57)
> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:100)
> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:82)
> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
> 553)
> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
> 620)
> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
> 181)
> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
> 188)
> org.ofbiz.webapp.event.ServiceEventHandler.invoke
> (ServiceEventHandler.java:2
> 90)
> .... SNIP
> ----------------------------------------------------------------------
> ------
> ----
>
> 2006-08-08 15:44:36,148 (http-0.0.0.0-8443-Processor3) [
> TransactionUtil.java:532:WARN ]
> ---- exception report
> ----------------------------------------------------------
> WARNING: In setTransactionBeginStack a stack placeholder was
> already in
> place, here is the current location:
> Exception: java.lang.Exception
> Message: Current Stack Trace
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Current Stack Trace
> org.ofbiz.entity.transaction.TransactionUtil.setTransactionBeginStack(
> Transa
> ctionUtil.java:531)
> org.ofbiz.entity.transaction.TransactionUtil.resume
> (TransactionUtil.java:321
> )
> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:280)
> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:82)
> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
> 553)
> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
> 620)
> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
> 181)
> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
> 188)
> org.ofbiz.webapp.event.ServiceEventHandler.invoke
> (ServiceEventHandler.java:2
> 90)
> .... SNIP
> ----------------------------------------------------------------------
> ------
> ----
>
> 2006-08-08 15:44:36,148 (http-0.0.0.0-8443-Processor3) [
> ServiceDispatcher.java:564:DEBUG] [[ASync service failed...-
> total:4.496,since last(ASync service sta...):4.496]] - 'leadmgt /
> processWf'
> 2006-08-08 15:44:36,148 (http-0.0.0.0-8443-Processor3) [
> ServiceDispatcher.java:567:ERROR]
> ---- exception report
> ----------------------------------------------------------
> Service [processWf] threw an unexpected exception/error
> Exception: org.ofbiz.service.GenericServiceException
> Message: Cannot resume transaction (System error, could not resume
> transaction (Caller context is not an unspecified transaction
> context))
> ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.service.GenericServiceException: Cannot resume
> transaction (System
> error, could not resume transaction (Caller context is not an
> unspecified
> transaction context))
> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:285)
>
> -----Original Message-----
> From: David E Jones [mailto:
[hidden email]]
> Sent: Tuesday, 8 August 2006 2:44 PM
> To:
[hidden email]
> Subject: Re: Transaction problem with ofbiz-workflow start (geronimo
> issue????)
>
>
> Without looking into it more, I'm not sure...
>
> Which revision of OFBiz are you updating to?
>
> The code you included in your last message for the tx management in
> the
> workflow engine is a little fishy, it it's not doing the suspend
> correctly
> and such. It should use the TransactionUtil.suspend method and not
> do it
> itself.
>
> Still the way it is doing it should only cause warnings and
> hopefully allow
> things to continue just fine.
>
> But yeah, changing it to use the TransactionUtil methods instead of
> the
> tm.suspect and tm.resume directly should solve the problem.
>
> -David
>
>
> On Aug 7, 2006, at 10:21 PM, David Garrett wrote:
>
>> More Information ... Hopefully simplified:
>>
>> I try to start the ofbiz-workflow by calling an async service from an
>> event as follows
>> <request-map uri="processWf">
>> <security https="true" auth="true"/>
>> <event type="service" path="async" invoke="processWf"/>
>> <response name="success" type="view" value="main"/>
>> <response name="error" type="view" value="main"/>
>> </request-map>
>> It calls the following service
>> <service name="processWf" engine="ofbiz-workflow"
>> location="org.ofbiz.leadmgt" invoke="processWf" >
>> <description>Service for testing workflow engine</
>> description>
>> <attribute name="communicationEventId" type="String"
>> mode="INOUT"
>> optional="true"/>
>> </service>
>>
>> Then the problem is with nested transactions below
>>
>> ServiceEventHandler.invoke(...)
>> dispatcher.runAsync(serviceName, serviceContext); //
>> ServiceEventHandler line 290
>> ServiceDispatcher.runAsync(...)
>> // First transaction starts OK
>> beganTrans = TransactionUtil.begin(service.transactionTimeout);
>> //ServiceDispatcher.runAsync line 498)
>> ...
>> engine.runAsync(...); //ServiceDispatcher.runAsync line 553)
>> WorkflowEngine.runAsync(...)
>> // 2nd transaction begin FAILS
>> beganTransaction = TransactionUtil.begin();
>> //WorkflowEngine.runAsync line 100
>> ...
>> TransactionUtil.setTransactionBeginStack() <==##
>> transaction
>> already exists
>>
>>
>> Why can't the second transaction begin?
>>
>> Should I start the workflow a different way which does not cause 2
>> transactions.
>>
>> Do I need to remove the transaction within the workflow?
>>
>> Thanks
>> David G
>>
>> -----Original Message-----
>> From: David Garrett [mailto:
[hidden email]]
>> Sent: Tuesday, 8 August 2006 11:40 AM
>> To:
[hidden email]
>> Subject: Transaction problem with ofbiz-workflow start (geronimo
>> issue????)
>>
>> Hi,
>>
>> I am trying to upgrade to a much more recent version of Ofbiz.
>>
>> The problem I have is starting a workflow with the orignial ofbiz-
>> workflow
>> (ie not trying to use Shark yet)
>>
>> I was wondering whether the transaction problem related to the
>> change to
>> geronimo TM.
>>
>> I have a VERY simple workflow which is initiated with
>> WorkflowEngine.runAsync(..)
>>
>> Any suggestions appreciated.
>>
>> It fails on:
>> beganTransaction = TransactionUtil.begin();
>>
>> The code executed is very small ... In WorkflowEngine
>> public void runAsync(String localName, ModelService
>> modelService, Map
>> context, GenericRequester requester, boolean persist) throws
>> GenericServiceException {
>> // Suspend the current transaction
>> TransactionManager tm =
>> TransactionFactory.getTransactionManager();
>> if (tm == null) {
>> throw new GenericServiceException("Cannot get the
>> transaction
>> manager; cannot run persisted services.");
>> }
>>
>> Transaction parentTrans = null;
>> boolean beganTransaction = false;
>> try {
>> try {
>> parentTrans = tm.suspend();
>> beganTransaction = TransactionUtil.begin(); <======
>> EXCEPTION GENERATED HERE!!!!
>> //Debug.logInfo("Suspended transaction; began new:
>> " +
>> beganTransaction, module);
>> } catch (SystemException se) {
>> Debug.logError(se, "Cannot suspend transaction: " +
>> se.getMessage(), module);
>> } catch (GenericTransactionException e) {
>> Debug.logError(e, "Cannot begin nested transaction:
>> " +
>> e.getMessage(), module);
>> }
>>
>>
>> The exception is as follows:
>>
>> 2006-08-08 11:22:51,099 (http-0.0.0.0-8443-Processor3) [
>> ServiceDispatcher.java:468:DEBUG] [[ASync service started...-
>> total:0.0,since last(Begin):0.0]] - 'leadmgt / processWf'
>> 2006-08-08 11:22:58,700 (http-0.0.0.0-8443-Processor3) [
>> TransactionUtil.java:530:WARN ]
>> ---- exception report
>> ----------------------------------------------------------
>> WARNING: In setTransactionBeginStack a stack placeholder was
>> already in
>> place, here is where the transaction began:
>> Exception: java.lang.Exception
>> Message: Tx Stack Placeholder
>> ---- stack trace
>> ---------------------------------------------------------------
>> java.lang.Exception: Tx Stack Placeholder
>> org.ofbiz.entity.transaction.TransactionUtil.setTransactionBeginStack
>> (
>> Transa
>> ctionUtil.java:524)
>> org.ofbiz.entity.transaction.TransactionUtil.begin
>> (TransactionUtil.java:111)
>> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
>> 498)
>> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
>> 620)
>> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
>> 181)
>> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
>> 188)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke
>> (ServiceEventHandler.java:2
>> 90)
>> org.ofbiz.webapp.control.RequestHandler.runEvent
>> (RequestHandler.java:407)
>> <+++.-.-.-.-.-.... Snip>
>> ---------------------------------------------------------------------
>> -
>> ------
>> ----
>>
>> 2006-08-08 11:22:58,700 (http-0.0.0.0-8443-Processor3) [
>> TransactionUtil.java:532:WARN ]
>> ---- exception report
>> ----------------------------------------------------------
>> WARNING: In setTransactionBeginStack a stack placeholder was
>> already in
>> place, here is the current location:
>> Exception: java.lang.Exception
>> Message: Current Stack Trace
>> ---- stack trace
>> ---------------------------------------------------------------
>> java.lang.Exception: Current Stack Trace
>> org.ofbiz.entity.transaction.TransactionUtil.setTransactionBeginStack
>> (
>> Transa
>> ctionUtil.java:531)
>> org.ofbiz.entity.transaction.TransactionUtil.setTransactionBeginStack
>> (
>> Transa
>> ctionUtil.java:525)
>> org.ofbiz.entity.transaction.TransactionUtil.begin
>> (TransactionUtil.java:111)
>> org.ofbiz.entity.transaction.TransactionUtil.begin
>> (TransactionUtil.java:57)
>> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:100)
>> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:82)
>> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
>> 553)
>> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
>> 620)
>> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
>> 181)
>> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
>> 188)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke
>> (ServiceEventHandler.java:2
>> 90)
>> org.ofbiz.webapp.control.RequestHandler.runEvent
>> (RequestHandler.java:407)
>> <+++.-.-.-.-.-.... Snip>
>> ---------------------------------------------------------------------
>> -
>> ------
>> ----
>>
>> 2006-08-08 11:22:58,710 (http-0.0.0.0-8443-Processor3) [
>> WfProcessMgrImpl.java:97 :INFO ] [WfProcessMgr.init] : Create process
>> manager (org.ofbiz.leadmgt[null] / processWf[null])
>> 2006-08-08 11:22:58,730 (http-0.0.0.0-8443-Processor3) [
>> ServiceDispatcher.java:564:DEBUG] [[ASync service failed...-
>> total:7.631,since last(ASync service sta...):7.631]] - 'leadmgt /
>> processWf'
>> 2006-08-08 11:22:58,730 (http-0.0.0.0-8443-Processor3) [
>> ServiceDispatcher.java:567:ERROR]
>> ---- exception report
>> ----------------------------------------------------------
>> Service [processWf] threw an unexpected exception/error
>> Exception: org.ofbiz.service.GenericServiceException
>> Message: Cannot resume transaction (Caller context is not an
>> unspecified
>> transaction context)
>> ---- stack trace
>> ---------------------------------------------------------------
>> org.ofbiz.service.GenericServiceException: Cannot resume
>> transaction (Caller
>> context is not an unspecified transaction context)
>> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:281)
>> org.ofbiz.workflow.WorkflowEngine.runAsync(WorkflowEngine.java:82)
>> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
>> 553)
>> org.ofbiz.service.ServiceDispatcher.runAsync(ServiceDispatcher.java:
>> 620)
>> org.ofbiz.service.GenericDispatcher.runAsync(GenericDispatcher.java:
>> 181)
>>
>>
>>
>>
>
> <WorkflowEngine.zip>