D.Bugger
D.Bugger

Reputation: 2359

XPages: ODA-SEVERE errors when using the OpenNTF API

Scenario:

Best case, the image is stored in the document. but cannot be seen when the document is reopened. Worst case, we get a load of messages, here's an excerpt:

2015-06-11T10:55:51 [SEVERE]: org.openntf.domino.impl.Document.closeMIMEEntities - closeMIMEEntities returned false for item Body on doc 12562 in db CN=titan/O=SEFIP!!aalto803.nsf
java.lang.Throwable
    at org.openntf.domino.impl.Document.closeMIMEEntities(Document.java:632)
    at com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.closeMIMEEntities(DominoRichTextItem.java:2722)
    at com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.updateRichTextItem(DominoRichTextItem.java:1565)
    at com.ibm.xsp.model.domino.wrapped.DominoDocument.applyChangesToDoc(DominoDocument.java:1812)
    at com.ibm.xsp.model.domino.wrapped.DominoDocument.applyChanges(DominoDocument.java:1764)
    at com.ibm.xsp.model.domino.wrapped.DominoDocument._getDocument(DominoDocument.java:649)
    at com.ibm.xsp.model.domino.wrapped.DominoDocument.getDocument(DominoDocument.java:643)
    at com.sefip.FieldData.evaluate(FieldData.java:334)
    at com.sefip.FieldData.computeHide(FieldData.java:105)
    at com.sefip.FormData.refresh(FormData.java:122)
    at sun.reflect.GeneratedMethodAccessor1863.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
...

The com.sefip code is mine. I need an updated document, in order to do some session.evaluate calls, so I have this:

Document doc = (Document)xspDoc.getDocument(true); 

Bug? In the API?

More info:

This is what happens when I update a document and add some rich text content, in this case with an image:

2015-06-12T17:30:20 [WARNING]: lotus.domino.local.NotesBase.CheckObject - null
NotesException: Object has been removed or recycled
    at lotus.domino.local.NotesBase.CheckObject(Unknown Source)
    at lotus.domino.local.MIMEEntity.getNthHeader(Unknown Source)
    at org.openntf.domino.impl.MIMEEntity.getNthHeader(MIMEEntity.java:534)
    at org.openntf.domino.impl.MIMEEntity.getNthHeader(MIMEEntity.java:1)
    at com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.getMimePartByDisposition(DominoRichTextItem.java:2535)

Upvotes: 2

Views: 282

Answers (1)

Paul Stephen Withers
Paul Stephen Withers

Reputation: 15729

When manipulating MIME items there are some gotchas in the core Domino code. If you check the help document "Working with a MIME entity in Java classes", it talks about calling Session.setConvertMIME(false) before accessing the MIME items, then Session.setConvertMIME(true) at the end of the code.

The good news is we can do all that for you. If you use org.openntf.domino.xsp=marcel (as in Marcel Marceau!), it will automatically set and unset the options for converting MIME.

If you already have other switches set, they can just be comma-delimited, e.g. org.openntf.domino.xsp=godmode,marcel,khan.

This presentation on slideshare gives an introduction of all the switches and a summary of the code structure http://www.slideshare.net/paulswithers1/openntf-domino-api

Upvotes: 2

Related Questions