softwareloop / uploader-plus

An Alfresco uploader that prompts for metadata
GNU Lesser General Public License v3.0
41 stars 41 forks source link

on upload : file name already exists #118

Open mavidot opened 7 years ago

mavidot commented 7 years ago

In previous versions when uploading a file in a directory, if another file already have the same name Alfresco add a suffix like : "filename.txt" in "filename-1.txt"

In this version and in Alfresco 5.1.2, an error occured : ... Caused by: org.alfresco.service.cmr.model.FileExistsException: 04301337 The file or folder a.txt already exists ...

douglascrp commented 7 years ago

@mavidot Can you test it using the latest version?

mavidot commented 7 years ago

Hi @douglascrp and @yregaieg,

Sorry but the problem is still remaining with this latest version. Do you need more informations or details about this issue ?

yregaieg commented 7 years ago

@mavidot What version are you on ? It did the trick for EE 5.1.3.2 in my case (if I am not mistaken)

mavidot commented 7 years ago

@yregaieg as I said in my first comment, I'm in 5.1.2 EE.

yregaieg commented 7 years ago

@mavidot could you use chrome inpector to break-point at https://github.com/yregaieg/uploader-plus/blob/60600342e8b4b57f3d7177251db64507e93cdb43/surf/src/main/amp/web/components/uploader-plus/js/dnd-upload-plus.js#L164 and let me know what's the output you get when you call : JSON.stringify(fileInfo.uploadData); there ?

mavidot commented 6 years ago

@yregaieg the result of JSON.stringify(b.uploadData); is : "{"filedata":{},"filename":"Alfresco-ent51-BlueXML.lic","destination":null,"siteId":"swsdp","containerId":"documentLibrary","uploaddirectory":"/","majorVersion":false,"updateNodeRef":null,"description":"","overwrite":false,"thumbnails":"doclib","username":null,"updateNameAndMimetype":false}"

This is a screenshot of my browser debugger. dnd-l164

This is an other screenshot, a little bit down in the same file, with a breakpoint on "send" function (just before error happening) dnd-send

mavidot commented 6 years ago

Now migrated in 5.1.3 EE . And the issue is still there. This is the error stack :

09:50:09,280 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript: 03060016 Unexpected error occurred during upload of new content.
org.springframework.extensions.webscripts.WebScriptException: 03060016 Unexpected error occurred during upload of new content.
    at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1124)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
    at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:519)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:587)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:656)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:428)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210)
    at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.alfresco.module.aosmodule.service.ContextRootFilter.doFilter(ContextRootFilter.java:93)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.alfresco.repo.webdav.auth.BaseSSOAuthenticationFilter.doFilter(BaseSSOAuthenticationFilter.java:197)
    at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy363.doFilter(Unknown Source)
    at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.alfresco.web.app.servlet.WebScriptSSOAuthenticationFilter.doFilter(WebScriptSSOAuthenticationFilter.java:121)
    at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy363.doFilter(Unknown Source)
    at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.alfresco.web.app.servlet.WebscriptCookieAuthenticationFilter.doFilter(WebscriptCookieAuthenticationFilter.java:84)
    at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:132)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy363.doFilter(Unknown Source)
    at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.alfresco.service.cmr.model.FileExistsException: 0306118679 Le fichier ou dossier Nouveau Document Microsoft Word.doc existe d�j�
    at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.moveOrCopy(FileFolderServiceImpl.java:1220)
    at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.rename_aroundBody12(FileFolderServiceImpl.java:986)
    at org.alfresco.repo.model.filefolder.FileFolderServiceImpl$AjcClosure13.run(FileFolderServiceImpl.java:1)
    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:221)
    at org.alfresco.traitextender.AJExtender.localProceed(AJExtender.java:729)
    at org.alfresco.traitextender.AJProxyTrait.invoke(AJProxyTrait.java:86)
    at com.sun.proxy.$Proxy55.rename(Unknown Source)
    at org.alfresco.repo.virtual.bundle.VirtualFileFolderServiceExtension.rename(VirtualFileFolderServiceExtension.java:498)
    at sun.reflect.GeneratedMethodAccessor2361.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.alfresco.traitextender.SingletonExtensionFactory$TraiSingletontHandler.invoke(SingletonExtensionFactory.java:74)
    at com.sun.proxy.$Proxy369.rename(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.alfresco.traitextender.AJExtender.extendAroundAdvice(AJExtender.java:655)
    at org.alfresco.traitextender.RouteExtensions.ajc$inlineAccessMethod$org_alfresco_traitextender_RouteExtensions$org_alfresco_traitextender_AJExtender$extendAroundAdvice(RouteExtensions.java:1)
    at org.alfresco.traitextender.RouteExtensions.intercept(RouteExtensions.java:85)
    at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.rename(FileFolderServiceImpl.java:984)
    at sun.reflect.GeneratedMethodAccessor2360.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.alfresco.repo.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:136)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.model.filefolder.MLTranslationInterceptor.invoke(MLTranslationInterceptor.java:275)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityInterceptor.invoke(RMMethodSecurityInterceptor.java:352)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:256)
    at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:216)
    at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:171)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.model.filefolder.FilenameFilteringInterceptor.invoke(FilenameFilteringInterceptor.java:367)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy109.rename(Unknown Source)
    at org.alfresco.repo.forms.processor.node.ContentModelFormProcessor.processNamePropertyPersist(ContentModelFormProcessor.java:639)
    at org.alfresco.repo.forms.processor.node.ContentModelFormProcessor.processPropertyPersist(ContentModelFormProcessor.java:354)
    at org.alfresco.repo.forms.processor.node.ContentModelFormProcessor.persistNode(ContentModelFormProcessor.java:284)
    at org.alfresco.repo.forms.processor.node.NodeFormProcessor.internalPersist(NodeFormProcessor.java:296)
    at org.alfresco.repo.forms.processor.node.NodeFormProcessor.internalPersist(NodeFormProcessor.java:1)
    at org.alfresco.repo.forms.processor.FilteredFormProcessor.persist(FilteredFormProcessor.java:138)
    at org.alfresco.repo.forms.FormServiceImpl.saveForm(FormServiceImpl.java:145)
    at sun.reflect.GeneratedMethodAccessor2281.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityInterceptor.invoke(RMMethodSecurityInterceptor.java:352)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:201)
    at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:171)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy201.saveForm(Unknown Source)
    at org.alfresco.repo.forms.script.ScriptFormService.saveForm(ScriptFormService.java:159)
    at sun.reflect.GeneratedMethodAccessor2280.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
    at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
    at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
    at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_com_softwareloop_uploader_plus_upload_post_js_21._c_uploaderPlusMain_6(classpath*:alfresco/templates/webscripts/com/softwareloop/uploader-plus/upload.post.js:523)
    at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_com_softwareloop_uploader_plus_upload_post_js_21.call(classpath*:alfresco/templates/webscripts/com/softwareloop/uploader-plus/upload.post.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:74)
    at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_com_softwareloop_uploader_plus_upload_post_js_21._c_script_0(classpath*:alfresco/templates/webscripts/com/softwareloop/uploader-plus/upload.post.js:546)
    at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_com_softwareloop_uploader_plus_upload_post_js_21.call(classpath*:alfresco/templates/webscripts/com/softwareloop/uploader-plus/upload.post.js)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
    at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_com_softwareloop_uploader_plus_upload_post_js_21.call(classpath*:alfresco/templates/webscripts/com/softwareloop/uploader-plus/upload.post.js)
    at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_com_softwareloop_uploader_plus_upload_post_js_21.exec(classpath*:alfresco/templates/webscripts/com/softwareloop/uploader-plus/upload.post.js)
    at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:509)
    at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:207)
    at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:219)
    at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:181)
    at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:109)
    at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1376)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
    ... 70 more
SanjayBandhniya commented 3 years ago

Is File rename issue resolved? I am also facing same issue with alfresco 6.2 version.