Free Support Forum - groupdocs.com

Getting exception while uploading any file

I followed steps to use sample application and when i tried to upload any file from UI, it gives me this error. Used servlet example.


javax.servlet.ServletException: org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn’t contain a multipart/form-data or multipart/mixed stream, content type header is null
org.apache.catalina.connector.Request.parseParts(Request.java:2842)
org.apache.catalina.connector.Request.getParts(Request.java:2685)
org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1083)
com.groupdocs.viewer.samples.javaweb.servlet.UploadFileHandlerServlet.doGet(UploadFileHandlerServlet.java:26)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:169)
com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:232)

Hello,


Thank you for your inquiry.

We will investigate the issue and when we will have any news you will be notified.

Sorry for the inconvenience.

-------

Best regards,

Evgen Efimov


http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+

Hello,

We have checked our Servlet example for GroupDocs.Viewer for Java 2.14.0 version and on our side it works well, as you can see on the screenshot. Could you please describe step by step how you run this example and also please share with us next details:

- java version
- which web server you are using and its version

We will wait for your details.

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+

Hi Evgen,


I have downloaded servlet example from your website. Unzipped it and configure the project in Eclipse IDE. I only updated groupdocs.viewer.filePath in application.properties.
Then i tried to run, it gave that error.
I was able to access the index.jsp page, however after uploading any file it threw above mentioned exception.

Java Version - Java 8
Server - Apache Tomcat 8.0

Is there any other thing that i need to update in order to get this running.

Thanks,
Milan
Hello ,

Did you run the example via integral TomCat for Eclipse IDE or you used separate web server?We have tested our sample on separate web server and it works well.

If you use the separate server, then please archive it and share it with us, also will be useful if you share your build .war file. We will investigate these files to find a reason of the issue.

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+

I tested on a separate instance of Tomcat as well. Getting same error after clicking upload button.

However I also tried the Spring sample example and that worked well on the same server.

So I am doing my testing on that one. One thing that i noticed, it is showing only maximum of 2 pages of any document. Is there any configuration that i need to change to view all the pages or is it the limitation by trial version?

Thanks,
Milan
Hello Milan,

Yes you are right, if you use unlicensed version of the library, then you will see only 2 pages of the document . For using our library without restrictions , you should get trial license and enable it to application.properties file (groupdocs.viewer.licensePath parameter) .

To get trial license please follow this instruction .


If you will have more questions please feel free to contact us.

---------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+