You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Mike Miller <Mi...@jda.com> on 2005/03/18 19:23:28 UTC

[chain] Bug when using ChainListener with org.apache.commons.chain.CONFIG_ATTR ?

Hopefully some of the Chain developers will read this and it will make
sense to them:
 
I am attempting to use the ChainListener with
org.apache.commons.chain.CONFIG_ATTR and
org.apache.commons.chain.CONFIG_CLASS_RESOURCE.   I think I finally
found the problem.  
 
If you use the ChainListener, then the config file should not contain
the catalog start and end tags.  What appears to happen is:
 
1) the CatalogBase gets created within the ChainListener, then
 2) the ChainResources code pushes that catalog on the digester's stack,

3) when the config file <catalog> tag is encountered by the digester, it
also creates a Catalog and that gets pushed on the stack.    
 
Setting a breakpoint in the endDocument() method (line 965 in my copy of
the digester, which is 1.6),  just before the code " while (getCount() >
1), I can see there are two catalogs on the stack.  The top of the stack
looks correct and what I expected to get back, while the bottom (other
entry) is the empty catalog that was created back in the ChainListener.
The loop pops to empty the stack and the ChainListener gets the empty
catalog returned back.  
 
While I understand that the CONFIG_ATTR parm has been deprecated, I
don't think this the behaviour expected.   My guess is that the config
file should always have the catalog start/end tags and that there's a
bug in there somewhere...
 
 
 
 
Mike Miller
JDA Software Group, Inc.
7501 Ester's Blvd, Suite 100
Irving, Texas 75063