{"action":"created","issue":{"url":"https://api.github.com/repos/tsgrp/OpenAnnotate/issues/133","repository_url":"https://api.github.com/repos/tsgrp/OpenAnnotate","labels_url":"https://api.github.com/repos/tsgrp/OpenAnnotate/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/tsgrp/OpenAnnotate/issues/133/comments","events_url":"https://api.github.com/repos/tsgrp/OpenAnnotate/issues/133/events","html_url":"https://github.com/tsgrp/OpenAnnotate/issues/133","id":134055296,"number":133,"title":"Some Documents throw multiple errors in OA on edge2","user":{"login":"gsteimer","id":1377228,"avatar_url":"https://avatars.githubusercontent.com/u/1377228?v=3","gravatar_id":"","url":"https://api.github.com/users/gsteimer","html_url":"https://github.com/gsteimer","followers_url":"https://api.github.com/users/gsteimer/followers","following_url":"https://api.github.com/users/gsteimer/following{/other_user}","gists_url":"https://api.github.com/users/gsteimer/gists{/gist_id}","starred_url":"https://api.github.com/users/gsteimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsteimer/subscriptions","organizations_url":"https://api.github.com/users/gsteimer/orgs","repos_url":"https://api.github.com/users/gsteimer/repos","events_url":"https://api.github.com/users/gsteimer/events{/privacy}","received_events_url":"https://api.github.com/users/gsteimer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tsgrp/OpenAnnotate/labels/Alfresco","name":"Alfresco","color":"009800"},{"url":"https://api.github.com/repos/tsgrp/OpenAnnotate/labels/Issue","name":"Issue","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"vachanta93","id":9847485,"avatar_url":"https://avatars.githubusercontent.com/u/9847485?v=3","gravatar_id":"","url":"https://api.github.com/users/vachanta93","html_url":"https://github.com/vachanta93","followers_url":"https://api.github.com/users/vachanta93/followers","following_url":"https://api.github.com/users/vachanta93/following{/other_user}","gists_url":"https://api.github.com/users/vachanta93/gists{/gist_id}","starred_url":"https://api.github.com/users/vachanta93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vachanta93/subscriptions","organizations_url":"https://api.github.com/users/vachanta93/orgs","repos_url":"https://api.github.com/users/vachanta93/repos","events_url":"https://api.github.com/users/vachanta93/events{/privacy}","received_events_url":"https://api.github.com/users/vachanta93/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/tsgrp/OpenAnnotate/milestones/4","html_url":"https://github.com/tsgrp/OpenAnnotate/milestones/2.5","labels_url":"https://api.github.com/repos/tsgrp/OpenAnnotate/milestones/4/labels","id":1586451,"number":4,"title":"2.5","description":"","creator":{"login":"gsteimer","id":1377228,"avatar_url":"https://avatars.githubusercontent.com/u/1377228?v=3","gravatar_id":"","url":"https://api.github.com/users/gsteimer","html_url":"https://github.com/gsteimer","followers_url":"https://api.github.com/users/gsteimer/followers","following_url":"https://api.github.com/users/gsteimer/following{/other_user}","gists_url":"https://api.github.com/users/gsteimer/gists{/gist_id}","starred_url":"https://api.github.com/users/gsteimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsteimer/subscriptions","organizations_url":"https://api.github.com/users/gsteimer/orgs","repos_url":"https://api.github.com/users/gsteimer/repos","events_url":"https://api.github.com/users/gsteimer/events{/privacy}","received_events_url":"https://api.github.com/users/gsteimer/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":3,"state":"open","created_at":"2016-02-16T18:12:53Z","updated_at":"2016-03-09T20:31:58Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-02-16T18:12:36Z","updated_at":"2016-03-09T20:31:58Z","closed_at":"2016-03-09T20:31:58Z","body":"I've seen this issue on a number of PDFs on Edge2.  When viewing the document in HPI, here's what I'm seeing:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1377228/13085876/0416119a-d4a6-11e5-88f3-14fa19d6c3d6.png)\r\n\r\nThe OC errors are (all have the same caused by):\r\n\r\n```\r\n12:05:19,388 ERROR [org.apache.pdfbox.pdmodel.PDPageNode] [ajp-apr-8009-exec-5] No Kids found in getAllKids(). Probably a malformed pdf.\r\n12:05:19,388 ERROR [com.tsgrp.opencontent.rest.RESTService] [ajp-apr-8009-exec-5] \r\ncom.tsgrp.opencontent.core.exception.OCRuntimeException: \r\n\tat com.tsgrp.opencontent.universal.annotation.XFDFAnnotationImpl.getInternalLinks(XFDFAnnotationImpl.java:1750)\r\n\tat sun.reflect.GeneratedMethodAccessor1438.invoke(Unknown Source)\r\n...\r\nCaused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0\r\n\tat java.util.ArrayList.rangeCheck(ArrayList.java:604)\r\n\tat java.util.ArrayList.get(ArrayList.java:382)\r\n\tat com.tsgrp.opencontent.universal.annotation.XFDFAnnotationImpl.getInternalLinks(XFDFAnnotationImpl.java:1635)\r\n\t... 42 more\r\n```\r\n\r\n```\r\n12:05:19,357 ERROR [org.apache.pdfbox.pdmodel.PDPageNode] [ajp-apr-8009-exec-11] No Kids found in getAllKids(). Probably a malformed pdf.\r\n12:05:19,357 ERROR [com.tsgrp.opencontent.rest.RESTService] [ajp-apr-8009-exec-11] \r\ncom.tsgrp.opencontent.core.exception.OCRuntimeException: \r\n\tat com.tsgrp.opencontent.universal.annotation.XFDFAnnotationImpl.getInternalLinks(XFDFAnnotationImpl.java:1750)\r\n\tat sun.reflect.GeneratedMethodAccessor1438.invoke(Unknown Source)\r\n```\r\n\r\n```\r\n12:05:18,732 ERROR [org.apache.pdfbox.pdmodel.PDPageNode] [ajp-apr-8009-exec-10] No Kids found in getAllKids(). Probably a malformed pdf.\r\n12:05:18,732 ERROR [com.tsgrp.opencontent.rest.RESTService] [ajp-apr-8009-exec-10] \r\njava.lang.NullPointerException\r\n\tat com.tsgrp.opencontent.universal.annotation.XFDFAnnotationImpl.parseBookmark(XFDFAnnotationImpl.java:2459)\r\n\tat com.tsgrp.opencontent.universal.annotation.XFDFAnnotationImpl.getBookmarks(XFDFAnnotationImpl.java:1497)\r\n\tat sun.reflect.GeneratedMethodAccessor1472.invoke(Unknown Source)\r\n```\r\n\r\nThoughts @m-brouillette @benallenallen ?\r\n\r\nHere are the links to some docs where I see this issue:\r\n\r\nhttp://edge2.tsgrp.com/hpi/Stage/controlleddocs/workspace://SpacesStore/f1787181-40a6-4728-a166-1597949ea66d%7Cworkspace://SpacesStore/85987124-dfaa-49d8-8a70-cc4589db0dbf\r\n\r\nhttp://edge2.tsgrp.com/hpi/Stage/controlleddocs/workspace://SpacesStore/bba614b7-e55d-4d2b-b543-13a48dcb0c98%7Cworkspace://SpacesStore/cc5fefb1-4442-4b12-9bd0-3a56a446f251\r\n\r\nhttp://edge2.tsgrp.com/hpi/Stage/controlleddocs/workspace://SpacesStore/bba614b7-e55d-4d2b-b543-13a48dcb0c98%7Cworkspace://SpacesStore/8a59af87-26cd-4bef-86ee-15708bc1e2cb"},"comment":{"url":"https://api.github.com/repos/tsgrp/OpenAnnotate/issues/comments/194494046","html_url":"https://github.com/tsgrp/OpenAnnotate/issues/133#issuecomment-194494046","issue_url":"https://api.github.com/repos/tsgrp/OpenAnnotate/issues/133","id":194494046,"user":{"login":"vachanta93","id":9847485,"avatar_url":"https://avatars.githubusercontent.com/u/9847485?v=3","gravatar_id":"","url":"https://api.github.com/users/vachanta93","html_url":"https://github.com/vachanta93","followers_url":"https://api.github.com/users/vachanta93/followers","following_url":"https://api.github.com/users/vachanta93/following{/other_user}","gists_url":"https://api.github.com/users/vachanta93/gists{/gist_id}","starred_url":"https://api.github.com/users/vachanta93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vachanta93/subscriptions","organizations_url":"https://api.github.com/users/vachanta93/orgs","repos_url":"https://api.github.com/users/vachanta93/repos","events_url":"https://api.github.com/users/vachanta93/events{/privacy}","received_events_url":"https://api.github.com/users/vachanta93/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T20:31:57Z","updated_at":"2016-03-09T20:31:57Z","body":"1) For the IndexOutOfBounds error in getWordMaps, it was causing problems for internal links and bookmarks as well. For some reason, PDFBox could not create or store the `PDDocument document` object correctly, so anything being retrieved from the `document` would not be returned correctly either. The reason might be because that particular document was PDF 1.4 version, but I can't know for sure.\r\n\r\nI added checks in all 3 methods so that they don't bomb if the `document` isn't right. It just returns empty page maps for getWordMaps, empty internalLinks list for getInternalLinks, or marks bookmarks as corrupt for parseBookmarks.\r\n\r\nRevision #14012 in OC trunk.\r\n\r\n2) The ClassCastException was because PDFBox has problems casting to PDStream objects for some documents.\r\n\r\nI added a try/catch block in getWordMaps that catches the ClassCastException and just goes to the next page without bombing.\r\n\r\nRevision #14013 in OC trunk.\r\n\r\nCR - Marc"}}