Wiki source code of How to debug a D2W application

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

Show last authors
1 The first step is to turn on D2W debug mode in your app Properties file (if it isn't already).
2 Set:
3
4 {{code language="none"}}er.extensions.ERXApplication.developmentMode = true{{/code}}
5
6 === Walk-through ===
7
8
9
10 {{multimedia width="1280" att--filename="DebugRulesModernLook.mov" height="720"/}}
11
12 a
13
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.
17 There is a very useful tool to find out what rules are being processed to compute values for D2W keys:
18
19 D2W rule tracing.
20
21 === D2W Rule Tracing ===
22
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):
24
25 {{code language="none"}}-D2WTraceRuleFiringEnabled true{{/code}}
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
41 Another way to turn on rule tracing is in your app {{code language="none"}}Properties{{/code}}:
42
43 {{code language="none"}}log4j.logger.er.directtoweb.rules.ERD2WTraceRuleFiringEnabled = DEBUG{{/code}}
44
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:
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
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}}.