Error occurred when updating OpenOffice document for Zotero 2.0

I have just upgraded Zotero from version 1.0 to version 2.0.2, and opened an OpenOffice document that I had previously made with Zotero 1.0. The first time I attempted to edit a citation, Zotero said: "Your document must be permanently upgraded in order to work with Zotero 2.0b7 or later. It is recommended that you make a backup before proceeding. Are you sure you want to continue?"

I clicked OK, and the following error message appeared in a dialog box:

An error occurred communicating with Zotero:
java.jang.StringIndexOutOfBoundsException: String index out of range: -2
at java.lang.String.substring(String.java:1937)
at org.zotero.integration.ooo.ReferenceMark.getCode(ReferenceMark.java:243)

I clicked OK, and another dialog box appeared, saying: "Zotero experienced an error updating your document. fieldCode is null".

Creating a new document and adding a citation seems to work fine. Is there a way to work around this bug in order to update my documents to work with Zotero 2.0, or should I go back to Zotero 1.0?
  • We should be able to fix this in the plugin, but in the meantime see Debugging Broken Documents.
  • Thanks. Following the advice in "Debugging Broken Documents", I deleted the bibliography in a fresh backup copy of the document. Then when I tried to edit a citation, Zotero said "Your document must be permanently upgraded"; I clicked OK, and got no error. I then regenerated the bibliography and everything seems OK.

    (Other suggestions in "Debugging Broken Documents", which I tried first, didn't work. I tried copying and pasting the document content into a new document. When I then tried to edit a citation in the new document, Zotero said: "You must insert a citation before performing this operation." I tried switching to a different bibliography style, but got the same "StringIndexOutOfBoundsException" error message as in my comment above.)
  • I tried updating another document in the same way (by deleting the bibliography first), and got a different error, which required a different workaround. Why I tried to re-insert the bibliography, I got this message:
    An error occurred communicating with Zotero:
    java.lang.NullPointerException
    at org.zotero.integration.ooo.ReferenceMark.(ReferenceMark.java:69)
    at org.zotero.integration.ooo.Document.getFields(Document.java:277)
    It was followed by this message:
    Zotero experienced an error updating your document. fields is null
    I cut and pasted the second half of the document's contents into a new document, and was able to insert the bibliography into the original document without error. I then tried to find "the problematic citation" by cutting and pasting the second half of the text back into the original document, one page at a time, re-inserting the bibliography each time. I never found "the problematic citation", because this cutting-and-pasting operation seemed to correct the problem; now that I've pasted all the text back into the original document, I can insert the bibliography without error.
Sign In or Register to comment.