Ticket #982 (closed Defect: fixed)
dm4-files: image file topics are not rendered with per-workspace filerepos active
Reported by: | Malte | Owned by: | |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.8.1 |
Component: | DeepaMehta Standard Distribution | Version: | 4.8 |
Keywords: | Cc: | jri | |
Complexity: | 3 | Area: | |
Module: | deepamehta-webclient |
Description
In 4.8.1 i think there is a new issue if the filerepo "per-workspace" setting is set to true/active.
After uploading and selcting the new file topic in the dm4-webclient the following exception appears in my dm4 terminal / at server-side.
SCHWERWIEGEND: Request "GET /filerepo/%2Fworkspace-210886%2F48.jpg" failed. Responding with 500 (Internal Server Error). The original exception/error is: java.lang.RuntimeException: An error occurred in the ResourceRequestFilterListener of plugin "DeepaMehta 4 Files" at de.deepamehta.core.impl.EventManager.dispatchEvent(EventManager.java:96) at de.deepamehta.core.impl.EventManager.fireEvent(EventManager.java:59) at de.deepamehta.core.impl.WebPublishingService.resourceRequestFilter(WebPublishingService.java:277) at de.deepamehta.core.impl.WebPublishingService.access$200(WebPublishingService.java:36) at de.deepamehta.core.impl.WebPublishingService$FileSystemHTTPContext.handleSecurity(WebPublishingService.java:371) at org.apache.felix.http.base.internal.context.ServletContextImpl.handleSecurity(ServletContextImpl.java:335) at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:337) at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:300) at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:93) at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:50) at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:31) at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:76) at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:49) at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:701) Caused by: java.lang.RuntimeException: Mapping repository path "//workspace-210886/48.jpg" to an absolute path failed at de.deepamehta.files.FilesPlugin.absolutePath(FilesPlugin.java:711) at de.deepamehta.files.FilesPlugin.resourceRequestFilter(FilesPlugin.java:466) at de.deepamehta.core.impl.CoreEvent$23.dispatch(CoreEvent.java:264) at de.deepamehta.core.impl.EventManager.dispatchEvent(EventManager.java:83) ... 36 more Caused by: java.lang.RuntimeException: No workspace recognized in repository path "//workspace-210886/48.jpg" at de.deepamehta.files.FilesPlugin.getWorkspaceId(FilesPlugin.java:884) at de.deepamehta.files.FilesPlugin.absolutePath(FilesPlugin.java:700) ... 39 more
This is probably cause by the files plugin custom renderer.
The request (for rendering a picture, this occurs when selecting an image file topic) includes the correct workspace id but it seems be issued with two subsequent "" at the beginning.
Can you confirm this?
Change History
comment:2 Changed 9 years ago by Malte
So, with the 4.8.1-SNAPSHOT version described above i can add the following observation:
In the per-workspace=false setting all my existing images in the filerepository are displayed correctly in the Page Panel, in Firefox and Chromium. The Image URL which shows an image follows exactly the same schema as above (http://localhost:8080/filerepo/%2Fimages%2Fbrandon_jordan_12-2.jpg).
comment:5 Changed 9 years ago by jri
You were right.
This bug was introduced 13 days ago with this commit: ticket:965#comment:7
Thanks for investigating!
So it seems to be a bit trickier than i thought, at the moment i can not reproduce the error.
What i can say is, with DeepaMehta 4.8 (per-workspace=on&off) i have no issue at all, neither in Firefox nor in Chromium on ubuntu.
Now when i am running on 4.8.1-SNAPSHOT (latest on "master", 12 days ago) i have problems on a few images in Chromium (per-workspace=true) but not all and in Firefox i cannot see a single image in the page panel (even not those who are rendered by chromium) while i have sessions as the very same user in both browsers. In this setting: Firefox: None, Chromium: Some.
In Firefox the "File Path" value of the topic is "/workspace-210886/WP_20160329_12_53_58_Pro.jpg" and the Request URL to the filerepo is: "GET http://localhost:8080/filerepo/%2Fworkspace-210886%2FWP_20160329_12_53_58_Pro.jpg [HTTP/1.1 500 Server Error 2ms]". That throws the same exception as above.
Please note: I switched the "per-workspace" settings during the development of a new version of the dm4-images plugin quite frequently and uploaded image files in both modes.
I will check the per-workspace=false option next and then everything again after a DB reset.