DOC/DOCX preview by using Javascript and Java Libraries

Hi Saurabh,

Please share the details/errors you are getting while accessing http://localhost:8080/action.
Many Thanks

Hi Team ,


I am getting this error while loading viewer Controller.java .

Jul 15, 2016 4:50:45 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/viewer] threw exception [Request processing failed; nested exception is class com.groupdocs.viewer.internal.c.a.ms.a.f.p: DirectoryInfo was not created
com.groupdocs.viewer.internal.c.a.ms.a.f.c.jR(Unknown Source)
com.groupdocs.viewer.a.e.K(Unknown Source)
com.groupdocs.viewer.helper.d.saveFileData(Unknown Source)
com.groupdocs.viewer.helper.c.f(Unknown Source)
com.groupdocs.viewer.handler.ViewerHandler.a(Unknown Source)
com.groupdocs.viewer.handler.ViewerHandler.getDocumentInfo(Unknown Source)
com.viewer.controller.ViewerController.viewDoc(ViewerController.java:210)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Can you please help .

Hi Adarsh,


Thanks for sharing your experience.
In order to investigate your issue in details, We would like you to answer few questions.
  1. Are you trying to run our Showcase project?
  2. How you are mapping document-viewer.jsp from ViewerController.java?

We will appreciate your response.

Have a great weekend ahead.
Best Wishes

Hi Team,



Yes we are using Showcase project and we have imported the code from your repository itself.

But it seems , Code for Java lIbraries itself not correct and having many issues.

We are calling document.jsp from controller in the same way i mentioned in my earlier comment. But still it is not working .

Please help

Hi Saurabh,


Thanks for answering the question.
Yes we are using Showcase project and we have imported the code from your repository itself.
Unfortunately, we are not able to reproduce this issue at our end. Showcase project is working fine along with GroupDocs.Viewer for Java 3.x. Please find the attached screenshot.
However, in order to validate your scenario, we would like to know the steps you followed to run the Showcase project.
How you integrated GroupDocs.Viewer for Java 3.x API in the project?

Best Wishes

Hi Team,
We were followed these steps.
1)- Downloaded Group Docs 3.2.2 java libraries file
2) - Export the showcase project from git-hub with maven pom.xml
3) Updated settings.xml for dependency resolution according to our proxy settings.
First of all code base is same only but it is working on http://localhost:8080/viewer/action url not
http://localhost:8080/action URL .
And then it is not rendering the picture in our case stating this error in google chrome,
GetDocumentPageImage:1 GET http://localhost:8080/GetDocumentPageImage?path=D%3A%5CRNF%5CWorkspace%5CGr…true&useHtmlBasedEngine=false&rotate=false&width=603&pageindex=0&quality=0 404 (Not Found)
And in tomcat it is giving error below SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/viewer] threw exception [Request processing failed; nested exception is class com.groupdocs.viewer.internal.c.a.ms.a.f.p: DirectoryInfo was not created
com.groupdocs.viewer.internal.c.a.ms.a.f.c.jR(Unknown Source)
com.groupdocs.viewer.a.e.K(Unknown Source)
com.groupdocs.viewer.helper.d.saveFileData(Unknown Source)
com.groupdocs.viewer.helper.c.f(Unknown Source)
com.groupdocs.viewer.handler.ViewerHandler.a(Unknown Source)
com.groupdocs.viewer.handler.ViewerHandler.getDocumentInfo(Unknown Source)
com.viewer.controller.ViewerController.viewDoc(ViewerController.java:210)



Please see the attachment for detailed description.

Hi Adarsh,


We apologize, we cannot reproduce same issue at our end.
Please truly follow the given steps to integrate API in the project and run the project:
  1. Clone or download example project.
  2. In eclipse, go to file menu
  3. Press Import
  4. Expand maven, press Existing maven projects
  5. Import the downloaded/cloned project
  6. Now you can integrate GroupDocs.Viewer for Java 3.x in project by two ways: 1. Manually and 2. Installing using Maven
  7. If you go for manual integration, copy API (GroupDocs.Viewer for Java) here (C:\Users\username.m2\repository\com\groupdocs\groupdocs-viewer\3.2.2) and rename it according to pom.xml i.e. groupdocs-viewer-3.2.2
  8. Update maven project
  9. Run the project
Hope these steps will help you.

Kind Regards