SlideShare a Scribd company logo
STOP (DE)BUGGING ME!
Disclaimer
This session is only for people that
make errors.
All others can leave.
Agenda
 Debuggers in Designer
 Java debugger
 SSJS debugger

 XPage Debug Toolbar
Who’s that?
 Freelance consultant/ developer
 IBM Notes/ Domino
 XPages, web, client, mobile

 OpenNTF Board member & contributor
 Auto Logins
 XPage Multiple File Uploader
 XPage Debug Toolbar

 IBM Champion
 Bootstrap4XPages.com
Debugging in Designer
 For Java & SSJS (as of Designer 9)

 Based on standards
 Java Platform Debugger Architecture (JPDA)

 ‘Remote’ debugging
 Enable on server
 IDE (Designer/ Eclipse) connects to server on

specified port
Debugging in Designer
 Not recommended for productions servers
 Impacts performance & security
 Only 1 developer can connect at a time
 … but that’s not a problem

 … since we don’t debug applications on production

servers
Right?
Java debugger
 In Designer since 8.5
 Debug:
 Java classes
 Managed beans
 OSGi plugins
 Compiled XPages Java (Local/xsp folder)
Server Side JavaScript debugger
 New in Domino 9
 Configured and works (almost) the same as

the Java debugger
 Debug SSJS in
 XPages
 Custom controls
 SSJS libraries
Activating the debuggers - server
 Add configuration to notes.ini:
Add this row only if you
want to debug SSJS too

JavaEnableDebug=1
JavascriptEnableDebug=1
JavaDebugOptions=transport=dt_socket,server=y,suspend=n,address=8000

 Tip: if you click on the “Debug” icon in the

toolbar, you can copy-paste these settings from
there
Activating the debuggers - server
 Restart the server
 Watch for this:

 Port needs to be open(ed) in the firewall
 Works with local HTTP preview too
 Tip: If the local preview won’t start, try starting the
local HTTP task from a command prompt
 Run “nhttp preview” from your Notes folder
Activating the debugger - code
 Set breakpoints
 Right-click in gutter

 Add ‘debugger’ statement (SSJS)
 Don’t use this in Designer < 9 !

 Stop at first line of JavaScript code
Starting a debug session
 Click the triangle next to the “bug” icon

(this is Designer 9, icon looks slightly different in 8.5)
 Select an existing configuration or click “Manage…”
Starting a debug session - Java

Name for this configuration (can be any)

IP Address of your server

Port that the Debugger listens on
Starting a debug session - SSJS
 Demo
Debug perspective
 Designer automatically asks to open Debug perspective when

it suspends
 Breakpoint or ‘debugger’ statement in SSJS

 Change behaviour in Preferences > Run/Debug > Perspectives
 Tip: switch perspectives using Ctrl-F8 in Designer
Source not found?
Keyboard shortcuts





F5
F6
F7
F8

Step into
Step over
Step exit
Continue

F8

F5 F6 F7

 Strange issue with the F6 key
 With the default Designer/ Eclipse binding it doesn’t work
 If you create your own binding to F6 it does
 Do this in File > Preferences > Type “keys” in filter
Conditional breakpoints
 Set breakpoint

 Right-click on breakpoint
 Click “Breakpoint properties”
Partial refresh timeouts
 When you’re debugging your page may say:

 Increase timeout using JavaScript:
XSP.submitLatency = 600000;

//that’s 600 secs
Display view
 Window > Show Eclipse View > Display

 Run an expression in the context of a breakpoint
and view the result
 Only works with Java debugger
 With code completion
Expressions view
 Window > Show Eclipse View > Expressions

 Inspect the current state of objects
 2 ways to add:
 Right-click on expression in ‘Display’ view
 Type in manually
From SSJS to Java
 You can debug Java code when you’re

debugging SSJS code
 But NOT using “Step into” (F5)
 It will only stop on breakpoints in the Java class
Disconnect
 When you’re done: disconnect your debugging

session
 Java debugger

 SSJS debugger
XPage Debug Toolbar
Background/ features
 Debug tool for XPage developers

 Free download from OpenNTF
 Part of OpenNTF Essentials Toolkit
 Or download directly from GitHub

 Features
 Log debug messages
 View contents of scopes
 Log file reader
 API Inspector
Installation
 2 ways to install:
 Download from OpenNTF, copy to your application
 Use the OpenNTF Import/ export tool
Installation
 Add the ccDebugToolbar custom control to

your XPage
 Add the (dBar) managed bean
 (optionally) Change the default settings using
custom control properties
 collapseTo
 defaultCollapsed
 color
Components
ccDebugToolbar

Custom control

xpDebugToolbar

SSJS library

eu.linqed.debugtoolbar.DebugToolbar

Java class

eu.linqed.debugtoolbar.Message

Java class

debugToolbarConsole

XPage

optional

debugToolbarErrorPage

XPage

optional

dBar

Managed bean

Events

View

OpenLog integration

Event

Form

OpenLog integration
Scope contents
 Shows contents of
 applicationScope
 sessionScope
 viewScope

 requestScope

 Remove a variable
 Or clean an entire scope

 Modify values through the Inspector
Environment variables
 Information about the current:






User
Browser
Server
Database
Request

 Java heap size





Maximum heap size
Allocated
Used
Free
Inspector
 View classes for controls on the current page
 And change them

 View any variable:
 Scoped variables

 Managed beans
 Any XPage runtime object

 Drill-down to see what value/ object is returned
Messages
 Alternative to print() or _dump() functions
 No server console access needed
 Your messages only
 Makes your admin happy 

 Add messages using:
dBar.debug( “message” );
dBar.info( “message”);
dBar.warn( “message” );
dBar.error( “message” );
dBar.dump( <object> );
Messages
 Specify a context: dBar.info( “message”, “context” );
 dBar.error() function accepts ‘error’ objects:
try {

var doc:NotesDocument = null;
var id = doc.getUniversalID();
} catch (e) {
dBar.error(e);
}

 Add a divider to the messages list: dBar.addDivider();
Messages
 Add debug messages from Java:
DebugToolbar.get().info( “message” );
DebugToolbar.get().warn( “message” );

 Or catch an Exception
 DebugToolbar.get().error( e );
Log messages to documents
 Create log documents for all dBar calls

 All required code built-in
 Uses the OpenLog (form/fields) format
 Use the OpenLog database to view them

 Log level can be set: log only messages with a

certain log level (or ‘higher’)
 warn = warn + error
 debug = debug + info + warn + error
Log messages to documents
 Configure using managed properties
 logDbPath
 logEnabled
 logLevel

current, logdb.nsf
true, false
debug, info, warn, error

 Logging will continue even if the toolbar isn’t

displayed
Best practices
 Add [debug] role to the ACL
 Set loaded property of the ccDebugToolbar only for

[debug] role:
loaded=“#{javascript:context.getUser().getRoles().contains(‘[debug’]}”

 Enable logging to documents (errors/ warnings only)
logLevel = “warn”

 No design changes needed when moving to production
Resources
 XPage Debug Toolbar on OpenNTF & GitHub


http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocume
nt&name=XPage%20Debug%20Toolbar
 https://github.com/markleusink/XpageDebugToolbar

 OpenNTF Essentials


http://essentials.openntf.org

 OpenNTF Import/ export tool


http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocume
nt&name=Import%20and%20Export%20for%20Designer

 XPages OpenLog Logger


http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocume
nt&name=XPages%20OpenLog%20Logger

 OpenLog


http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocume
nt&name=OpenLog
Thank you !
 Twitter: markleusink

 Skype: mark_leusink
 Blog: http://linqed.eu
 Email: m.leusink@linqed.eu
 http://www.bootstrap4xpages.com

More Related Content

What's hot

Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
Michael Haberman
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
Knoldus Inc.
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android Applications
Rody Middelkoop
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
Arulalan T
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made Easy
Ankit Goel
 
Selenium training
Selenium trainingSelenium training
Selenium trainingRobin0590
 
Selenium
SeleniumSelenium
Seleniumnil65
 
iOS Unit Testing
iOS Unit TestingiOS Unit Testing
iOS Unit Testing
sgleadow
 
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
Andrey Karpov
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
Amr E. Mohamed
 
Selenium Interview Questions & Answers
Selenium Interview Questions & AnswersSelenium Interview Questions & Answers
Selenium Interview Questions & Answers
Techcanvass
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Ortus Solutions, Corp
 
Klement_0902_v2F (complete article)
Klement_0902_v2F (complete article)Klement_0902_v2F (complete article)
Klement_0902_v2F (complete article)Mike Friehauf
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
Adam Siton
 
We continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShellWe continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShell
PVS-Studio
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Agile Testing Alliance
 
Functional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersFunctional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and Testers
Aurélien Pupier
 

What's hot (20)

Selenium Handbook
Selenium HandbookSelenium Handbook
Selenium Handbook
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android Applications
 
Qtp
QtpQtp
Qtp
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made Easy
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Selenium
SeleniumSelenium
Selenium
 
Unit Testing in iOS
Unit Testing in iOSUnit Testing in iOS
Unit Testing in iOS
 
iOS Unit Testing
iOS Unit TestingiOS Unit Testing
iOS Unit Testing
 
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Selenium Interview Questions & Answers
Selenium Interview Questions & AnswersSelenium Interview Questions & Answers
Selenium Interview Questions & Answers
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
 
Klement_0902_v2F (complete article)
Klement_0902_v2F (complete article)Klement_0902_v2F (complete article)
Klement_0902_v2F (complete article)
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
 
We continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShellWe continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShell
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
 
Functional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersFunctional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and Testers
 

Similar to Stop (de)bugging me!

.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
Bala Subra
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
Bala Subra
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
Zeeshan MIrza
 
Debugging in .Net
Debugging in .NetDebugging in .Net
Debugging in .Net
Muhammad Amir
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
Dan Hinojosa
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging System
William Lee
 
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdfDifferent Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
pCloudy
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
Alon Fliess
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Tech OneStop
 
Whats New in MSBuild 3.5 and Team Build 2008
Whats New in MSBuild 3.5 and Team Build 2008Whats New in MSBuild 3.5 and Team Build 2008
Whats New in MSBuild 3.5 and Team Build 2008wbarthol
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)
Mikkel Flindt Heisterberg
 
Newgenlib
NewgenlibNewgenlib
Newgenlib
Shiba Bhue
 
Newgenlib
NewgenlibNewgenlib
Newgenlib
Shiba Bhue
 
Install NewGenLib on Windows XP
Install NewGenLib on Windows XPInstall NewGenLib on Windows XP
Install NewGenLib on Windows XP
Rupesh Kumar
 
Android develop guideline
Android develop guidelineAndroid develop guideline
Android develop guideline
Kan-Han (John) Lu
 
Understanding IDEs
Understanding IDEsUnderstanding IDEs
Understanding IDEs
sunmitraeducation
 
Dsplab v1
Dsplab v1Dsplab v1
Dsplab v1
wladimir1988
 

Similar to Stop (de)bugging me! (20)

.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
 
Debugging in .Net
Debugging in .NetDebugging in .Net
Debugging in .Net
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
myslide1
myslide1myslide1
myslide1
 
myslide6
myslide6myslide6
myslide6
 
NewSeriesSlideShare
NewSeriesSlideShareNewSeriesSlideShare
NewSeriesSlideShare
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging System
 
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdfDifferent Techniques Of Debugging Selenium Based Test Scripts.pdf
Different Techniques Of Debugging Selenium Based Test Scripts.pdf
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
 
Whats New in MSBuild 3.5 and Team Build 2008
Whats New in MSBuild 3.5 and Team Build 2008Whats New in MSBuild 3.5 and Team Build 2008
Whats New in MSBuild 3.5 and Team Build 2008
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)
 
Newgenlib
NewgenlibNewgenlib
Newgenlib
 
Newgenlib
NewgenlibNewgenlib
Newgenlib
 
Install NewGenLib on Windows XP
Install NewGenLib on Windows XPInstall NewGenLib on Windows XP
Install NewGenLib on Windows XP
 
Android develop guideline
Android develop guidelineAndroid develop guideline
Android develop guideline
 
Understanding IDEs
Understanding IDEsUnderstanding IDEs
Understanding IDEs
 
Dsplab v1
Dsplab v1Dsplab v1
Dsplab v1
 

More from Mark Leusink

Now what can you really build with DQL and web components?
Now what can you really build with DQL and web components?Now what can you really build with DQL and web components?
Now what can you really build with DQL and web components?
Mark Leusink
 
ICON UK 2016: Modernizing an IBM Notes applicaton using with AngularJS
ICON UK 2016: Modernizing an IBM Notes applicaton using with AngularJSICON UK 2016: Modernizing an IBM Notes applicaton using with AngularJS
ICON UK 2016: Modernizing an IBM Notes applicaton using with AngularJS
Mark Leusink
 
Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)
Mark Leusink
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Mark Leusink
 
A 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersA 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developers
Mark Leusink
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinar
Mark Leusink
 
Get the best out of Bootstrap with Bootstrap4XPages - Engage 2014
Get the best out of Bootstrap with Bootstrap4XPages - Engage 2014Get the best out of Bootstrap with Bootstrap4XPages - Engage 2014
Get the best out of Bootstrap with Bootstrap4XPages - Engage 2014
Mark Leusink
 
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Mark Leusink
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)
Mark Leusink
 
Introduction to Bootstrap (with XPages)
Introduction to Bootstrap (with XPages)Introduction to Bootstrap (with XPages)
Introduction to Bootstrap (with XPages)
Mark Leusink
 
Stop (de)bugging me - ICON UK 2013
Stop (de)bugging me - ICON UK 2013Stop (de)bugging me - ICON UK 2013
Stop (de)bugging me - ICON UK 2013
Mark Leusink
 

More from Mark Leusink (12)

Now what can you really build with DQL and web components?
Now what can you really build with DQL and web components?Now what can you really build with DQL and web components?
Now what can you really build with DQL and web components?
 
ICON UK 2016: Modernizing an IBM Notes applicaton using with AngularJS
ICON UK 2016: Modernizing an IBM Notes applicaton using with AngularJSICON UK 2016: Modernizing an IBM Notes applicaton using with AngularJS
ICON UK 2016: Modernizing an IBM Notes applicaton using with AngularJS
 
Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
A 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersA 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developers
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinar
 
Get the best out of Bootstrap with Bootstrap4XPages - Engage 2014
Get the best out of Bootstrap with Bootstrap4XPages - Engage 2014Get the best out of Bootstrap with Bootstrap4XPages - Engage 2014
Get the best out of Bootstrap with Bootstrap4XPages - Engage 2014
 
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)
 
Introduction to Bootstrap (with XPages)
Introduction to Bootstrap (with XPages)Introduction to Bootstrap (with XPages)
Introduction to Bootstrap (with XPages)
 
Stop (de)bugging me - ICON UK 2013
Stop (de)bugging me - ICON UK 2013Stop (de)bugging me - ICON UK 2013
Stop (de)bugging me - ICON UK 2013
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 

Stop (de)bugging me!

  • 2. Disclaimer This session is only for people that make errors. All others can leave.
  • 3. Agenda  Debuggers in Designer  Java debugger  SSJS debugger  XPage Debug Toolbar
  • 4. Who’s that?  Freelance consultant/ developer  IBM Notes/ Domino  XPages, web, client, mobile  OpenNTF Board member & contributor  Auto Logins  XPage Multiple File Uploader  XPage Debug Toolbar  IBM Champion  Bootstrap4XPages.com
  • 5. Debugging in Designer  For Java & SSJS (as of Designer 9)  Based on standards  Java Platform Debugger Architecture (JPDA)  ‘Remote’ debugging  Enable on server  IDE (Designer/ Eclipse) connects to server on specified port
  • 6. Debugging in Designer  Not recommended for productions servers  Impacts performance & security  Only 1 developer can connect at a time  … but that’s not a problem  … since we don’t debug applications on production servers Right?
  • 7. Java debugger  In Designer since 8.5  Debug:  Java classes  Managed beans  OSGi plugins  Compiled XPages Java (Local/xsp folder)
  • 8. Server Side JavaScript debugger  New in Domino 9  Configured and works (almost) the same as the Java debugger  Debug SSJS in  XPages  Custom controls  SSJS libraries
  • 9. Activating the debuggers - server  Add configuration to notes.ini: Add this row only if you want to debug SSJS too JavaEnableDebug=1 JavascriptEnableDebug=1 JavaDebugOptions=transport=dt_socket,server=y,suspend=n,address=8000  Tip: if you click on the “Debug” icon in the toolbar, you can copy-paste these settings from there
  • 10. Activating the debuggers - server  Restart the server  Watch for this:  Port needs to be open(ed) in the firewall  Works with local HTTP preview too  Tip: If the local preview won’t start, try starting the local HTTP task from a command prompt  Run “nhttp preview” from your Notes folder
  • 11. Activating the debugger - code  Set breakpoints  Right-click in gutter  Add ‘debugger’ statement (SSJS)  Don’t use this in Designer < 9 !  Stop at first line of JavaScript code
  • 12. Starting a debug session  Click the triangle next to the “bug” icon (this is Designer 9, icon looks slightly different in 8.5)  Select an existing configuration or click “Manage…”
  • 13. Starting a debug session - Java Name for this configuration (can be any) IP Address of your server Port that the Debugger listens on
  • 14. Starting a debug session - SSJS
  • 16. Debug perspective  Designer automatically asks to open Debug perspective when it suspends  Breakpoint or ‘debugger’ statement in SSJS  Change behaviour in Preferences > Run/Debug > Perspectives  Tip: switch perspectives using Ctrl-F8 in Designer
  • 18. Keyboard shortcuts     F5 F6 F7 F8 Step into Step over Step exit Continue F8 F5 F6 F7  Strange issue with the F6 key  With the default Designer/ Eclipse binding it doesn’t work  If you create your own binding to F6 it does  Do this in File > Preferences > Type “keys” in filter
  • 19. Conditional breakpoints  Set breakpoint  Right-click on breakpoint  Click “Breakpoint properties”
  • 20. Partial refresh timeouts  When you’re debugging your page may say:  Increase timeout using JavaScript: XSP.submitLatency = 600000; //that’s 600 secs
  • 21. Display view  Window > Show Eclipse View > Display  Run an expression in the context of a breakpoint and view the result  Only works with Java debugger  With code completion
  • 22. Expressions view  Window > Show Eclipse View > Expressions  Inspect the current state of objects  2 ways to add:  Right-click on expression in ‘Display’ view  Type in manually
  • 23. From SSJS to Java  You can debug Java code when you’re debugging SSJS code  But NOT using “Step into” (F5)  It will only stop on breakpoints in the Java class
  • 24. Disconnect  When you’re done: disconnect your debugging session  Java debugger  SSJS debugger
  • 26. Background/ features  Debug tool for XPage developers  Free download from OpenNTF  Part of OpenNTF Essentials Toolkit  Or download directly from GitHub  Features  Log debug messages  View contents of scopes  Log file reader  API Inspector
  • 27. Installation  2 ways to install:  Download from OpenNTF, copy to your application  Use the OpenNTF Import/ export tool
  • 28. Installation  Add the ccDebugToolbar custom control to your XPage  Add the (dBar) managed bean  (optionally) Change the default settings using custom control properties  collapseTo  defaultCollapsed  color
  • 29. Components ccDebugToolbar Custom control xpDebugToolbar SSJS library eu.linqed.debugtoolbar.DebugToolbar Java class eu.linqed.debugtoolbar.Message Java class debugToolbarConsole XPage optional debugToolbarErrorPage XPage optional dBar Managed bean Events View OpenLog integration Event Form OpenLog integration
  • 30. Scope contents  Shows contents of  applicationScope  sessionScope  viewScope  requestScope  Remove a variable  Or clean an entire scope  Modify values through the Inspector
  • 31. Environment variables  Information about the current:      User Browser Server Database Request  Java heap size     Maximum heap size Allocated Used Free
  • 32. Inspector  View classes for controls on the current page  And change them  View any variable:  Scoped variables  Managed beans  Any XPage runtime object  Drill-down to see what value/ object is returned
  • 33. Messages  Alternative to print() or _dump() functions  No server console access needed  Your messages only  Makes your admin happy   Add messages using: dBar.debug( “message” ); dBar.info( “message”); dBar.warn( “message” ); dBar.error( “message” ); dBar.dump( <object> );
  • 34. Messages  Specify a context: dBar.info( “message”, “context” );  dBar.error() function accepts ‘error’ objects: try { var doc:NotesDocument = null; var id = doc.getUniversalID(); } catch (e) { dBar.error(e); }  Add a divider to the messages list: dBar.addDivider();
  • 35. Messages  Add debug messages from Java: DebugToolbar.get().info( “message” ); DebugToolbar.get().warn( “message” );  Or catch an Exception  DebugToolbar.get().error( e );
  • 36. Log messages to documents  Create log documents for all dBar calls  All required code built-in  Uses the OpenLog (form/fields) format  Use the OpenLog database to view them  Log level can be set: log only messages with a certain log level (or ‘higher’)  warn = warn + error  debug = debug + info + warn + error
  • 37. Log messages to documents  Configure using managed properties  logDbPath  logEnabled  logLevel current, logdb.nsf true, false debug, info, warn, error  Logging will continue even if the toolbar isn’t displayed
  • 38. Best practices  Add [debug] role to the ACL  Set loaded property of the ccDebugToolbar only for [debug] role: loaded=“#{javascript:context.getUser().getRoles().contains(‘[debug’]}”  Enable logging to documents (errors/ warnings only) logLevel = “warn”  No design changes needed when moving to production
  • 39. Resources  XPage Debug Toolbar on OpenNTF & GitHub  http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocume nt&name=XPage%20Debug%20Toolbar  https://github.com/markleusink/XpageDebugToolbar  OpenNTF Essentials  http://essentials.openntf.org  OpenNTF Import/ export tool  http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocume nt&name=Import%20and%20Export%20for%20Designer  XPages OpenLog Logger  http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocume nt&name=XPages%20OpenLog%20Logger  OpenLog  http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocume nt&name=OpenLog
  • 40. Thank you !  Twitter: markleusink  Skype: mark_leusink  Blog: http://linqed.eu  Email: m.leusink@linqed.eu  http://www.bootstrap4xpages.com