I'm with difficulties integrating GroupDocs.Annotation with JavaServer Faces. I'm doing it with help of the source-code of GroupDocs.Annotation for Java Web sample project. I decided to use it, besides my project have Spring framework and Maven, because I don't use Spring MVC and don't want to add another framework in my project.
So, I'm using Maven project with some Servlets to integrate GroupDocs.Annotations with my project.
First, I make my GroupDocs.Annotation for Java Web sample project work alone with Tomcat. Then, I migrate most of the code to my personal project were I'm using JSF an XHTML on the frontend. I am getting AnnotationException when I open my XHTML wich contains the reference to show the Javascript code for header and body (initialization) to render the build-in viewer of GroupDocs.
What I've changed from the original Java Web sample project:
- The main package of the servlets and another files; so, on web.xml the servlet, servlet-mappings and AmosphereServlet configuration (Jersey base package) were changed
- Renamed application.properties to group-docs.properties
- I'm using a XHTML to render the viewer, not a JSP
- All library dependencies comes from Maven integration (pom.xml)
- The base AnnotationServlet (base of all servlets) were modified to be a service (but it is initialized with class instantiation, not a Spring servce)
- I'm not using IndexServlet to go to initial page. Instead, I'm changing the URL to http://localhost:8080/docflow/xhtml/docflow/visualizador/exemploGroupDocs.jsf, wich points to my exemploGroupDocs.xhtml file
- From my XHTML file, I call a JSF managed bean which instantiates AnnotationServlet and returns the Annotation Script and Header script.
- I'm getting com.groupdocs.annotation.exception.AnnotationException (with null cause) when trying to render a PDF for the first time.
My environment is:
- GroupDocs.Annotation 1.9.0
- Java JDK 1.7.0_45
- MS Windows 8.1
- JBoss AS 7.1.0
I'm attaching some files to give some information about how I coded it.