Quick-Tip: How to solve "NotesException: Note item not found"

Thursday, July 7, 2016 at 1:53 PM UTC

A colleague stumbled upon the exception above and asked me what to do. He had an XPage with some fields bound to a normal Notes document datasource named e.g. "foo". The fields were bound, too, e.g. "foo.myField". He experienced problems with a richtext control which also was bound to a field in the document to be created, e.g. "foo.myRichtext".

When he was trying to save the document the exception above occurred and was printed to the server's console. Strange thing: this occurred only on one server he used, not on his local development machine. But that's not the reason for the problem. Here is the full stacktrace:

07.07.2016 15:27:21   HTTP JVM: NotesException: Note item not found
07.07.2016 15:27:21   HTTP JVM: 	at lotus.domino.local.Document.closeMIMEEntities(Unknown Source)
07.07.2016 15:27:21   HTTP JVM: 	at com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.closeMIMEEntities(DominoRichTextItem.java:2730)
07.07.2016 15:27:21   HTTP JVM: 	at com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.updateRTMime(DominoRichTextItem.java:1748)
07.07.2016 15:27:21   HTTP JVM: 	at com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.updateRichTextItem(DominoRichTextItem.java:1567)
07.07.2016 15:27:21   HTTP JVM: 	at com.ibm.xsp.model.domino.wrapped.DominoDocument.applyChangesToDoc(DominoDocument.java:1812)
07.07.2016 15:27:21   HTTP JVM: 	at com.ibm.xsp.model.domino.wrapped.DominoDocument.applyChanges(DominoDocument.java:1764)
07.07.2016 15:27:21   HTTP JVM: 	at com.ibm.xsp.model.domino.wrapped.DominoDocument.save(DominoDocument.java:1157)

We found out that the datasource was missing the "formName" attribute which usually contains the name of the form for which the document is saved to. This obivously causes this error regarding MIME storage in richtext items.

So if you don't use another field binding like binding to a managed bean then you have to define the formName for your datasource.







Leave a comment right here