Hi everyone. There seems to be a lot of questions and frustration from many including myself on how best to debug one’s XPages Application.
I have decided to investigate online all possible debugging options that currently exist. As I find them I will list them in this Blog Post. By the end of this weekend I will be finalizing all collected data, and will create a Video Tutorial explaining and demonstrating the preferred methods of debugging. I will also contribute this video to David Leedy for his NotesIn9 Series.
What I am asking from the Community is to please add your 2 cents worth, by commenting on this Blog Post. If you have a better way of debugging XPages apps, or if you have further advice to give on existing findings, please join in and voice your thoughts and opinions.
Below is what I have so far.
Current Debugging Options:
1. Domino Debug Plugin on OpenNTF.org
2. Printing to Server Console using _dump and print() for Server Side JavaScript
3. Printing to Firebug Console for Client Side JavaScript.
4. Writing Log entries to OpenLog Database
Looking forward to your feedback.
Cheers,
John
I use the standard Java debugging for my Java code in managed beans and static methods, and I use the firebug debugger for csjs. Logging is important too, but I generally speaking the Java Debugger finds most issues.
Thanks Toby. Are you referring to the Java Stack Trace that usually appears on the page during a failed event?
No, I’m talking about the Java debugging tool that comes in eclipse, its detailed in this video/article by Niklas Heidloff.
http://www.openntf.org/blogs/openntf.nsf/d6plinks/NHEF-8CCDTQ
This is how I do it
I have a function in my ssjs code that will create a log document, this is similar to openlog but I store them in the same database. I have a seperate view in the database to show only the logdocs
I also have a custom control that will show all logdocs on the webpage I am working on that I show based on a setting in userprofile.
I put my log function in every catch
catch(e){
doLog(e)
}
Hi Thomas. Thanks for the Comment Post. So, this would be similar to the Domino Debug Plugin?
I am currently chatting with Nathan to see if Medusa can be brought back into Action. There might even be a chance to use the current version released. I am investigating this further.
As a novice at this, I am struggling to do any type of debugging.
I am using the Debug Toolbar but that doesn’t really do debugging without me putting in all sorts of code to record everything that is happening. It is nice to be able to see the various scope variables.
I have used computed fields in different places on pages just to see what the variables are doing but again that isn’t a great answer either.
I have used OpenLog as well but, again, that isn’t a great option either.
I am still trying to learn to use try…catch blocks everywhere but I have not created a doLog function like Thomas has so they don’t do much of anything for me yet.
Hi Roy. I think herein lies the drive to find the best possible way to debug XPages on all levels.
I was hoping for more feedback since I posted this yesterday, but maybe that proves the urgency to find a solution for everyone.
Let’s see what the next few days bring.
Cheers
Another useful set of tools are the custom controls Declan Lynch created way back for debugging the scope variables:
http://www.qtzar.com/blogs/qtzar.nsf/blog.xsp?entry=DSLH-7S7JUY&SessionID=CNPXS5A20I
For real debugging you should use Java.
Java as OSGi bundles deployed: http://www.youtube.com/watch?v=dchOyzjy9L4&list=UUtMIOCuOQtR4w5xoTT4-uDw&index=1&feature=plcp
Java in NSF: http://www.youtube.com/watch?v=1xczmvd1bs0&list=UUtMIOCuOQtR4w5xoTT4-uDw&index=16&feature=plcp
I agree with Niklas: real debugging can only be down using the Eclipse debugger from Java.
Since there isn’t a debugger for SSJS yet and I found it annoying to open the server console every time to view the results of print() statements, I created the XPage Debug Toolbar. It allows you to log messages to the toolbar instead of the server console (for SSJS and Java code) and shows the contents of the various scopes.
You can download it from OpenNTF: (http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPage%20Debug%20Toolbar).
Hi Mark. Thanks. I downloaded it last week, and will be testing it out soon enough.
I do have great news coming very soon for everyone