cancel
Showing results for 
Search instead for 
Did you mean: 

IntermediateCatchEvent locked

7joeblack8
Champ in-the-making
Champ in-the-making
Hi,

I'm using Activiti Engine on Alfresco  4.2.e.

i'm using workflow without any problem since yesterday when i found a "locked" timer.

the timer in the table "act_ru_job" di postgres is the only row which has "lock_exp_time_" and "lock_owner_" populated.

Now the "conditions" to leave the timer are satisfied, but the task won't proceed. Alfresco log hasn't error.

I don't want to kill the workflow related to this task, i tried to restart alfresco but the lock is still there.

Is there a way to manage this error?

I add that the "rev_" column every 5 minutes keep growing: i've read here about an "optimistic" exception which would lead to similar situation, but i didn't get any suggestion.

any help would be appreciated!!

thanks!

6 REPLIES 6

trademak
Star Contributor
Star Contributor
If you have one Activiti Engine (and 1 Alfresco repository server) running, the timer job will be locked by the one job executor. It will try to execute the timer job and the next synchronous activities. If for some reason an error occurs it will be retried 3 times and then the job will not be retried automatically anymore. But in the description you provide it seems like the job executor is not executing the job, so it times out and then retries again.

Can you share your process definition? Do you really see no related information or error stacktraces appearing in the log?

Best regards,

7joeblack8
Champ in-the-making
Champ in-the-making
i see. i'll share saspo my definition, anyway i solved.
I simply temporarly deleted a file wich has to be found by the task to decide the "completion" to proceed.
Then i shutdown Alfresco.
At restart, the lock was gone!

Now i replaced the file…and i'm quite sure everything would go as planned.

Strange error…isn't it?

I'll be back soon with more details…

EDIT: i talked to early….the lock appears again. Now i see in the alfresco log that has got no errors but i can read the console.logs fired twice!

trademak…you suggest to manually start the Job Executor…how can i do that?
Is there a way to read in the postgres datatabase the double relation?

thanks

trademak
Star Contributor
Star Contributor
No, the job executor is started automatically with the Activiti Engine, so nothing you have to do for that. You only have one Alfresco Repository instance right? Is there a some logic in your process definition that takes some time to execute? Did you add some custom script logic? When do you see that the lock appears? How many instances of this process definition are you running? Just one, or multiple, and does it occur for every instance?

Best regards,

7joeblack8
Champ in-the-making
Champ in-the-making
Yes i confirm i got only one Alfresco instance and the workflow engine is only the one embedded. I've added my bpmn definition file.
I also confirm that Activiti doesn't complaints anything as i can see from my alfresco log.

After some other attempts i can say that the lock appears IF and only IF:

there's an active timer (so task outcome from "Alfresco Script Task" was "Reject" at least one time), which is looping every 2 hours, AND when it fires AND find the condition to set the "bpm_outcome" to "Approve" it moves to the next task "Verify Complete Doc" (which has similar debugging sentences…so i firstly thought to a double action of job executor but it really wasn't..) AND the javascript's sets again the outcome as "Approve" …. it dies.
Nothing happens, or appears any error in the logs.
The last thing i can see in alfresco log is originated here:

<javascript><activiti:string>logger.log('Task Controllo di completezza…')</activiti:string></javascript>

I can see the Job Executor retries every 5 minutes.
trademak, as u said before i desume it can't workout from here on, so Job Executor truly get no real error…or it would retry three times than stops and doens't loop again, while now it adds the "rev_" integer in db every time he re-fire up.

When the Job Executor retries, it rollbacks at the beginning of the event of the timer, because i now can easily manage to workout the lock this way:

i temporaly delete the Alfresco file that the "Alfresco Script Task" has to find in the task's javascript loop, so endend again with "Reject". Than after 5 minuts or the remaining of this 5 minutes from what i've just done, i got 2 hours to prepare my move cause i can see the lock has vanished: so i simply put back the file with the property "Incompleto" so i force the Reject the "Verify Complete Doc" task.

After 2 hours the "Alfresco Script Task" exit to gateway with "Approve", then the Next task doesn't go to endevent1 as expected.
Then everything works like a charm for the rest of the flow (except for the case the flow would return to timer-approve-approve point…).

The strange thing is that IF the workflow starts…first time timers starts found everything, and the property is the one it expected to close to endevent…it works like a charm (So Start-Approve-Approve-Endevent1).

I'm really stuck!

Thanks in advance and…happy 2014!!

7joeblack8
Champ in-the-making
Champ in-the-making
I discovered the exeption:

<code> Exception in thread "pool-19-thread-1160" org.alfresco.error.AlfrescoRuntimeException: 00024343 Failed to execute transaction-level behaviour public abstract void org.alfresco.repo.node.NodeServicePolicies$OnAddAspectPolicy.onAddAspect(org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.namespace.QName) in transaction 0dc3e855-a2a4-4b13-a39b-0a7dfd30ff3f
at org.alfresco.repo.policy.TransactionBehaviourQueue.execute(TransactionBehaviourQueue.java:257)
at org.alfresco.repo.policy.TransactionBehaviourQueue.beforeCommit(TransactionBehaviourQueue.java:134)
at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:737)
at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:717)
at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:683)
at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:95)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:927)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:737)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.IllegalArgumentException: Cannot pass null or empty values to constructor
at net.sf.acegisecurity.providers.dao.User.<init>(User.java:133)
at org.alfresco.repo.security.authentication.AuthenticationUtil.getDefaultUserDetails(AuthenticationUtil.java:147)
at org.alfresco.repo.security.authentication.AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.java:186)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:526)
at org.alfresco.repo.version.VersionableAspect.createVersionImpl(VersionableAspect.java:539)
at org.alfresco.repo.version.VersionableAspect.onAddAspect(VersionableAspect.java:390)
at sun.reflect.GeneratedMethodAccessor1033.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.alfresco.repo.policy.JavaBehaviour$JavaMethodInvocationHandler.invoke(JavaBehaviour.java:174)
at com.sun.proxy.$Proxy33.onAddAspect(Unknown Source)
at sun.reflect.GeneratedMethodAccessor424.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.alfresco.repo.policy.TransactionBehaviourQueue.execute(TransactionBehaviourQueue.java:245)
… 15 more
</code>

Found in catalina!! But still didn't get the point…:

<javascript>Caused by: java.lang.IllegalArgumentException: Cannot pass null or empty values to constructor</javascript>

What should i pass to avoid this exception? this exception is fired after the famous timer….it looks like a runas error…
Mmmm….maybe it's saying he has no "User" for the event next of my Service Task?
If it is so, i can set user with Delegate as common User Taks for Endevents?

After some research this is the part of User.java class which throws exception (line133):

<code> public User(String username, String password, boolean enabled,
128         boolean accountNonExpired, boolean credentialsNonExpired,
129         boolean accountNonLocked, GrantedAuthority[] authorities)
130         throws IllegalArgumentException {
131         if (((username == null) || "".equals(username)) || (password == null)
132             || (authorities == null)) {
133             throw new IllegalArgumentException(
134                 "Cannot pass null or empty values to constructor");
135         }</code>

Founded here: <javascript>http://www.docjar.org/html/api/net/sf/acegisecurity/providers/dao/User.java.html</javascript>

Thanks as usual…

7joeblack8
Champ in-the-making
Champ in-the-making
I ended up with a class javadelegate and give up the javascript, now everything's fine.

thanks for cooperation.