Richtext字段导致DominoDocument.setValue()错误

时间:2012-05-25 11:41:25

标签: xpages lotus-domino xpages-ssjs

最近在使用richtext字段和ckeditor时,我在尝试运行提交richtext值的任何类型的操作时开始收到以下错误:

com.ibm.xsp.FacesExceptionEx: Notes exception thrown while calling DominoDocument.setValue() on field rt
at com.ibm.xsp.model.domino.wrapped.DominoDocument.setValue(DominoDocument.java:1465)
at com.ibm.xsp.el.PropertyResolverImpl.setValue(PropertyResolverImpl.java:206)
at com.sun.faces.el.impl.ArraySuffix.setValue(ArraySuffix.java:201)
at com.sun.faces.el.impl.ComplexValue.setValue(ComplexValue.java:180)
at com.sun.faces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:206)
at com.ibm.xsp.component.UIInputEx.updateModel(UIInputEx.java:573)
at javax.faces.component.UIInput.processUpdates(UIInput.java:484)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at com.ibm.xsp.component.UIDataPanelBase.processUpdates(UIDataPanelBase.java:351)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at com.ibm.xsp.component.UIDataPanelBase.processUpdates(UIDataPanelBase.java:351)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at com.ibm.xsp.component.UIDataPanelBase.processUpdates(UIDataPanelBase.java:351)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at com.ibm.xsp.component.UIDataPanelBase.processUpdates(UIDataPanelBase.java:351)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at com.ibm.xsp.component.UIDataPanelBase.processUpdates(UIDataPanelBase.java:351)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at com.ibm.xsp.component.UIDataPanelBase.processUpdates(UIDataPanelBase.java:351)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at com.ibm.xsp.component.UIDataPanelBase.processUpdates(UIDataPanelBase.java:351)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIForm.processUpdates(UIForm.java:222)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1244)
at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:406)
at com.ibm.xsp.component.UIViewRootEx._processUpdates(UIViewRootEx.java:1513)
at com.ibm.xsp.component.UIViewRootEx.processUpdates(UIViewRootEx.java:1492)
at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:98)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
at com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:250)
at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:223)
at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:200)
at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:137)
at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1267)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1251)
at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:598)
at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:421)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)
at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)

Caused by: NotesException: Note item not found
at lotus.domino.local.Document.closeMIMEEntities(Unknown Source)
at com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.closeMIMEEntities(DominoRichTextItem.java:2531)
at com.ibm.xsp.model.domino.wrapped.DominoDocument.getRichTextField(DominoDocument.java:1979)
at com.ibm.xsp.model.domino.wrapped.DominoDocument.createRTFieldWithValue(DominoDocument.java:1998)
at com.ibm.xsp.model.domino.wrapped.DominoDocument.setValue(DominoDocument.java:1382)
... 60 more

有谁知道什么可能导致这种行为?我有一个非常复杂的设计与扩展库的过度使用,这个错误在某些时候突然出现。我无法确定导致它的原因,因为它被我的日志代码部分遮盖,后者不必要地调用DominoDocument.getDocument(true)。

删除此调用后,此错误开始出现。将仲裁调用DominoDocument.getDocument(true)添加到随机'呈现'属性ssjs代码似乎可以部分解决这个问题(这是首先记录代码的地方)。

但这仍然是黑客,我想知道在开始时出了什么问题。

这似乎以某种方式连接到DominoRichTextItem的FieldValueHolder状态(其操作字段设置为REPLACE而不是ADD!?)

有人可以帮忙吗?

2 个答案:

答案 0 :(得分:1)

我找到了问题的根源。我看来,如果您从文档数据源中删除formName属性,则副作用是此异常并且消失了附件。

这个回归是在我的应用程序中引入的,同时添加了一些文档响应功能(表单是在事件中计算的,所以有人扔掉了formName属性)。更糟糕的是,附件的问题被调试代码中的一些getDocument(true)调用所掩盖。

如果xsp编译器提到formName是必需属性...

,那将是很好的

答案 1 :(得分:0)

如果你在一个不存在的文件上调用REPLACE,你会收到一个错误,并且在你删除代码以检查是否要渲染它之后会发生错误,真的听起来好像问题是文件没有存在。

你看过这个吗?使用富文本项的最简单方法就是将其绑定到字段

e.g.  value="#{dominoDoc.body}"

这可能并不总是可行,但它会解决自定义代码导致错误的问题。