AnsweredAssumed Answered

Alfresco colgado en Quartz job

Question asked by cybermakoki on Jun 15, 2010
Latest reply on Dec 22, 2011 by massanen_2296
Hola!

He seguido la mini-guia de scheduled actions para creame un quartz job que se ejecute cada hora…

Este es mi código:



public class MyJOB extends QuartzJobBean {     
   
   private ActionService actionService;
      private AuthenticationComponent authenticationComponent;
      private TransactionService transactionService;
      
      protected void executeInternal(JobExecutionContext jobContext) {
      
                               
         Authentication currentAuthentication = getAuthenticationComponent().getCurrentAuthentication();
         // authenticate as system user
         getAuthenticationComponent().setSystemUserAsCurrentUser();
         UserTransaction tx = null;
         try {
            tx = getTransactionService().getUserTransaction();
            tx.begin();

            Action myJobEx= getActionService().createAction(MyJOBExecuter.NAME);
          
            getActionService().executeAction(myJobEx, null);
           
           
           
         } catch (Throwable err) {
            err.printStackTrace();
            try {
               if (tx != null) {
                  tx.rollback();
               }
            } catch (Exception tex) {
            }
         } finally {
            // restore user security context
            getAuthenticationComponent().setCurrentAuthentication(currentAuthentication);
         }
      }


      public void setAuthenticationComponent(AuthenticationComponent authenticationComponent) {
         this.authenticationComponent = authenticationComponent;
      }


      public AuthenticationComponent getAuthenticationComponent() {
         return authenticationComponent;
      }


      public void setActionService(ActionService actionService) {
         this.actionService = actionService;
      }


      public ActionService getActionService() {
         return actionService;
      }


      public void setTransactionService(TransactionService transactionService) {
         this.transactionService = transactionService;
      }


      public TransactionService getTransactionService() {
         return transactionService;
      }
            
   

Resumiendo, al final lo que hace es mover un documento de una carpeta a otra en función de una propiedad.

La cosa es que aunq parece que ha terminado de ejecutar la acción, no lo hace y se queda colgado el servidor, no puedo hacer nada… tengo que pararlo y reiniciar…

Tiene que haber algún problema en el Job porque si ejecuto el action de forma manual funciona bien.

Alguna idea???

Muchas gracias de antemano! :)

Outcomes