Child pages
  • How to debug a D2W application
Skip to end of metadata
Go to start of metadata

The first step is to turn on D2W debug mode in your app Properties file (if it isn't already).
Set:

er.extensions.ERXApplication.developmentMode = true

Walk-through

a

Advanced D2W Debugging

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.
There is a very useful tool to find out what rules are being processed to compute values for D2W keys:

D2W rule tracing.

D2W Rule Tracing

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):

-D2WTraceRuleFiringEnabled true

When you run your application you will get output in the Eclipse console that looks like this:

Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog  - ****** fire :      0 : *true* => startupTask = queryAll (0)
Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog  - ****** fire :      0 : *true* => startupEntityName = null (0)
Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog  - ****** fire :     60 : (task = 'queryAll') => pageName = templateNameForQueryAllPage [er.directtoweb.assignments.ERDKeyValueAssignment] (60001)
Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog  - ****** fire :     20 : *true* => templateNameForQueryAllPage = ERMODQueryEntitiesPage (20000)
Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog (null) - ****** fire :      0 : *true* => targetOutput = html (0)
Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog (null) - ****** fire :      0 : *true* => pageWrapperName = PageWrapper (0)
Aug 10 08:50:17 ImmoData[56741] DEBUG NSLog (null) - ****** fire :     20 : (task = 'queryAll') => displayNameForPageConfiguration = Search All (20001)

Another way to turn on rule tracing is in your app Properties:

log4j.logger.er.directtoweb.rules.ERD2WTraceRuleFiringEnabled = DEBUG

Then say you were trying to debug what rule, or set of rules, were being processed to determing the class string applied to a Diva look component, you set:

log4j.logger.er.directtoweb.rules.class.fire = DEBUG
log4j.logger.er.directtoweb.rules.class.candidates = DEBUG
log4j.logger.er.directtoweb.rules.class.cache = DEBUG

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 class.

  • No labels