我的Alfresco 3.4.e共享应用程序存在问题。当您上传文件(例如PDF文件)时,其大小很大(在这种情况下为10MB),“浏览器预览文件”选项不起作用。窗口打开,正在处理文档,然后崩溃。 当您尝试预览像1mb文件这样的小文件时,您不会遇到任何问题。
我已经对这个问题进行了研究,显然,你可以修改“内容转换限制”。这是我提到的文档的链接:
https://wiki.alfresco.com/wiki/Content_Transformation_Limits
总而言之,您只需在“content-services-context.xml”文件和“thumbnail-services-context.xml”中设置属性即可。 以下是您必须设置的属性:
但是,例如在类"org.alfresco.repo.content.transform.magick.ImageTransformationOptions"
或类中没有这些属性存在
“org.alfresco.repo.content.transform.TextToPdfContentTransformer”。
当我们设置这些属性说它们不可写并且我查看了源代码并且它们根本就不存在时,我遇到了错误。
我有另一种理论,其中文件是为了被转换而复杂(超过100页,大量图像和样式......)。 以下是在文档转换和预览尝试后写入的错误日志:
ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 07060002 Wrapped Exception (with status template): 07060007 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js': 07060006 Content conversion failed:
reader: ContentAccessor[ contentUrl=store://2012/8/6/10/57/cd79670a-6210-4ce6-9af6-563d224c278f.bin, mimetype=application/pdf, size=20578433, encoding=utf-8, locale=fr_FR]
writer: ContentAccessor[ contentUrl=store://2012/8/6/15/9/d44c8099-06ac-4c8f-8021-edb8f48c838b.bin, mimetype=application/x-shockwave-flash, size=0, encoding=UTF-8, locale=fr]
options: org.alfresco.service.cmr.repository.TransformationOptions@4b10fe3f
org.springframework.extensions.webscripts.WebScriptException: 07060002 Wrapped Exception (with status template): 07060007 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js': 07060006 Content conversion failed:
reader: ContentAccessor[ contentUrl=store://2012/8/6/10/57/cd79670a-6210-4ce6-9af6-563d224c278f.bin, mimetype=application/pdf, size=20578433, encoding=utf-8, locale=fr_FR]
writer: ContentAccessor[ contentUrl=store://2012/8/6/15/9/d44c8099-06ac-4c8f-8021-edb8f48c838b.bin, mimetype=application/x-shockwave-flash, size=0, encoding=UTF-8, locale=fr]
options: org.alfresco.service.cmr.repository.TransformationOptions@4b10fe3f
at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:758)
at org.alfresco.repo.web.scripts.content.StreamContent.execute(StreamContent.java:202)
at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:383)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.alfresco.scripts.ScriptException: 07060007 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js': 07060006 Content conversion failed:
reader: ContentAccessor[ contentUrl=store://2012/8/6/10/57/cd79670a-6210-4ce6-9af6-563d224c278f.bin, mimetype=application/pdf, size=20578433, encoding=utf-8, locale=fr_FR]
writer: ContentAccessor[ contentUrl=store://2012/8/6/15/9/d44c8099-06ac-4c8f-8021-edb8f48c838b.bin, mimetype=application/x-shockwave-flash, size=0, encoding=UTF-8, locale=fr]
options: org.alfresco.service.cmr.repository.TransformationOptions@4b10fe3f
at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:194)
at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:282)
at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)
at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:981)
at org.alfresco.repo.web.scripts.content.StreamContent.execute(StreamContent.java:148)
... 24 more
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 07060006 Content conversion failed:
reader: ContentAccessor[ contentUrl=store://2012/8/6/10/57/cd79670a-6210-4ce6-9af6-563d224c278f.bin, mimetype=application/pdf, size=20578433, encoding=utf-8, locale=fr_FR]
writer: ContentAccessor[ contentUrl=store://2012/8/6/15/9/d44c8099-06ac-4c8f-8021-edb8f48c838b.bin, mimetype=application/x-shockwave-flash, size=0, encoding=UTF-8, locale=fr]
options: org.alfresco.service.cmr.repository.TransformationOptions@4b10fe3f
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:177)
at org.alfresco.repo.content.ContentServiceImpl.transform(ContentServiceImpl.java:555)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:125)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:160)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:137)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy42.transform(Unknown Source)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine.render(AbstractTransformationRenderingEngine.java:71)
at org.alfresco.repo.rendition.executer.AbstractRenderingEngine.executeRenditionImpl(AbstractRenderingEngine.java:497)
at org.alfresco.repo.rendition.executer.AbstractRenderingEngine$2.doWork(AbstractRenderingEngine.java:429)
at org.alfresco.repo.rendition.executer.AbstractRenderingEngine$2.doWork(AbstractRenderingEngine.java:410)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
at org.alfresco.repo.rendition.executer.AbstractRenderingEngine.executeImpl(AbstractRenderingEngine.java:409)
at org.alfresco.repo.rendition.executer.AbstractRenderingEngine.executeImpl(AbstractRenderingEngine.java:373)
at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:133)
at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:749)
at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:675)
at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:540)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:217)
at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:184)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:137)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy34.executeAction(Unknown Source)
at org.alfresco.repo.rendition.RenditionServiceImpl.executeRenditionAction(RenditionServiceImpl.java:233)
at org.alfresco.repo.rendition.RenditionServiceImpl.render(RenditionServiceImpl.java:182)
at org.alfresco.repo.thumbnail.ThumbnailServiceImpl.createThumbnailNode(ThumbnailServiceImpl.java:449)
at org.alfresco.repo.thumbnail.ThumbnailServiceImpl.access$000(ThumbnailServiceImpl.java:55)
at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$1.doWork(ThumbnailServiceImpl.java:146)
at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$1.doWork(ThumbnailServiceImpl.java:143)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
at org.alfresco.repo.thumbnail.ThumbnailServiceImpl.createThumbnail(ThumbnailServiceImpl.java:141)
at org.alfresco.repo.thumbnail.ThumbnailServiceImpl.createThumbnail(ThumbnailServiceImpl.java:120)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:178)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:137)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy111.createThumbnail(Unknown Source)
at org.alfresco.repo.jscript.ScriptNode.createThumbnail(ScriptNode.java:2410)
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.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
at org.mozilla.javascript.gen.c12._c1(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js:61)
at org.mozilla.javascript.gen.c12.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
at org.mozilla.javascript.gen.c12._c0(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js:101)
at org.mozilla.javascript.gen.c12.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
at org.mozilla.javascript.gen.c12.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js)
at org.mozilla.javascript.gen.c12.exec(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js)
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:472)
at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:190)
... 28 more
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 07060005 Transformation failed - status indicates an error:
Execution result:
os: Windows Server 2008 R2
command: [C:/Alfresco/swftools/pdf2swf.exe, -T, 9, -s, poly2bitmap,subpixels=72, C:\Alfresco\tomcat\temp\Alfresco\RuntimeExecutableContentTransformerWorker_source_1313428204114423249.pdf, -o, C:\Alfresco\tomcat\temp\Alfresco\RuntimeExecutableContentTransformerWorker_target_920011681678277152.swf]
succeeded: false
exit code: 1
out: NOTICE processing PDF page 1 (595x841:0:0) (move:0:0)
NOTICE File contains pbm pictures
NOTICE File contains jpeg pictures
NOTICE processing PDF page 2 (595x841:0:0) (move:0:0)
NOTICE processing PDF page 3 (595x841:0:0) (move:0:0)
NOTICE
err:
at org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker.transform(RuntimeExecutableContentTransformerWorker.java:272)
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.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy40.transform(Unknown Source)
at org.alfresco.repo.content.transform.ProxyContentTransformer.transformInternal(ProxyContentTransformer.java:68)
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:161)
... 125 more
如果你查看日志,问题可能会链接到pdf2swf
,因为高字节字符或特殊字符而导致崩溃。
所以,如果你们有任何想法......
提前致谢。
答案 0 :(得分:1)
即使您的版本中已实施限制,您的开箱即用安装也不应存在任何转换限制。因此,除非您有特别配置的限制,否则这可能不是导致问题的原因。
更有可能的是pdf2swf
无法处理您上传的文件。这似乎与您从日志中发布的堆栈跟踪一致,但请注意Alfresco将截断错误流。如果你真的想看到完整的错误,那就拿它给你的命令,并在命令提示符下以交互方式运行它。
您没有提到您安装的SWFTools版本,但这是一个很好的起点。您可以尝试更新版本或SVN快照,看看这是否有帮助。
最后,您还可以更改传递给pdf2swf
的命令行参数,但您需要进行一些研究,以便了解哪些参数最适合您将要使用的内容类型上传。
以下默认设置在Alfresco webapp内的文件alfresco/subsystems/thirdparty/default/swf-transform.properties
中设置,但您可以在自定义alfresco-global.properties
文件中覆盖它们。
# This option on pdf2swf improves the transformation of graphics-heavy pdfs. See ALF-3580.
# poly2bitmap improves the chances of successful transformation. On its own it reduces
# the resolution of embedded images. subpixels sets the dpi for embedded images.
# zoom introduced and -s added before each option (ALF-9417).
swf.encoder.params=-s zoom=72 -s ppmsubpixels=1 -s poly2bitmap=1 -s bitmapfonts=1
评论中引用的问题(在http://issues.alfresco.com上)也可能是有意义的。
答案 1 :(得分:1)
确定,
首先,谢谢你的所有答案! 这对我帮助很大。
确实,问题来自pdf2swf
。 Alfresco的默认配置不适合大PDF文件。我所拥有的那个包含太多丰富的字符,因此默认参数'swf-transform.properties'的配置:
swf.encoder.params=-s poly2bitmap,subpixels=72
被替换为:
swf.encoder.params=-s zoom=72 -s ppmsubpixels=1 -s poly2bitmap=1 -s bitmapfonts=1
现在我可以毫无问题地预览我的大PDF文件。
再次感谢您的帮助。
答案 2 :(得分:0)
如果你回顾一下wiki的第一行,你会注意到属性限制适用于企业版3.4.8或4.我不确定它是否适用于版本3.4.d.但是,在任何情况下,这都是重点。这些限制是在最近的版本中创建的,以避免从pdf2swf.exe中获得的错误,并将静态图像作为预览呈现,这可能不如常规Flash预览那么漂亮,但至少它会让你预览。该功能可能在3.4d中不可用,尽管可能在版本4中可用。
您遇到的真正问题是以下陈述(为了便于阅读,我将其缩短了一点):
C:/Alfresco/swftools/pdf2swf.exe, -T, 9, -s, poly2bitmap,subpixels=72, *C:\Alfresco\tomcat\temp\Alfresco\your_source_file.pdf*, -o, *C:\Alfresco\tomcat\temp\Alfresco\generated_flash_preview.swf*
您可能希望在命令行中输入该内容,并查看会发生什么。如果出现错误,您可能需要尝试使用不同版本的pdf2swf.exe。如果你没有收到错误并且转换得很好,你可能需要为Alfresco的Java堆分配更多的内存(参数-Xmx),确保你有足够的硬盘空间,当然,你有足够的物理RAM内存。