When you click to download a file, the error prompt is mainly reported. You can still download it, but since an error is thrown, go to find it. Finally, I found an error in the operation…
org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver : Failure while trying to resolve exception [org.springframework.http.converter.HttpMessageNotWritableException]
java.lang.IllegalStateException: COMPLETED
......
org.eclipse.jetty.server.HttpChannel : /file-api/downloadFile
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com..filepreview.entity.DataPackage] with preset Content-Type 'application/x-msdownload;charset=utf-8'
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-5.3.3.jar:5.3.3]
......
org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com..filepreview.entity.DataPackage] with preset Content-Type 'application/x-msdownload;charset=utf-8'
See the main tips:
Request processing failed; The nested exception is org.springframework.http.converter.httpmessagenotwritableexception: there is no converter for [class com. Filepreview. Entity. Datapackage] whose default content type is “applicationx msdownload”; Character set = UTF-8 ‘
So I see the keyword: datapackage, which is the encapsulated data return
The download file I thought of was actually a stream transmission, so I deleted this package and changed the method to void type
Abnormal output:
Normal after modification:
Similar Posts:
- Request processing failed; nested exception is java.lang.NullPointerException
- [Solved] Nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- [Solved] Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported
- [Solved] javax.servlet.jsp.JspTagException: Don’t know how to iterate over supplied “items” in xxx
- java.lang.OutOfMemoryError: GC overhead limit exceeded
- How to Solve Ajax Error 500 (Internal Server Error)
- Postman reported an error unsupported media type [How to Solve]
- [Solved] Upload Files Request processing failed;nested exception is org.springframework.web.multipart.MultipartException:Failed to parse multipart servlet request;multipart/form-data request failed.(**No permission**)
- [Solved] Springboot startup error: org.springframework.beans.factory.unsatisfieddependenceexception…
- Springboot startup error yamlexception/malformedinputexception input length = 1