Wiki source code of How to debug a D2W application

Last modified by Theodore Petrosky on 2013/05/03 09:32

Hide last authors
Markus Ruggiero 28.1 1 The first step is to turn on D2W debug mode in your app Properties file (if it isn't already).
Theodore Petrosky 33.1 2 Set:
Ravi Mendis 14.1 3
Theodore Petrosky 33.1 4 {{code language="none"}}er.extensions.ERXApplication.developmentMode = true{{/code}}
Ravi Mendis 16.1 5
Ravi Mendis 22.1 6 === Walk-through ===
Ravi Mendis 16.1 7
Ravi Mendis 24.1 8
Theodore Petrosky 33.1 9
Theodore Petrosky 34.1 10 {{multimedia width="1280" att--filename="DebugRulesModernLook.mov" height="720"/}}
Theodore Petrosky 33.1 11
Theodore Petrosky 30.1 12 a
13
Ravi Mendis 24.1 14 == Advanced D2W Debugging ==
15
16 One of the most common problems to occur in a D2W application is that your rule that you've added just doesn't seem to be processed.
Theodore Petrosky 33.1 17 There is a very useful tool to find out what rules are being processed to compute values for D2W keys:
Ravi Mendis 24.1 18
19 D2W rule tracing.
20
21 === D2W Rule Tracing ===
22
Markus Ruggiero 28.1 23 Probably the easiest way to get rule tracing output is to add the following property in your run configuration in Eclipse (it's in the WO-Tab):
Ravi Mendis 24.1 24
Theodore Petrosky 33.1 25 {{code language="none"}}-D2WTraceRuleFiringEnabled true{{/code}}
Markus Ruggiero 28.1 26
27 When you run your application you will get output in the Eclipse console that looks like this:
28
29 {{noformat}}
30
31 Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog - ****** fire : 0 : *true* => startupTask = queryAll (0)
32 Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog - ****** fire : 0 : *true* => startupEntityName = null (0)
33 Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog - ****** fire : 60 : (task = 'queryAll') => pageName = templateNameForQueryAllPage [er.directtoweb.assignments.ERDKeyValueAssignment] (60001)
34 Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog - ****** fire : 20 : *true* => templateNameForQueryAllPage = ERMODQueryEntitiesPage (20000)
35 Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog (null) - ****** fire : 0 : *true* => targetOutput = html (0)
36 Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog (null) - ****** fire : 0 : *true* => pageWrapperName = PageWrapper (0)
37 Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog (null) - ****** fire : 20 : (task = 'queryAll') => displayNameForPageConfiguration = Search All (20001)
38
39 {{/noformat}}
40
Theodore Petrosky 33.1 41 Another way to turn on rule tracing is in your app {{code language="none"}}Properties{{/code}}:
Markus Ruggiero 28.1 42
Theodore Petrosky 33.1 43 {{code language="none"}}log4j.logger.er.directtoweb.rules.ERD2WTraceRuleFiringEnabled = DEBUG{{/code}}
Ravi Mendis 24.1 44
Theodore Petrosky 33.1 45 Then say you were trying to debug what rule, or set of rules, were being processed to determing the {{code language="none"}}class{{/code}} string applied to a Diva look component, you set:
Ravi Mendis 24.1 46
47 {{noformat}}
48
49 log4j.logger.er.directtoweb.rules.class.fire = DEBUG
50 log4j.logger.er.directtoweb.rules.class.candidates = DEBUG
51 log4j.logger.er.directtoweb.rules.class.cache = DEBUG
52
53 {{/noformat}}
54
Theodore Petrosky 33.1 55 Now when you launch your application and navigate to the page and/or component in question, you will see in the Console output, the D2W rules fired to determine the {{code language="none"}}class{{/code}}.