cancel
Showing results for 
Search instead for 
Did you mean: 

Pb copie de fichier dans un espace qui a une règle

kevin-56
Champ in-the-making
Champ in-the-making
Bonjour,

j'ai un soucis lors de la copie d'un fichier dans un espace qui possède une règle de contenu.

j'explique mon probleme :

1. Je possède 3 espaces : espace A,B et C
2. sur le A j'execute un script qui copie les fichiers importés dans B (et donc ceux-ci on l'aspect CopiedFrom)
3. Ensuite j'essaye de copier un fichier de B dans C (qui possède une règle de contenu) alfresco indique l'erreur ":Transaction didn't commit: nodeRef is a mandatory parameter"

Pourtant si je copie le meme fichier dans un espace sans règle, Sa fonctionne !!

j'ai essayé de modifié le fichier tomcat/webapps/alfresco/WEB-INF/classes/alfresco/model/contentModel.xml
dans l'aspect en changeant la propriété mantadory mais sans succès:
<aspect name="cm:copiedfrom">
         <title>Copied From</title>
         <properties>
            <property name="cm:source">
               <type>d:noderef</type>
               <protected>true</protected>
            [b]   <mandatory>false</mandatory>[/b]
               <multiple>false</multiple>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>false</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
         </properties>
      </aspect>

4.Ensuite pour chaque fichier entrant dans espace B j'execute un script pour supprimer cette aspect :
document.removeAspect("cm:copiedfrom");
Mais j'obtient la même erreur.

J'aurais besoin d'un petit coup de pouce
Merci d'avance !
7 REPLIES 7

cleseach
Star Contributor
Star Contributor
Il est souvent utile de connaître précisément l'erreur pour en déterminer la cause.
"Transaction didn't commit: nodeRef is a mandatory parameter", hors de tout contexte, n'est pas forcément utile.

1ère Action : poster les traces complètes;
2ème Action : donner les informations (déclencheur, action, etc.) sur la règle de contenu de C;
3ème Action : nous indiquer les éléments qui vous font penser que l'aspect "cm:copiedFrom" est responsable des problèmes que vous rencontrez.

Cordialement,

Charles Le Seac'h

kevin-56
Champ in-the-making
Champ in-the-making
1ère Action : poster les traces complètes :
10:49:52,853 ERROR [org.alfresco.web.ui.common.Utils] Impossible de coller l'�l�ment suite � une erreur syst�me :Transaction didn't commit: nodeRef is a man
javax.transaction.RollbackException: Transaction didn't commit: nodeRef is a mandatory parameter  
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:430)
        at org.alfresco.web.bean.clipboard.WorkspaceClipboardItem.paste(WorkspaceClipboardItem.java:311)
        at org.alfresco.web.bean.clipboard.ClipboardBean.performClipboardOperation(ClipboardBean.java:229)
        at org.alfresco.web.bean.clipboard.ClipboardBean.performPasteItems(ClipboardBean.java:158)
        at org.alfresco.web.bean.clipboard.ClipboardBean.pasteAll(ClipboardBean.java:121)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
        at javax.faces.component.UICommand.broadcast(UICommand.java:89)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
        at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: nodeRef is a mandatory parameter
        at org.alfresco.util.ParameterCheck.mandatory(ParameterCheck.java:48)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.exists(DbNodeServiceImpl.java:172)
        at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:241)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy3.exists(Unknown Source)
        at org.alfresco.repo.rule.RuleServiceImpl.checkForCopy(RuleServiceImpl.java:980)
        at org.alfresco.repo.rule.RuleServiceImpl.checkForCopy(RuleServiceImpl.java:1005)
        at org.alfresco.repo.rule.RuleServiceImpl.canExecuteRule(RuleServiceImpl.java:955)
        at org.alfresco.repo.rule.RuleServiceImpl.executePendingRule(RuleServiceImpl.java:888)
        at org.alfresco.repo.rule.RuleServiceImpl.executePendingRulesImpl(RuleServiceImpl.java:861)
        at org.alfresco.repo.rule.RuleServiceImpl.executePendingRules(RuleServiceImpl.java:834)
        at org.alfresco.repo.rule.RuleTransactionListener.beforeCommit(RuleTransactionListener.java:69)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:638)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:620)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:592)
        at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:48)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:821)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:637)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:624)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:307)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:420)
        … 33 more

2ème Action : donner les informations (déclencheur, action, etc.) sur la règle de contenu de C :
je créer un action pour tout contenu, envoyé un mail, mais n'importe quelle règle provoque cette erreur !!

3ème Action : nous indiquer les éléments qui vous font penser que l'aspect "cm:copiedFrom" est responsable des problèmes que vous rencontrez.
Si je copie un fichier contenu dans l'espace A vers C ça fonctionne !
Si je copie un fichier contenu dans B vers C ça ne fonctionne pas !
donc j'ai essayé de repérer la différence entre les fichiers contenu dans A et B et l'aspect cm:copiedFrom est appliqué au contenu dans B

cleseach
Star Contributor
Star Contributor
Mon "traces complètes" était peu explicite… Il est également nécessaire de connaître la version d'Alfresco utilisée.

Le ticket JIRA http://issues.alfresco.com/browse/ETWOONE-117 semble indiquer le même problème avec l'utilisation de l'aspect versionable. Est-ce également votre cas ?

kevin-56
Champ in-the-making
Champ in-the-making
la version d'alfresco utilisé est Alfresco community 2.9B
Je n'utilise pas l'aspect versionnable

cleseach
Star Contributor
Star Contributor
Je viens de prendre quelques minutes pour effectuer les tests suivants :

A, B et C sont trois espaces. C dispose une règle qui applique un aspect aux objets entrants.

Alfresco 2.2
  • Copie d'un document de A vers B

  • Copie d'un document de B vers C
Résultat : OK

Alfresco 2.9B
  • Copie d'un document de A vers B

  • Copie d'un document de B vers C
Résultat : OK

Alfresco 2.9B
  • Copie d'un document de A vers B

  • Suppression du document de A

  • Copie d'un document de B vers C
Résultat : KO

Alfresco 2.2
  • Copie d'un document de A vers B

  • Suppression du document de A

  • Copie d'un document de B vers C
Résultat : OK

Que devons-nous en conclure ?
Ne se rapproche-t-on pas du problème évoqué dans JIRA ?

kevin-56
Champ in-the-making
Champ in-the-making
Merci beaucoup d'avoir pris du temps pour mon problème.

En effet, c'est bien la suppression dans l'espace A qui provoque l'erreur dans la version 2.9B.
Comment puis je me procurer la 2.2 en version community ?

cleseach
Star Contributor
Star Contributor
La version 2.2 est une version entreprise (fortement recommandée dans le cadre d'une utilisation en production).
Sinon, il vous reste toujours les nightly builds Smiley Wink