[OpenVPMS Developers] [JIRA] Created: (OVPMS-945) DownloadServlet throws NPE if document has no mime type
Key: OVPMS-945 URL: https://openvpms.atlassian.net/browse/OVPMS-945 Project: VPMS Web Application Issue Type: Bug Components: General Affects Versions: 1.4 Reporter: Tim Anderson Assignee: Tony De Keizer Fix For: 1.5
If a document has no mime type, the following is thrown by DownloadServlet:
{noformat} java.lang.NullPointerException org.openvpms.web.servlet.DownloadServlet.serveDocument(DownloadServlet.java:164) org.openvpms.web.servlet.DownloadServlet.doGet(DownloadServlet.java:145) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292) org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:111) org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:71) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108) org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173) org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120) {noformat}
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://openvpms.atlassian.net/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________ OpenVPMS Developers Mailing List developers@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/developers Posts from this mailing list can be viewed online and replied to in the OpenVPMS Developer's forum- http://tinyurl.com/openvdf
[OpenVPMS Developers] [JIRA] Commented: (OVPMS-945) DownloadServ
Tim Anderson commented on OVPMS-945: ------------------------------------
A workaround is to assign a valid mime type to those documents without one. The following SQL will cover most documents: {noformat} update documents set mime_type="text/xml" where mime_type is null and name like "%.jrxml";
update documents set mime_type="text/plain" where mime_type is null and name like "%.txt";
update documents set mime_type="application/pdf" where mime_type is null and name like "%.pdf";
update documents set mime_type="application/msword" where mime_type is null and name like "%.doc";
update documents set mime_type="application/vnd.ms-excel" where mime_type is null and name like "%.xls";
update documents set mime_type="application/vnd.oasis.opendocument.text" where mime_type is null and name like "%.odt";
update documents set mime_type="text/html" where mime_type is null and name like "%.htm";
update documents set mime_type="text/html" where mime_type is null and name like "%.html"; {noformat}
Other document types will need to be updated accordingly
> DownloadServlet throws NPE if document has no mime type > ------------------------------------------------------- > > Key: OVPMS-945 > URL: https://openvpms.atlassian.net/browse/OVPMS-945 > Project: VPMS Web Application > Issue Type: Bug > Components: General > Affects Versions: 1.4 > Reporter: Tim Anderson > Assignee: Tony De Keizer > Fix For: 1.5 > > > If a document has no mime type, the following is thrown by DownloadServlet: > {noformat} > java.lang.NullPointerException > org.openvpms.web.servlet.DownloadServlet.serveDocument(DownloadServlet.java:164) > org.openvpms.web.servlet.DownloadServlet.doGet(DownloadServlet.java:145) > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292) > org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:111) > org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:71) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108) > org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173) > org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120) > {noformat}-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://openvpms.atlassian.net/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________ OpenVPMS Developers Mailing List developers@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/developers Posts from this mailing list can be viewed online and replied to in the OpenVPMS Developer's forum- http://tinyurl.com/openvdf
[OpenVPMS Developers] [JIRA] Issue Comment Edited: (OVPMS-945) D
Tim Anderson edited comment on OVPMS-945 at 5/12/10 1:35 AM: -------------------------------------------------------------
A workaround is to assign a valid mime type to those documents without one. The following SQL will cover most documents: {noformat} update documents set mime_type="text/xml" where mime_type is null and name like "%.jrxml";
update documents set mime_type="text/plain" where mime_type is null and name like "%.txt";
update documents set mime_type="application/pdf" where mime_type is null and name like "%.pdf";
update documents set mime_type="application/msword" where mime_type is null and name like "%.doc";
update documents set mime_type="application/vnd.ms-excel" where mime_type is null and name like "%.xls";
update documents set mime_type="application/vnd.oasis.opendocument.text" where mime_type is null and name like "%.odt";
update documents set mime_type="text/html" where mime_type is null and name like "%.htm";
update documents set mime_type="text/html" where mime_type is null and name like "%.html"; {noformat}
Other document types will need to be updated accordingly. They can be found by running: {noformat} select name from documents where mime_type is null {noformat}
was (Author: tanderson): A workaround is to assign a valid mime type to those documents without one. The following SQL will cover most documents: {noformat} update documents set mime_type="text/xml" where mime_type is null and name like "%.jrxml";
update documents set mime_type="text/plain" where mime_type is null and name like "%.txt";
update documents set mime_type="application/pdf" where mime_type is null and name like "%.pdf";
update documents set mime_type="application/msword" where mime_type is null and name like "%.doc";
update documents set mime_type="application/vnd.ms-excel" where mime_type is null and name like "%.xls";
update documents set mime_type="application/vnd.oasis.opendocument.text" where mime_type is null and name like "%.odt";
update documents set mime_type="text/html" where mime_type is null and name like "%.htm";
update documents set mime_type="text/html" where mime_type is null and name like "%.html"; {noformat}
Other document types will need to be updated accordingly
> DownloadServlet throws NPE if document has no mime type > ------------------------------------------------------- > > Key: OVPMS-945 > URL: https://openvpms.atlassian.net/browse/OVPMS-945 > Project: VPMS Web Application > Issue Type: Bug > Components: General > Affects Versions: 1.4 > Reporter: Tim Anderson > Assignee: Tony De Keizer > Fix For: 1.5 > > > If a document has no mime type, the following is thrown by DownloadServlet: > {noformat} > java.lang.NullPointerException > org.openvpms.web.servlet.DownloadServlet.serveDocument(DownloadServlet.java:164) > org.openvpms.web.servlet.DownloadServlet.doGet(DownloadServlet.java:145) > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292) > org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:111) > org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:71) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108) > org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173) > org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120) > {noformat}-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://openvpms.atlassian.net/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________ OpenVPMS Developers Mailing List developers@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/developers Posts from this mailing list can be viewed online and replied to in the OpenVPMS Developer's forum- http://tinyurl.com/openvdf
[OpenVPMS Developers] [JIRA] Commented: (OVPMS-945) DownloadServ
Tony De Keizer commented on OVPMS-945: --------------------------------------
The docloader is the main cause of this issue. It loads documents without a mimetype.
> DownloadServlet throws NPE if document has no mime type > ------------------------------------------------------- > > Key: OVPMS-945 > URL: https://openvpms.atlassian.net/browse/OVPMS-945 > Project: VPMS Web Application > Issue Type: Bug > Components: General > Affects Versions: 1.4 > Reporter: Tim Anderson > Assignee: Tony De Keizer > Fix For: 1.5 > > > If a document has no mime type, the following is thrown by DownloadServlet: > {noformat} > java.lang.NullPointerException > org.openvpms.web.servlet.DownloadServlet.serveDocument(DownloadServlet.java:164) > org.openvpms.web.servlet.DownloadServlet.doGet(DownloadServlet.java:145) > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292) > org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:111) > org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:71) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108) > org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173) > org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120) > {noformat}-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://openvpms.atlassian.net/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________ OpenVPMS Developers Mailing List developers@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/developers Posts from this mailing list can be viewed online and replied to in the OpenVPMS Developer's forum- http://tinyurl.com/openvdf
[OpenVPMS Developers] [JIRA] Commented: (OVPMS-945) DownloadServ
Tim Anderson commented on OVPMS-945: ------------------------------------
I suspect this is occurring if documents are loaded with the --byname switch. When loaded with --byid the correct mime type should be determined.
> DownloadServlet throws NPE if document has no mime type > ------------------------------------------------------- > > Key: OVPMS-945 > URL: https://openvpms.atlassian.net/browse/OVPMS-945 > Project: VPMS Web Application > Issue Type: Bug > Components: General > Affects Versions: 1.4 > Reporter: Tim Anderson > Assignee: Tony De Keizer > Fix For: 1.5 > > > If a document has no mime type, the following is thrown by DownloadServlet: > {noformat} > java.lang.NullPointerException > org.openvpms.web.servlet.DownloadServlet.serveDocument(DownloadServlet.java:164) > org.openvpms.web.servlet.DownloadServlet.doGet(DownloadServlet.java:145) > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292) > org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:111) > org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:71) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108) > org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220) > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) > org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173) > org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120) > {noformat}-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://openvpms.atlassian.net/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________ OpenVPMS Developers Mailing List developers@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/developers Posts from this mailing list can be viewed online and replied to in the OpenVPMS Developer's forum- http://tinyurl.com/openvdf