Free Support Forum - groupdocs.com

No annotation tools shown within demo application


#1

Hi there,


i just had a try with your demo app for the java web integration of GroupDocs.Annotation. I was able to build and deploy it successfully. However the app will only show a very basic viewer without any annotation tool or toolbar to be seen. I’m not at all familiar with all the parameters yet - i didn’t touch any of those.

For building and running the app i used the most recent GroupDocs.Annotation.jar found in the downloads area.

Does anyone of you have an idea as to what i’m missing here?

Thanks!

#2
Hello, Dominik!

Sorry to see you've got troubles like this. Can you tell what actually sample you were trying, what is your OS and what web application server you are using?

UPDATE:
Please, note. The Annotation toolbar is visible only when some document is opened. It will not appear at startup, when there are no document chosen.

#3

Hello, Ihor,


i used the example-project for GroupDocs.Annotation from the Download-Area - which, at that, remained pretty much “as-is”. Additionally, i’m using the most current and complete “GroupDocs.Annotation.jar” for bulding and running the app inside a Tomcat 7 servlet container (64Bit). I use Chrome, OS is Windows 7 64Bit

Although i am able to view a PDF file, there is no toolbar for actually annotating it. Running the app, i noticed a number of console messages concerning a AtmosphereServlet. I have attached theses messages below, maybe that’s a clue to you.

Thank you!

Dominik Brosius

-----------

Browser-Console:

Invoking executeWebSocket GetJsHandler?script=libs/atmosphere-min.js:958
Using URL: ws://localhost:8080/document-annotation/annotation?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.1.1-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&Content-Type=application%252Fjson&X-atmo-protocol=true GetJsHandler?script=libs/atmosphere-min.js:958
WebSocket connection to ‘ws://localhost:8080/document-annotation/annotation?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.1.1-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&Content-Type=application%252Fjson&X-atmo-protocol=true’ failed: Error during WebSocket handshake: Unexpected response code: 501 GetJsHandler?script=libs/atmosphere-min.js:267
Server closed the connection after a timeout GetJsHandler?script=GroupDocsAtmosphere.js:72
Websocket failed. Downgrading to Comet and resending GetJsHandler?script=libs/atmosphere-min.js:958
Websocket failed. Downgrading to Comet and resending GetJsHandler?script=libs/atmosphere-min.js:958
Atmosphere Chat. Default transport is WebSocket, fallback is long-polling GetJsHandler?script=GroupDocsAtmosphere.js:53
GET http://localhost:8080/document-annotation/annotation?X-Atmosphere-tracking-…ate=0&Content-Type=application%2Fjson&X-atmo-protocol=true&=1402566922721 500 (Internal Server Error) GetJsHandler?script=libs/atmosphere-min.js:576
Connection lost, trying to reconnect. Trying to reconnect 5000 GetJsHandler?script=GroupDocsAtmosphere.js:80
GET http://localhost:8080/document-annotation/annotation?X-Atmosphere-tracking-…ate=0&Content-Type=application%2Fjson&X-atmo-protocol=true&=1402566927744 500 (Internal Server Error) GetJsHandler?script=libs/atmosphere-min.js:576
Connection lost, trying to reconnect. Trying to reconnect 5000 GetJsHandler?script=GroupDocsAtmosphere.js:80
GET http://localhost:8080/document-annotation/annotation?X-Atmosphere-tracking-…ate=0&Content-Type=application%2Fjson&X-atmo-protocol=true&=1402566932770 500 (Internal Server Error) GetJsHandler?script=libs/atmosphere-min.js:576
Connection lost, trying to reconnect. Trying to reconnect 5000 GetJsHandler?script=GroupDocsAtmosphere.js:80
GET http://localhost:8080/document-annotation/annotation?X-Atmosphere-tracking-…ate=0&Content-Type=application%2Fjson&X-atmo-protocol=true&=1402566937789 500 (Internal Server Error) GetJsHandler?script=libs/atmosphere-min.js:576
Connection lost, trying to reconnect. Trying to reconnect 5000 GetJsHandler?script=GroupDocsAtmosphere.js:80
GET http://localhost:8080/document-annotation/annotation?X-Atmosphere-tracking-…ate=0&Content-Type=application%2Fjson&X-atmo-protocol=true&=1402566942808 500 (Internal Server Error) GetJsHandler?script=libs/atmosphere-min.js:576
Connection lost, trying to reconnect. Trying to reconnect 5000 GetJsHandler?script=GroupDocsAtmosphere.js:80
GET http://localhost:8080/document-annotation/annotation?X-Atmosphere-tracking-…ate=0&Content-Type=application%2Fjson&X-atmo-protocol=true&=1402566947829 500 (Internal Server Error) GetJsHandler?script=libs/atmosphere-min.js:576
Sorry, but there’s some problem with your socket or the server is down GetJsHandler?script=GroupDocsAtmosphere.js:76




#4

Thanks for a clue, it helped.


Seems you are using Spring sample and your browser does not support websockets. The Atmosphere in this case is falling back to long-polling and here it is blocked by the CORS filter.

To fix it, change next line in the com.groupdocs.filter.CorsFilter class:
        response.addHeader(“Access-Control-Allow-Origin”, “");

replace with
        if(StringUtils.isEmpty(request.getHeader(“origin”))) {
response.setHeader(“Access-Control-Allow-Origin”, "”);
}

#5

Hi Ihor,


thanks again for your support. However, unfortunately this didn’t solve the Problem - btw., i don’t have any coding to manipulate myself, other than the actual sample-code. I’m a bit at a loss here. Is there some config-parameter to be set beforehand?

Actually, i am using the example found here: http://github.com/groupdocs/groupdocs-annotation-java-web-sample.

Below is a stack-trace found in Tomcat’s localhost.log, that would appear for every one of the HTTP 500 responses i attached before (the ones from websocket-requests against"…/document-annotation/annotation").

Best regards,
Dominik


Servlet.service() for servlet [AtmosphereServlet] in context with path [/document-annotation] threw exception
org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler found. Make sure you define it inside WEB-INF/atmosphere.xml or annotate using @___Service
at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:118)
at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)
at org.atmosphere.container.BlockingIOCometSupport.service(BlockingIOCometSupport.java:63)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1790)
at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:201)
at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:169)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:232)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

#6
Hi, Dominik!

We a re sorry to see that you have such problem. We tried to reproduce the same situation, but without any luck. Have you precisely followed library installation and sample build guides?

I recommend you to download the latest version of GroupDocs.Annotataion for Java (v1.4 fro now) from here: http://groupdocs.com/Community/files/9/java-libraries/groupdocs_annotation_for_java/entry1547.aspx.
Then use this guide to install the downloaded library: http://groupdocs.com/docs/display/annotationjava/GroupDocs.Annotation+for+Java+-+Installation Next get sample code from the github repo (https://github.com/groupdocs/groupdocs-annotation-java-web-sample). Make sure you have latest commit in the master branch. And follow the README notes (https://github.com/groupdocs/groupdocs-annotation-java-web-sample/blob/master/README.md) to configure, build and deploy the application.

Also, we need more info on your environment. It would be easier us to help you if you provide following data:
  1. Open browser developer tools and make a screenshot or provide a listing of the requests history
  2. Java version
  3. Ant version
  4. Tomcat version
  5. What sample version you were using
  6. What GroupDocs.Annotation you are using: version and type (full or slim)
Most likely toolbar is absent because the request getCollaborators is not executed. It may be caused with the problem of Atmosphere work.
You can try next things:
  • turn off antivirus/firewall (things that can prevent the initialisation of Atmosphere)
  • start the application without context (in the root)
  • open it in the another browser
It would be the best if you could screen or make a video of what you are doing and when the problem appears.