pillais1 / share-extras

Automatically exported from code.google.com/p/share-extras
0 stars 0 forks source link

MediaPreview: Preview stops working if a file is updated (via 'upload new version') #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Upload a MP4/FLV/AVI video file
2. Then, upload a new version of that file (for testing purposes may be 
identical)

What is the expected output? What do you see instead?
Expected: Preview of the new version
Instead: 
----
Error Code Information: 500 - An error inside the HTTP server which prevented 
it from fulfilling the request.
Error Message: 08200001 Failed to process template 
org/alfresco/components/preview/web-preview.get.html.ftl
----

What version of the add-on are you using? Please provide version of the
downloaded package, or Subversion revision number.
MediaPreview 0.2

What version of Alfresco are you using? On what application server?
3.4d on Linux, Tomcat 6

What web browser are you using? Please supply browser name and version.
Error occurs with FF 5/6 as well as IE 8 and Chrome (and I'm quite sure it's no 
browser thing)

Please provide any additional information below.

Whenever one uploads a new video file, preview works flawlessly. But as soon as 
this file gets updated in SHARE via 'upload a new version of this document', a 
HTTP 500 is raised and preview is broken.
I feel so free a to provide the full error stack below:

-------------------------------
Exception: freemarker.template.TemplateException - Expected collection or 
sequence. node.generatedPreviews evaluated instead to 
freemarker.template.SimpleHash on line 13, column 31 in 
org/alfresco/components/preview/web-preview.get.html.ftl.
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:190)
freemarker.core.Environment.visit(Environment.java:417)
freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.IfBlock.accept(IfBlock.java:82)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.Environment.process(Environment.java:190)
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process
(FTLTemplateProcessor.java:171)
org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(Abstr
actWebScript.java:589)
org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTempl
ate(DeclarativeWebScript.java:267)
org.springframework.extensions.webscripts.DeclarativeWebScript.execute(Declarati
veWebScript.java:147)
org.springframework.extensions.webscripts.PresentationContainer.executeScript(Pr
esentationContainer.java:69)
org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.execute
Script(LocalWebScriptRuntimeContainer.java:231)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(Abstract
Runtime.java:333)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(Abstract
Runtime.java:189)
org.springframework.extensions.webscripts.WebScriptProcessor.executeBody(WebScri
ptProcessor.java:284)
org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractPro
cessor.java:57)
org.springframework.extensions.surf.render.RenderService.processComponent(Render
Service.java:264)
org.springframework.extensions.surf.render.bean.ComponentRenderer.body(Component
Renderer.java:93)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRende
rer.java:75)
org.springframework.extensions.surf.render.RenderService.renderComponent(RenderS
ervice.java:600)
org.springframework.extensions.surf.render.RenderService.renderRegionComponents(
RenderService.java:539)
org.springframework.extensions.surf.render.RenderService.renderChromeInclude(Ren
derService.java:893)
org.springframework.extensions.webscripts.ChromeIncludeFreeMarkerDirective.execu
te(ChromeIncludeFreeMarkerDirective.java:71)
freemarker.core.Environment.visit(Environment.java:263)
freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.Environment.process(Environment.java:190)
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process
(FTLTemplateProcessor.java:171)
org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTe
mplateProcessor.java:345)
org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractPro
cessor.java:57)
org.springframework.extensions.surf.render.RenderService.processRenderable(Rende
rService.java:186)
org.springframework.extensions.surf.render.bean.ChromeRenderer.body(ChromeRender
er.java:89)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRende
rer.java:75)
org.springframework.extensions.surf.render.bean.ChromeRenderer.render(ChromeRend
erer.java:80)
org.springframework.extensions.surf.render.bean.RegionRenderer.body(RegionRender
er.java:92)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRende
rer.java:75)
org.springframework.extensions.surf.render.RenderService.renderRegion(RenderServ
ice.java:492)
org.springframework.extensions.webscripts.RegionFreemarkerTagDirective.execute(R
egionFreemarkerTagDirective.java:75)
freemarker.core.Environment.visit(Environment.java:263)
freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.Environment.visit(Environment.java:395)
freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.Macro$Context.runMacro(Macro.java:172)
freemarker.core.Environment.visit(Environment.java:603)
freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:210)
freemarker.core.Environment.process(Environment.java:190)
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process
(FTLTemplateProcessor.java:171)
org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTe
mplateProcessor.java:345)
org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractPro
cessor.java:57)
org.springframework.extensions.surf.render.RenderService.processTemplate(RenderS
ervice.java:378)
org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(Te
mplateInstanceRenderer.java:123)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRende
rer.java:75)
org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.j
ava:85)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRende
rer.java:75)
org.springframework.extensions.surf.render.RenderService.renderPage(RenderServic
e.java:408)
org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:388)
org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:329)
org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOut
putModel(AbstractWebFrameworkView.java:285)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:
1060)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.j
ava:798)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.ja
va:716)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet
.java:647)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552
)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:206)
org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFi
lter.java:74)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:206)
org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthentication
Filter.java:301)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
33)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
91)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Pr
otocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:619)
Exception: org.springframework.extensions.webscripts.WebScriptException - 
08200001 Failed to process template 
org/alfresco/components/preview/web-preview.get.html.ftl
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process
(FTLTemplateProcessor.java:175)

Original issue reported on code.google.com by florian....@googlemail.com on 20 Sep 2011 at 6:21

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by will.abson on 7 Nov 2011 at 2:29

GoogleCodeExporter commented 9 years ago
Hi Florian, I believe the cause of this is the getThumbnails repository-tier 
web script, which is actually part of the core repository, but is used here to 
determine which thumbnails are present.

Could you try hitting the URL 
http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/blah/c
ontent/thumbnails on your installation (assuming you are running on localhost), 
where workspace/SpacesStore/blah represents the nodeRef of a video file that 
you have uploaded.

If this is the same error as I see here then you should find that for 
non-versioned video items the script returns OK, but for versioned video items 
it returns an error.

Then if you get an error, then you should find you can suppress it by locating 
the file 
`WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/thumbnail
/thumbnails.get.json.ftl` inside the alfresco webapp and changing the line 
`<@thumbnailLib.thumbnailJSON node=node 
thumbnailName=thumbnail.properties.thumbnailName/>` to 
`<@thumbnailLib.thumbnailJSON node=node thumbnailName=thumbnail.name/>`

Please let me know what you see in your environment.

Original comment by will.abson on 23 Nov 2011 at 9:51

GoogleCodeExporter commented 9 years ago
Logged https://issues.alfresco.com/jira/browse/ALF-11671 upstream

Original comment by will.abson on 23 Nov 2011 at 10:27

GoogleCodeExporter commented 9 years ago
Hi Will,

thanks for your reply. Right now I found the time to give your solution a try 
and it worked. Changing the lines as you proposed worked like a charm.

Thanks again! 

Original comment by florian....@googlemail.com on 1 Dec 2011 at 2:57

GoogleCodeExporter commented 9 years ago
Issue has been fixed upstream

Original comment by will.abson on 17 Jul 2012 at 6:42