Today I got this fairly unknown error when trying to access a document with a XPage.
The runtime has encountered an unexpected error.
Error source
Page Name:/myXpage.xsp
Exception
java.lang.StringIndexOutOfBoundsException
java.lang.String.substring(String.java:1092)
com.ibm.xsp.model.domino.wrapped.DominoRichTextItem.insertNotesClientLinks852(DominoRichTextItem.java:387)
After doing a quick search on google I found a post on the IBM forums claiming this had to do with bad HTML markup within a Rich Text field.
Unfortunately this particular Document had tons of HTML, so it took some time narrowing it down. After some 30 mins I discovered the error was caused by a anchor tag where the href attribute was missing a " at the start...
Anyways.. problem solved!
March 10, 2011
March 9, 2011
Debugging tip:Error while executing JavaScript action expression
Occationally we stumble upon some "weird" errors on our xpages. Below is one such error:
Runtime Error
Script interpreter error, line=385, col=20: 'someJavaScriptMethod()' is undefined and cannot be accessed as an array
at [/someJavaScriptFile.js].methodOne()
at [/someJavaScriptFile.js].methodTwo()
at [/someJavaScriptFile.js].methodThree()
In this specific example it is indeed possible to access the method as an array. The clue here is someJavaScriptMethod(), with no parameters. In my code, line 385(correctly pointed out), the methodcall has several parameters. When the exception is displayed as this, it usually means that at least one of the input parameters is null. This should narrow your scope when searching for the error!
Happy debugging!
Runtime Error
Error source
Page Name:/someXPage.xspException
Error while executing JavaScript action expressionScript interpreter error, line=385, col=20: 'someJavaScriptMethod()' is undefined and cannot be accessed as an array
at [/someJavaScriptFile.js].methodOne()
at [/someJavaScriptFile.js].methodTwo()
at [/someJavaScriptFile.js].methodThree()
In this specific example it is indeed possible to access the method as an array. The clue here is someJavaScriptMethod(), with no parameters. In my code, line 385(correctly pointed out), the methodcall has several parameters. When the exception is displayed as this, it usually means that at least one of the input parameters is null. This should narrow your scope when searching for the error!
Happy debugging!
Etiketter:
Debugging,
Exception,
JavaScript,
XPages,
Xpages-debugging
March 1, 2011
Solved:Display picture from Rich Text Field with XPages

Im having a Form where I have a Rich Text Field(lets call it imageField) added there to hold an image. The user of the Form will directly copy an image into the imageField , not the location of the image, THE image will be copied into the field.
When I then later try to display this image on a Xpage nothing comes up..
Google wont help me with this particular problem either. Anyone out there know how to do this?
SOLVED:
As Ben over at My Comfy Chair pointed out this is in fact quite easy to solve.
Start by making the Rich Text Field save as HTML and MIME. After that you simply refer to the field in the src part of the img tag:
src=\"myView/"+itemInView.getDocument()+"/FieldName/M2?OpenElement"
Worked like a charm for me! Thanks alot Ben!
February 28, 2011
XPages:RedirectSignal - found the issue
A while back Rasmus reported an error constantly appearing in the logfiles on our servers. Read the entry here: http://devxpages.blogspot.com/2010/10/http-jvm-comibmxspaclredirectsignal.html
As written then, noone seemed to know why the RedirectSignal message appeared in the logs. Finally we have figured out whats the source of this weird and "unknown" message.
In some of our XPages files, xsp, we use a function context.redirectToPage() to forward the user to the desired page. A code example:
if (someCondition) {
return context.redirectToPage("myXpage1",false);
} else {
return context.redirectToPage("myXpage2",false);
}
Removing this code seems to solve the problem.. Finally!
As written then, noone seemed to know why the RedirectSignal message appeared in the logs. Finally we have figured out whats the source of this weird and "unknown" message.
In some of our XPages files, xsp, we use a function context.redirectToPage() to forward the user to the desired page. A code example:
if (someCondition) {
return context.redirectToPage("myXpage1",false);
} else {
return context.redirectToPage("myXpage2",false);
}
Removing this code seems to solve the problem.. Finally!
Etiketter:
Context.redirecttopage,
RedirectSignal,
XPages
October 28, 2010
[XPages] Tip When Using CKEditor On Site Behind IIS
A quick tip if you are building an XPages site that is placed behind IIS.
When you are using the CKEditor (default RichText editor in 8.5.2), remember to edit your plugin-cfg.xml to direct requests to "/ckeditor/*" to the Domino server.
This is achieved by adding a line to plugin-cfg-xml looking like this:
<Uri Name="/ckeditor/*" />
Hints that this is required include the faact that the rich text editor is not displayed and that your browser displays error messages like this:
For more info on the plugin-cfg.xml file and XPages, have a look here and here.
When you are using the CKEditor (default RichText editor in 8.5.2), remember to edit your plugin-cfg.xml to direct requests to "/ckeditor/*" to the Domino server.
This is achieved by adding a line to plugin-cfg-xml looking like this:
<Uri Name="/ckeditor/*" />
Hints that this is required include the faact that the rich text editor is not displayed and that your browser displays error messages like this:
For more info on the plugin-cfg.xml file and XPages, have a look here and here.
Subscribe to:
Posts (Atom)